Skip to content

Commit bfe3442

Browse files
author
etotmeni
committed
Small fix
1 parent 669ed57 commit bfe3442

File tree

3 files changed

+75
-68
lines changed

3 files changed

+75
-68
lines changed

dpctl-capi/tests/test_sycl_device_aspects.cpp

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,32 @@ auto build_params()
7575

7676
constexpr auto param_2 =
7777
get_param_list<std::pair<const char *, cl::sycl::aspect>>(
78-
// clang-format off
79-
std::make_pair("host", cl::sycl::aspect::host),
80-
std::make_pair("cpu", cl::sycl::aspect::cpu),
78+
std::make_pair("host", cl::sycl::aspect::host),
79+
std::make_pair("cpu", cl::sycl::aspect::cpu),
8180
std::make_pair("gpu", cl::sycl::aspect::gpu),
8281
std::make_pair("accelerator", cl::sycl::aspect::accelerator),
8382
std::make_pair("custom", cl::sycl::aspect::custom),
84-
std::make_pair("fp16", cl::sycl::aspect::fp16),
83+
std::make_pair("fp16", cl::sycl::aspect::fp16),
8584
std::make_pair("fp64", cl::sycl::aspect::fp64),
86-
std::make_pair("int64_base_atomics", cl::sycl::aspect::int64_base_atomics),
87-
std::make_pair("int64_extended_atomics", cl::sycl::aspect::int64_extended_atomics),
88-
std::make_pair("online_compiler", cl::sycl::aspect::online_compiler),
85+
std::make_pair("int64_base_atomics",
86+
cl::sycl::aspect::int64_base_atomics),
87+
std::make_pair("int64_extended_atomics",
88+
cl::sycl::aspect::int64_extended_atomics),
89+
std::make_pair("online_compiler",
90+
cl::sycl::aspect::online_compiler),
8991
std::make_pair("online_linker", cl::sycl::aspect::online_linker),
90-
std::make_pair("queue_profiling", cl::sycl::aspect::queue_profiling),
91-
std::make_pair("usm_device_allocations", cl::sycl::aspect::usm_device_allocations),
92-
std::make_pair("usm_host_allocations", cl::sycl::aspect::usm_host_allocations),
93-
std::make_pair("usm_shared_allocations", cl::sycl::aspect::usm_shared_allocations),
94-
std::make_pair("usm_restricted_shared_allocations", cl::sycl::aspect::usm_restricted_shared_allocations),
95-
std::make_pair("usm_system_allocator", cl::sycl::aspect::usm_system_allocator));
96-
// clang-format on
92+
std::make_pair("queue_profiling",
93+
cl::sycl::aspect::queue_profiling),
94+
std::make_pair("usm_device_allocations",
95+
cl::sycl::aspect::usm_device_allocations),
96+
std::make_pair("usm_host_allocations",
97+
cl::sycl::aspect::usm_host_allocations),
98+
std::make_pair("usm_shared_allocations",
99+
cl::sycl::aspect::usm_shared_allocations),
100+
std::make_pair("usm_restricted_shared_allocations",
101+
cl::sycl::aspect::usm_restricted_shared_allocations),
102+
std::make_pair("usm_system_allocator",
103+
cl::sycl::aspect::usm_system_allocator));
97104

98105
auto pairs =
99106
build_param_pairs<const char *,

dpctl/_sycl_device.pyx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -380,92 +380,92 @@ cdef class SyclDevice(_SyclDevice):
380380
)
381381

382382
@property
383-
def aspect_host(self):
383+
def has_aspect_host(self):
384384
cdef _aspect_type AT = _aspect_type._host
385385
return DPCTLDevice_HasAspect(self._device_ref, AT)
386386

387387
@property
388-
def aspect_cpu(self):
388+
def has_aspect_cpu(self):
389389
cdef _aspect_type AT = _aspect_type._cpu
390390
return DPCTLDevice_HasAspect(self._device_ref, AT)
391391

392392
@property
393-
def aspect_gpu(self):
393+
def has_aspect_gpu(self):
394394
cdef _aspect_type AT = _aspect_type._gpu
395395
return DPCTLDevice_HasAspect(self._device_ref, AT)
396396

397397
@property
398-
def aspect_accelerator(self):
398+
def has_aspect_accelerator(self):
399399
cdef _aspect_type AT = _aspect_type._accelerator
400400
return DPCTLDevice_HasAspect(self._device_ref, AT)
401401

402402
@property
403-
def aspect_custom(self):
403+
def has_aspect_custom(self):
404404
cdef _aspect_type AT = _aspect_type._custom
405405
return DPCTLDevice_HasAspect(self._device_ref, AT)
406406

