Skip to content

Commit 024a23b

Browse files
Merge pull request #758 from IntelPython/cleanup/includes-and-deprecations
Cleanup: sycl deprecation warnings, includes
2 parents f9d7498 + 89b955f commit 024a23b

25 files changed

+72
-69
lines changed

dpctl/_backend.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
9393
_usm_host_allocations 'usm_host_allocations',
9494
_usm_shared_allocations 'usm_shared_allocations',
9595
_usm_restricted_shared_allocations 'usm_restricted_shared_allocations',
96-
_usm_system_allocator 'usm_system_allocator'
96+
_usm_system_allocations 'usm_system_allocations'
9797

9898
ctypedef enum _partition_affinity_domain_type 'DPCTLPartitionAffinityDomainType':
9999
_not_applicable 'not_applicable',

dpctl/_sycl_device.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ cdef class SyclDevice(_SyclDevice):
441441
return DPCTLDevice_HasAspect(self._device_ref, AT)
442442

443443
@property
444-
def has_aspect_usm_system_allocator(self):
445-
cdef _aspect_type AT = _aspect_type._usm_system_allocator
444+
def has_aspect_usm_system_allocations(self):
445+
cdef _aspect_type AT = _aspect_type._usm_system_allocations
446446
return DPCTLDevice_HasAspect(self._device_ref, AT)
447447

448448
@property

dpctl/tests/test_sycl_device.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ def check_has_aspect_usm_restricted_shared_allocations(device):
219219
pytest.fail("has_aspect_usm_restricted_shared_allocations call failed")
220220

221221

222-
def check_has_aspect_usm_system_allocator(device):
222+
def check_has_aspect_usm_system_allocations(device):
223223
try:
224-
device.has_aspect_usm_system_allocator
224+
device.has_aspect_usm_system_allocations
225225
except Exception:
226-
pytest.fail("has_aspect_usm_system_allocator call failed")
226+
pytest.fail("has_aspect_usm_system_allocations call failed")
227227

228228

229229
def check_is_accelerator(device):
@@ -520,7 +520,7 @@ def check_repr(device):
520520
check_has_aspect_usm_host_allocations,
521521
check_has_aspect_usm_shared_allocations,
522522
check_has_aspect_usm_restricted_shared_allocations,
523-
check_has_aspect_usm_system_allocator,
523+
check_has_aspect_usm_system_allocations,
524524
check_get_max_read_image_args,
525525
check_get_max_write_image_args,
526526
check_get_image_2d_max_width,
@@ -679,7 +679,7 @@ def test_hashing_of_device():
679679
"usm_device_allocations",
680680
"usm_host_allocations",
681681
"usm_shared_allocations",
682-
"usm_system_allocator",
682+
"usm_system_allocations",
683683
]
684684

685685
# SYCL 2020 spec aspects not presently

dpctl/tests/test_sycl_queue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ def check_has_aspect_usm_restricted_shared_allocations(device):
211211
pytest.fail("has_aspect_usm_restricted_shared_allocations call failed")
212212

213213

214-
def check_has_aspect_usm_system_allocator(device):
214+
def check_has_aspect_usm_system_allocations(device):
215215
try:
216-
device.has_aspect_usm_system_allocator
216+
device.has_aspect_usm_system_allocations
217217
except Exception:
218-
pytest.fail("has_aspect_usm_system_allocator call failed")
218+
pytest.fail("has_aspect_usm_system_allocations call failed")
219219

220220

221221
def check_is_accelerator(device):
@@ -273,7 +273,7 @@ def check_is_host(device):
273273
check_has_aspect_usm_host_allocations,
274274
check_has_aspect_usm_shared_allocations,
275275
check_has_aspect_usm_restricted_shared_allocations,
276-
check_has_aspect_usm_system_allocator,
276+
check_has_aspect_usm_system_allocations,
277277
]
278278

279279

libsyclinterface/helper/include/dpctl_string_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// \file
2222
/// Helper function to convert a C++ string to a C string.
2323
//===----------------------------------------------------------------------===//
24-
#include "../helper/include/dpctl_error_handlers.h"
24+
#include "dpctl_error_handlers.h"
2525
#include <cstring>
2626
#include <iostream>
2727
#include <string>

libsyclinterface/helper/source/dpctl_error_handlers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void DPCTL_AsyncErrorHandler::operator()(
3939
std::rethrow_exception(e);
4040
} catch (sycl::exception const &e) {
4141
error_handler(e, __FILE__, __func__, __LINE__);
42-
auto err_code = e.get_cl_code();
42+
auto err_code = e.code().value();
4343
handler_(static_cast<int>(err_code));
4444
}
4545
}

