Skip to content

Commit 65a4b4d

Browse files
Remove deprecated aspects related to atomics, added supported aspects
From gh-309 only emulated aspect remains unsupported. The following aspects from gh-309 are now supported sycl::aspect::host_debuggable, sycl::aspect::atomic64, sycl::aspect::usm_atomic_host_allocations, sycl::aspect::usm_atomic_shared_allocations, Removed (due to deprecation in DPC++) aspects are int64_base_atomics int64_extended_atomics
1 parent e132320 commit 65a4b4d

File tree

7 files changed

+133
-64
lines changed

7 files changed

+133
-64
lines changed

dpctl/_backend.pxd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
8383
_custom 'custom',
8484
_fp16 'fp16',
8585
_fp64 'fp64',
86-
_int64_base_atomics 'int64_base_atomics',
87-
_int64_extended_atomics 'int64_extended_atomics',
86+
_atomic64 'atomic64',
8887
_image 'image',
8988
_online_compiler 'online_compiler',
9089
_online_linker 'online_linker',
@@ -93,7 +92,10 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
9392
_usm_host_allocations 'usm_host_allocations',
9493
_usm_shared_allocations 'usm_shared_allocations',
9594
_usm_restricted_shared_allocations 'usm_restricted_shared_allocations',
96-
_usm_system_allocations 'usm_system_allocations'
95+
_usm_system_allocations 'usm_system_allocations',
96+
_usm_atomic_host_allocations 'usm_atomic_host_allocations',
97+
_usm_atomic_shared_allocations 'usm_atomic_shared_allocations',
98+
_host_debuggable 'host_debuggable',
9799

98100
ctypedef enum _partition_affinity_domain_type 'DPCTLPartitionAffinityDomainType':
99101
_not_applicable 'not_applicable',

dpctl/_sycl_device.pyx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,8 @@ cdef class SyclDevice(_SyclDevice):
420420
return DPCTLDevice_HasAspect(self._device_ref, AT)
421421

422422
@property
423-
def has_aspect_int64_base_atomics(self):
424-
cdef _aspect_type AT = _aspect_type._int64_base_atomics
425-
return DPCTLDevice_HasAspect(self._device_ref, AT)
426-
427-
@property
428-
def has_aspect_int64_extended_atomics(self):
429-
cdef _aspect_type AT = _aspect_type._int64_extended_atomics
423+
def has_aspect_atomic64(self):
424+
cdef _aspect_type AT = _aspect_type._atomic64
430425
return DPCTLDevice_HasAspect(self._device_ref, AT)
431426

432427
@property
@@ -474,6 +469,21 @@ cdef class SyclDevice(_SyclDevice):
474469
cdef _aspect_type AT = _aspect_type._usm_system_allocations
475470
return DPCTLDevice_HasAspect(self._device_ref, AT)
476471