407407
@property
408-
def aspect_fp16(self):
408+
def has_aspect_fp16(self):
409409
cdef _aspect_type AT = _aspect_type._fp16
410410
return DPCTLDevice_HasAspect(self._device_ref, AT)
411411

412412
@property
413-
def aspect_fp64(self):
413+
def has_aspect_fp64(self):
414414
cdef _aspect_type AT = _aspect_type._fp64
415415
return DPCTLDevice_HasAspect(self._device_ref, AT)
416416

417417
@property
418-
def aspect_int64_base_atomics(self):
418+
def has_aspect_int64_base_atomics(self):
419419
cdef _aspect_type AT = _aspect_type._int64_base_atomics
420420
return DPCTLDevice_HasAspect(self._device_ref, AT)
421421

422422
@property
423-
def aspect_int64_extended_atomics(self):
423+
def has_aspect_int64_extended_atomics(self):
424424
cdef _aspect_type AT = _aspect_type._int64_extended_atomics
425425
return DPCTLDevice_HasAspect(self._device_ref, AT)
426426

427427
@property
428-
def aspect_image(self):
428+
def has_aspect_image(self):
429429
cdef _aspect_type AT = _aspect_type._image
430430
return DPCTLDevice_HasAspect(self._device_ref, AT)
431431

432432
@property
433-
def aspect_online_compiler(self):
433+
def has_aspect_online_compiler(self):
434434
cdef _aspect_type AT = _aspect_type._online_compiler
435435
return DPCTLDevice_HasAspect(self._device_ref, AT)
436436

437437
@property
438-
def aspect_online_linker(self):
438+
def has_aspect_online_linker(self):
439439
cdef _aspect_type AT = _aspect_type._online_linker
440440
return DPCTLDevice_HasAspect(self._device_ref, AT)
441441

442442
@property
443-
def aspect_queue_profiling(self):
443+
def has_aspect_queue_profiling(self):
444444
cdef _aspect_type AT = _aspect_type._queue_profiling
445445
return DPCTLDevice_HasAspect(self._device_ref, AT)
446446

447447
@property
448-
def aspect_usm_device_allocations(self):
448+
def has_aspect_usm_device_allocations(self):
449449
cdef _aspect_type AT = _aspect_type._usm_device_allocations
450450
return DPCTLDevice_HasAspect(self._device_ref, AT)
451451

452452
@property
453-
def aspect_usm_host_allocations(self):
453+
def has_aspect_usm_host_allocations(self):
454454
cdef _aspect_type AT = _aspect_type._usm_host_allocations
455455
return DPCTLDevice_HasAspect(self._device_ref, AT)
456456

457457
@property
458-
def aspect_usm_shared_allocations(self):
458+
def has_aspect_usm_shared_allocations(self):
459459
cdef _aspect_type AT = _aspect_type._usm_shared_allocations
460460
return DPCTLDevice_HasAspect(self._device_ref, AT)
461461

462462
@property
463-
def aspect_usm_restricted_shared_allocations(self):
463+
def has_aspect_usm_restricted_shared_allocations(self):
464464
cdef _aspect_type AT = _aspect_type._usm_restricted_shared_allocations
465465
return DPCTLDevice_HasAspect(self._device_ref, AT)
466466

467467
@property
468-
def aspect_usm_system_allocator(self):
468+
def has_aspect_usm_system_allocator(self):
469469
cdef _aspect_type AT = _aspect_type._usm_system_allocator
470470
return DPCTLDevice_HasAspect(self._device_ref, AT)
471471

dpctl/tests/test_sycl_device.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -88,128 +88,128 @@ def check_get_max_num_sub_groups(device):
8888

8989
def check_has_aspect_host(device):
9090
try:
91-
device.aspect_host
91+
device.has_aspect_host
9292
except Exception:
93-
pytest.fail("aspect_host call failed")
93+
pytest.fail("has_aspect_host call failed")
9494

9595

9696
def check_has_aspect_cpu(device):
9797
try:
98-
device.aspect_cpu
98+
device.has_aspect_cpu
9999
except Exception:
100-
pytest.fail("aspect_cpu call failed")
100+
pytest.fail("has_aspect_cpu call failed")
101101

102102

103103
def check_has_aspect_gpu(device):
104104
try:
105-
device.aspect_gpu
105+
device.has_aspect_gpu
106106
except Exception:
107-
pytest.fail("aspect_gpu call failed")
107+
pytest.fail("has_aspect_gpu call failed")
108108

109109

110110
def check_has_aspect_accelerator(device):
111111
try:
112-
device.aspect_accelerator
112+
device.has_aspect_accelerator
113113
except Exception:
114-
pytest.fail("aspect_accelerator call failed")
114+
pytest.fail("has_aspect_accelerator call failed")
115115