libsyclinterface/helper/source/dpctl_utils_helper.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ backend DPCTL_DPCTLBackendTypeToSyclBackend(DPCTLSyclBackendType BeTy)
9393
case DPCTLSyclBackendType::DPCTL_HOST:
9494
return backend::host;
9595
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO:
96-
return backend::level_zero;
96+
return backend::ext_oneapi_level_zero;
9797
case DPCTLSyclBackendType::DPCTL_OPENCL:
9898
return backend::opencl;
9999
case DPCTLSyclBackendType::DPCTL_ALL_BACKENDS:
@@ -110,7 +110,7 @@ DPCTLSyclBackendType DPCTL_SyclBackendToDPCTLBackendType(backend B)
110110
return DPCTLSyclBackendType::DPCTL_CUDA;
111111
case backend::host:
112112
return DPCTLSyclBackendType::DPCTL_HOST;
113-
case backend::level_zero:
113+
case backend::ext_oneapi_level_zero:
114114
return DPCTLSyclBackendType::DPCTL_LEVEL_ZERO;
115115
case backend::opencl:
116116
return DPCTLSyclBackendType::DPCTL_OPENCL;
@@ -221,8 +221,8 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
221221
case aspect::usm_restricted_shared_allocations:
222222
ss << "usm_restricted_shared_allocations";
223223
break;
224-
case aspect::usm_system_allocator:
225-
ss << "usm_system_allocator";
224+
case aspect::usm_system_allocations:
225+
ss << "usm_system_allocations";
226226
break;
227227
default:
228228
throw std::runtime_error("Unsupported aspect type");
@@ -287,8 +287,8 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
287287
else if (aspectTyStr == "usm_restricted_shared_allocations") {
288288
aspectTy = aspect::usm_restricted_shared_allocations;
289289
}
290-
else if (aspectTyStr == "usm_system_allocator") {
291-
aspectTy = aspect::usm_system_allocator;
290+
else if (aspectTyStr == "usm_system_allocations") {
291+
aspectTy = aspect::usm_system_allocations;
292292
}
293293
else {
294294
// \todo handle the error
@@ -334,8 +334,8 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
334334
return aspect::usm_shared_allocations;
335335
case DPCTLSyclAspectType::usm_restricted_shared_allocations:
336336
return aspect::usm_restricted_shared_allocations;
337-
case DPCTLSyclAspectType::usm_system_allocator:
338-
return aspect::usm_system_allocator;
337+
case DPCTLSyclAspectType::usm_system_allocations:
338+
return aspect::usm_system_allocations;
339339
default:
340340
throw std::runtime_error("Unsupported aspect type");
341341
}
@@ -378,8 +378,8 @@ DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect)
378378
return DPCTLSyclAspectType::usm_shared_allocations;
379379
case aspect::usm_restricted_shared_allocations:
380380
return DPCTLSyclAspectType::usm_restricted_shared_allocations;
381-
case aspect::usm_system_allocator:
382-
return DPCTLSyclAspectType::usm_system_allocator;
381+
case aspect::usm_system_allocations:
382+
return DPCTLSyclAspectType::usm_system_allocations;
383383
default:
384384
throw std::runtime_error("Unsupported aspect type");
385385
}

libsyclinterface/include/dpctl_sycl_enum_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ typedef enum
119119
usm_host_allocations,
120120
usm_shared_allocations,
121121
usm_restricted_shared_allocations,
122-
usm_system_allocator
122+
usm_system_allocations
123123
} DPCTLSyclAspectType;
124124

125125
/*!

libsyclinterface/source/dpctl_sycl_context_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
//===----------------------------------------------------------------------===//
2626

2727
#include "dpctl_sycl_context_interface.h"
28-
#include "../helper/include/dpctl_error_handlers.h"
2928
#include "Support/CBindingWrapping.h"
29+
#include "dpctl_error_handlers.h"
3030
#include <CL/sycl.hpp>
3131
#include <vector>
3232

@@ -194,7 +194,7 @@ DPCTLContext_GetBackend(__dpctl_keep const DPCTLSyclContextRef CtxRef)
194194
return DPCTL_HOST;
195195
case backend::opencl:
196196
return DPCTL_OPENCL;
197-
case backend::level_zero:
197+
case backend::ext_oneapi_level_zero:
198198
return DPCTL_LEVEL_ZERO;
199199
case backend::cuda:
200200
return DPCTL_CUDA;

libsyclinterface/source/dpctl_sycl_device_interface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
//===----------------------------------------------------------------------===//
2626

2727
#include "dpctl_sycl_device_interface.h"
28-
#include "../helper/include/dpctl_error_handlers.h"
29-
#include "../helper/include/dpctl_string_utils.hpp"
30-
#include "../helper/include/dpctl_utils_helper.h"
3128
#include "Support/CBindingWrapping.h"
29+
#include "dpctl_error_handlers.h"
30+
#include "dpctl_string_utils.hpp"
3231
#include "dpctl_sycl_device_manager.h"
32+
#include "dpctl_utils_helper.h"
3333
#include <CL/sycl.hpp> /* SYCL headers */
3434
#include <algorithm>
3535
#include <cstring>

0 commit comments

Comments
 (0)