472+
@property
473+
def has_aspect_usm_atomic_host_allocations(self):
474+
cdef _aspect_type AT = _aspect_type._usm_atomic_host_allocations
475+
return DPCTLDevice_HasAspect(self._device_ref, AT)
476+
477+
@property
478+
def has_aspect_usm_atomic_shared_allocations(self):
479+
cdef _aspect_type AT = _aspect_type._usm_atomic_shared_allocations
480+
return DPCTLDevice_HasAspect(self._device_ref, AT)
481+
482+
@property
483+
def has_aspect_host_debuggable(self):
484+
cdef _aspect_type AT = _aspect_type._host_debuggable
485+
return DPCTLDevice_HasAspect(self._device_ref, AT)
486+
477487
@property
478488
def image_2d_max_width(self):
479489
""" Returns the maximum width of a 2D image or 1D image in pixels.

dpctl/tests/test_sycl_device.py

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,11 @@ def check_has_aspect_fp64(device):
149149
pytest.fail("has_aspect_fp64 call failed")
150150

151151

152-
def check_has_aspect_int64_base_atomics(device):
152+
def check_has_aspect_atomic64(device):
153153
try:
154-
device.has_aspect_int64_base_atomics
154+
device.has_aspect_atomic64
155155
except Exception:
156-
pytest.fail("has_aspect_int64_base_atomics call failed")
157-
158-
159-
def check_has_aspect_int64_extended_atomics(device):
160-
try:
161-
device.has_aspect_int64_extended_atomics
162-
except Exception:
163-
pytest.fail("has_aspect_int64_extended_atomics call failed")
156+
pytest.fail("has_aspect_atomic64 call failed")
164157

165158

166159
def check_has_aspect_image(device):
@@ -226,6 +219,27 @@ def check_has_aspect_usm_system_allocations(device):
226219
pytest.fail("has_aspect_usm_system_allocations call failed")
227220

228221

222+
def check_has_aspect_usm_atomic_host_allocations(device):
223+
try:
224+
device.has_aspect_usm_atomic_host_allocations
225+
except Exception:
226+
pytest.fail("has_aspect_usm_atomic_host_allocations call failed")
227+
228+
229+
def check_has_aspect_usm_atomic_shared_allocations(device):
230+
try:
231+
device.has_aspect_usm_atomic_shared_allocations
232+
except Exception:
233+
pytest.fail("has_aspect_usm_atomic_shared_allocations call failed")
234+
235+
236+
def check_has_aspect_host_debuggable(device):
237+
try:
238+
device.has_aspect_host_debuggable
239+
except Exception:
240+
pytest.fail("has_aspect_host_debuggable call failed")
241+
242+
229243
def check_is_accelerator(device):
230244
try:
231245
device.is_accelerator
@@ -526,8 +540,7 @@ def check_platform(device):
526540
check_has_aspect_custom,
527541
check_has_aspect_fp16,
528542
check_has_aspect_fp64,
529-
check_has_aspect_int64_base_atomics,
530-
check_has_aspect_int64_extended_atomics,
543+
check_has_aspect_atomic64,
531544
check_has_aspect_image,
532545
check_has_aspect_online_compiler,
533546
check_has_aspect_online_linker,
@@ -537,6 +550,9 @@ def check_platform(device):
537550
check_has_aspect_usm_shared_allocations,
538551
check_has_aspect_usm_restricted_shared_allocations,
539552
check_has_aspect_usm_system_allocations,
553+
check_has_aspect_usm_atomic_host_allocations,
554+
check_has_aspect_usm_atomic_shared_allocations,
555+
check_has_aspect_host_debuggable,
540556
check_get_max_read_image_args,
541557
check_get_max_write_image_args,
542558
check_get_image_2d_max_width,
@@ -703,16 +719,16 @@ def test_hashing_of_device():
703719
"usm_host_allocations",
704720
"usm_shared_allocations",
705721
"usm_system_allocations",
722+
"host_debuggable",
723+
"atomic64",
724+
"usm_atomic_host_allocations",
725+
"usm_atomic_shared_allocations",
706726
]
707727

708728
# SYCL 2020 spec aspects not presently
709729
# supported in DPC++, and dpctl
710730
list_of_unsupported_aspects = [
711731
"emulated",
712-
"host_debuggable",
713-
"atomic64",
714-
"usm_atomic_host_allocations",
715-
"usm_atomic_shared_allocations",
716732
]
717733

718734

dpctl/tests/test_sycl_queue.py

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,11 @@ def check_has_aspect_fp64(device):
141141
pytest.fail("has_aspect_fp64 call failed")
142142

143143

144-
def check_has_aspect_int64_base_atomics(device):
144+
def check_has_aspect_atomic64(device):
145145
try:
146-
device.has_aspect_int64_base_atomics
146+
device.has_aspect_atomic64
147147
except Exception:
148-
pytest.fail("has_aspect_int64_base_atomics call failed")
149-
150-
151-
def check_has_aspect_int64_extended_atomics(device):
152-
try:
153-
device.has_aspect_int64_extended_atomics
154-
except Exception:
155-
pytest.fail("has_aspect_int64_extended_atomics call failed")
148+
pytest.fail("has_aspect_atomic64 call failed")
156149

157150

158151
def check_has_aspect_image(device):
@@ -218,6 +211,27 @@ def check_has_aspect_usm_system_allocations(device):
218211
pytest.fail("has_aspect_usm_system_allocations call failed")
219212

220213

214+
def check_has_aspect_usm_atomic_host_allocations(device):
215+
try:
216+
device.has_aspect_usm_atomic_host_allocations
217+
except Exception:
218+
pytest.fail("has_aspect_usm_atomic_host_allocations call failed")
219+
220+
221+
def check_has_aspect_usm_atomic_shared_allocations(device):
222+
try:
223+
device.has_aspect_usm_atomic_shared_allocations
224+
except Exception:
225+
pytest.fail("has_aspect_usm_atomic_shared_allocations call failed")
226+
227+
228+
def check_has_aspect_host_debuggable(device):
229+
try:
230+
device.has_aspect_host_debuggable
231+
except Exception:
232+
pytest.fail("has_aspect_host_debuggable call failed")
233+
234+
221235
def check_is_accelerator(device):
222236
try:
223237
device.is_accelerator
@@ -263,8 +277,7 @@ def check_is_host(device):
263277
check_has_aspect_custom,
264278
check_has_aspect_fp16,
265279
check_has_aspect_fp64,
266-
check_has_aspect_int64_base_atomics,
267-
check_has_aspect_int64_extended_atomics,
280+
check_has_aspect_atomic64,
268281
check_has_aspect_image,
269282
check_has_aspect_online_compiler,
270283
check_has_aspect_online_linker,
@@ -274,6 +287,9 @@ def check_is_host(device):
274287
check_has_aspect_usm_shared_allocations,
275288
check_has_aspect_usm_restricted_shared_allocations,
276289
check_has_aspect_usm_system_allocations,
290+
check_has_aspect_usm_atomic_host_allocations,
291+
check_has_aspect_usm_atomic_shared_allocations,
292+
check_has_aspect_host_debuggable,
277293
]
278294

279295

libsyclinterface/helper/source/dpctl_utils_helper.cpp

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,8 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
191191
case aspect::fp64:
192192
ss << "fp64";
193193
break;
194-
case aspect::int64_base_atomics:
195-
ss << "int64_base_atomics";
196-
break;
197-
case aspect::int64_extended_atomics:
198-
ss << "int64_extended_atomics";
194+
case aspect::atomic64:
195+
ss << "atomic64";
199196
break;
200197
case aspect::image:
201198
ss << "image";
@@ -224,6 +221,15 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
224221
case aspect::usm_system_allocations:
225222
ss << "usm_system_allocations";
226223
break;
224+
case aspect::usm_atomic_host_allocations:
225+
ss << "usm_atomic_host_allocations";
226+
break;
227+
case aspect::usm_atomic_shared_allocations:
228+
ss << "usm_atomic_shared_allocations";
229+
break;
230+
case aspect::host_debuggable:
231+
ss << "host_debuggable";
232+
break;
227233
default:
228234
throw std::runtime_error("Unsupported aspect type");
229235
}
@@ -257,11 +263,8 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
257263
else if (aspectTyStr == "fp64") {
258264
aspectTy = aspect::fp64;
259265
}
260-
else if (aspectTyStr == "int64_base_atomics") {
261-
aspectTy = aspect::int64_base_atomics;
262-
}
263-
else if (aspectTyStr == "int64_extended_atomics") {
264-
aspectTy = aspect::int64_extended_atomics;
266+
else if (aspectTyStr == "atomic64") {
267+
aspectTy = aspect::atomic64;
265268
}
266269
else if (aspectTyStr == "image") {
267270
aspectTy = aspect::image;
@@ -290,6 +293,15 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
290293
else if (aspectTyStr == "usm_system_allocations") {
291294
aspectTy = aspect::usm_system_allocations;
292295
}
296+
else if (aspectTyStr == "usm_atomic_host_allocations") {
297+
aspectTy = aspect::usm_atomic_host_allocations;
298+
}
299+
else if (aspectTyStr == "usm_atomic_shared_allocations") {
300+
aspectTy = aspect::usm_atomic_shared_allocations;
301+
}
302+
else if (aspectTyStr == "host_debuggable") {
303+
aspectTy = aspect::host_debuggable;
304+
}
293305
else {
294306
// \todo handle the error
295307
throw std::runtime_error("Unsupported aspect type");
@@ -314,10 +326,8 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
314326
return aspect::fp16;
315327
case DPCTLSyclAspectType::fp64:
316328
return aspect::fp64;
317-
case DPCTLSyclAspectType::int64_base_atomics:
318-
return aspect::int64_base_atomics;
319-
case DPCTLSyclAspectType::int64_extended_atomics:
320-
return aspect::int64_extended_atomics;
329+
case DPCTLSyclAspectType::atomic64:
330+
return aspect::atomic64;
321331
case DPCTLSyclAspectType::image:
322332
return aspect::image;
323333
case DPCTLSyclAspectType::online_compiler:
@@ -336,6 +346,12 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
336346
return aspect::usm_restricted_shared_allocations;
337347
case DPCTLSyclAspectType::usm_system_allocations:
338348
return aspect::usm_system_allocations;
349+
case DPCTLSyclAspectType::usm_atomic_host_allocations:
350+
return aspect::usm_atomic_host_allocations;
351+
case DPCTLSyclAspectType::usm_atomic_shared_allocations:
352+
return aspect::usm_atomic_shared_allocations;
353+
case DPCTLSyclAspectType::host_debuggable:
354+
return aspect::host_debuggable;
339355
default:
340356
throw std::runtime_error("Unsupported aspect type");
341357
}
@@ -358,10 +374,8 @@ DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect)
358374
return DPCTLSyclAspectType::fp16;
359375
case aspect::fp64:
360376
return DPCTLSyclAspectType::fp64;
361-
case aspect::int64_base_atomics:
362-
return DPCTLSyclAspectType::int64_base_atomics;
363-
case aspect::int64_extended_atomics:
364-
return DPCTLSyclAspectType::int64_extended_atomics;
377+
case aspect::atomic64:
378+
return DPCTLSyclAspectType::atomic64;
365379
case aspect::image:
366380
return DPCTLSyclAspectType::image;
367381
case aspect::online_compiler:
@@ -380,6 +394,12 @@ DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect)
380394
return DPCTLSyclAspectType::usm_restricted_shared_allocations;
381395
case aspect::usm_system_allocations:
382396
return DPCTLSyclAspectType::usm_system_allocations;
397+
case aspect::usm_atomic_host_allocations:
398+
return DPCTLSyclAspectType::usm_atomic_host_allocations;
399+
case aspect::usm_atomic_shared_allocations:
400+
return DPCTLSyclAspectType::usm_atomic_shared_allocations;
401+
case aspect::host_debuggable:
402+
return DPCTLSyclAspectType::host_debuggable;
383403
default:
384404
throw std::runtime_error("Unsupported aspect type");
385405
}

libsyclinterface/include/dpctl_sycl_enum_types.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ typedef enum
109109
custom,
110110
fp16,
111111
fp64,
112-
int64_base_atomics,
113-
int64_extended_atomics,
112+
atomic64,
114113
image,
115114
online_compiler,
116115
online_linker,
@@ -119,7 +118,10 @@ typedef enum
119118
usm_host_allocations,
120119
usm_shared_allocations,
121120
usm_restricted_shared_allocations,
122-
usm_system_allocations
121+
usm_system_allocations,
122+
usm_atomic_host_allocations,
123+
usm_atomic_shared_allocations,
124+
host_debuggable,
123125
} DPCTLSyclAspectType;
124126

125127
/*!

libsyclinterface/tests/test_sycl_device_aspects.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ auto build_params()
8282
std::make_pair("custom", cl::sycl::aspect::custom),
8383
std::make_pair("fp16", cl::sycl::aspect::fp16),
8484
std::make_pair("fp64", cl::sycl::aspect::fp64),
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),
85+
std::make_pair("atomic64", cl::sycl::aspect::atomic64),
8986
std::make_pair("online_compiler",
9087
cl::sycl::aspect::online_compiler),
9188
std::make_pair("online_linker", cl::sycl::aspect::online_linker),
@@ -100,7 +97,13 @@ auto build_params()
10097
std::make_pair("usm_restricted_shared_allocations",
10198
cl::sycl::aspect::usm_restricted_shared_allocations),
10299
std::make_pair("usm_system_allocations",
103-
cl::sycl::aspect::usm_system_allocations));
100+
cl::sycl::aspect::usm_system_allocations),
101+
std::make_pair("usm_atomic_host_allocations",
102+
cl::sycl::aspect::usm_atomic_host_allocations),
103+
std::make_pair("usm_atomic_shared_allocations",
104+
cl::sycl::aspect::usm_atomic_shared_allocations),
105+
std::make_pair("host_debuggable",
106+
cl::sycl::aspect::host_debuggable));
104107

105108
auto pairs =
106109
build_param_pairs<const char *,

0 commit comments

Comments
 (0)