116116

117117
def check_has_aspect_custom(device):
118118
try:
119-
device.aspect_custom
119+
device.has_aspect_custom
120120
except Exception:
121-
pytest.fail("aspect_custom call failed")
121+
pytest.fail("has_aspect_custom call failed")
122122

123123

124124
def check_has_aspect_fp16(device):
125125
try:
126-
device.aspect_fp16
126+
device.has_aspect_fp16
127127
except Exception:
128-
pytest.fail("aspect_fp16 call failed")
128+
pytest.fail("has_aspect_fp16 call failed")
129129

130130

131131
def check_has_aspect_fp64(device):
132132
try:
133-
device.aspect_fp64
133+
device.has_aspect_fp64
134134
except Exception:
135-
pytest.fail("aspect_fp64 call failed")
135+
pytest.fail("has_aspect_fp64 call failed")
136136

137137

138138
def check_has_aspect_int64_base_atomics(device):
139139
try:
140-
device.aspect_int64_base_atomics
140+
device.has_aspect_int64_base_atomics
141141
except Exception:
142-
pytest.fail("aspect_int64_base_atomics call failed")
142+
pytest.fail("has_aspect_int64_base_atomics call failed")
143143

144144

145145
def check_has_aspect_int64_extended_atomics(device):
146146
try:
147-
device.aspect_int64_extended_atomics
147+
device.has_aspect_int64_extended_atomics
148148
except Exception:
149-
pytest.fail("aspect_int64_extended_atomics call failed")
149+
pytest.fail("has_aspect_int64_extended_atomics call failed")
150150

151151

152152
def check_has_aspect_image(device):
153153
try:
154-
device.aspect_image
154+
device.has_aspect_image
155155
except Exception:
156-
pytest.fail("aspect_image call failed")
156+
pytest.fail("has_aspect_image call failed")
157157

158158

159159
def check_has_aspect_online_compiler(device):
160160
try:
161-
device.aspect_online_compiler
161+
device.has_aspect_online_compiler
162162
except Exception:
163-
pytest.fail("aspect_online_compiler call failed")
163+
pytest.fail("has_aspect_online_compiler call failed")
164164

165165

166166
def check_has_aspect_online_linker(device):
167167
try:
168-
device.aspect_online_linker
168+
device.has_aspect_online_linker
169169
except Exception:
170-
pytest.fail("aspect_online_linker call failed")
170+
pytest.fail("has_aspect_online_linker call failed")
171171

172172

173173
def check_has_aspect_queue_profiling(device):
174174
try:
175-
device.aspect_queue_profiling
175+
device.has_aspect_queue_profiling
176176
except Exception:
177-
pytest.fail("aspect_queue_profiling call failed")
177+
pytest.fail("has_aspect_queue_profiling call failed")
178178

179179

180180
def check_has_aspect_usm_device_allocations(device):
181181
try:
182-
device.aspect_usm_device_allocations
182+
device.has_aspect_usm_device_allocations
183183
except Exception:
184-
pytest.fail("aspect_usm_device_allocations call failed")
184+
pytest.fail("has_aspect_usm_device_allocations call failed")
185185

186186

187187
def check_has_aspect_usm_host_allocations(device):
188188
try:
189-
device.aspect_usm_host_allocations
189+
device.has_aspect_usm_host_allocations
190190
except Exception:
191-
pytest.fail("aspect_usm_host_allocations call failed")
191+
pytest.fail("has_aspect_usm_host_allocations call failed")
192192

193193

194194
def check_has_aspect_usm_shared_allocations(device):
195195
try:
196-
device.aspect_usm_shared_allocations
196+
device.has_aspect_usm_shared_allocations
197197
except Exception:
198-
pytest.fail("aspect_usm_shared_allocations call failed")
198+
pytest.fail("has_aspect_usm_shared_allocations call failed")
199199

200200

201201
def check_has_aspect_usm_restricted_shared_allocations(device):
202202
try:
203-
device.aspect_usm_restricted_shared_allocations
203+
device.has_aspect_usm_restricted_shared_allocations
204204
except Exception:
205-
pytest.fail("aspect_usm_restricted_shared_allocations call failed")
205+
pytest.fail("has_aspect_usm_restricted_shared_allocations call failed")
206206

207207

208208
def check_has_aspect_usm_system_allocator(device):
209209
try:
210-
device.aspect_usm_system_allocator
210+
device.has_aspect_usm_system_allocator
211211
except Exception:
212-
pytest.fail("aspect_usm_system_allocator call failed")
212+
pytest.fail("has_aspect_usm_system_allocator call failed")
213213

214214

215215
def check_is_accelerator(device):

0 commit comments

Comments
 (0)