Skip to content

Commit 3b19493

Browse files
Merge pull request #830 from IntelPython/fix-ci-for-0.12
Fix ci for 0.12
2 parents 9815a7e + 2d793c9 commit 3b19493

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: end-of-file-fixer
1414
- id: trailing-whitespace
1515
- repo: https://github.com/psf/black
16-
rev: 22.1.0
16+
rev: 22.3.0
1717
hooks:
1818
- id: black
1919
exclude: "versioneer.py|dpctl/_version.py"

dpctl/tests/test_sycl_event.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ def test_sycl_timer():
196196
except dpctl.SyclQueueCreationError:
197197
pytest.skip("Queue creation of default device failed")
198198
timer = dpctl.SyclTimer()
199-
m1 = dpctl_mem.MemoryUSMDevice(256 * 1024, queue=q)
200-
m2 = dpctl_mem.MemoryUSMDevice(256 * 1024, queue=q)
199+
m1 = dpctl_mem.MemoryUSMDevice(1024 * 1024, queue=q)
200+
m2 = dpctl_mem.MemoryUSMDevice(1024 * 1024, queue=q)
201201
with timer(q):
202202
# device task
203203
m1.copy_from_device(m2)
204-
# host task
205-
[x**2 for x in range(1024)]
204+
# host operation
205+
[x**2 for x in range(128 * 1024)]
206206
host_dt, device_dt = timer.dt
207-
assert host_dt > device_dt
207+
assert host_dt > device_dt or (host_dt > 0 and device_dt >= 0)
208208
q_no_profiling = dpctl.SyclQueue()
209209
assert q_no_profiling.has_enable_profiling is False
210210
with pytest.raises(ValueError):

setup.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ def copy_file(self, src, dst, preserve_mode=True):
8585
_patched_copy_file(src, dst, preserve_mode=preserve_mode)
8686
return (dst, 1)
8787

88+
def build_package_data(self):
89+
"""Copy data files into build directory"""
90+
for package, src_dir, build_dir, filenames in self.data_files:
91+
for filename in filenames:
92+
target = os.path.join(build_dir, filename)
93+
self.mkpath(os.path.dirname(target))
94+
srcfile = os.path.join(src_dir, filename)
95+
outf, copied = self.copy_file(srcfile, target)
96+
srcfile = os.path.abspath(srcfile)
97+
8898

8999
class InstallCmd(_skbuild_install):
90100
def run(self):
@@ -93,13 +103,19 @@ def run(self):
93103
this_dir = os.path.dirname(os.path.abspath(__file__))
94104
dpctl_build_dir = os.path.join(this_dir, self.build_lib, "dpctl")
95105
dpctl_install_dir = os.path.join(self.install_libbase, "dpctl")
96-
for fn in glob.glob(
97-
os.path.join(dpctl_install_dir, "*DPCTLSyclInterface.so*")
98-
):
99-
os.remove(fn)
106+
sofiles = glob.glob(
107+
os.path.join(dpctl_build_dir, "*DPCTLSyclInterface.so*")
108+
)
109+
# insert actual file at the beginning of the list
110+
pos = [i for i, fn in enumerate(sofiles) if not os.path.islink(fn)]
111+
if pos:
112+
hard_file = sofiles.pop(pos[0])
113+
sofiles.insert(0, hard_file)
114+
for fn in sofiles:
100115
base_fn = os.path.basename(fn)
101116
src_file = os.path.join(dpctl_build_dir, base_fn)
102117
dst_file = os.path.join(dpctl_install_dir, base_fn)
118+
os.remove(dst_file)
103119
_patched_copy_file(src_file, dst_file)
104120
return ret
105121

0 commit comments

Comments
 (0)