Skip to content

Commit e612cb0

Browse files
Updated deprecated declarations with their replacements
The only outstanding deprecation is use of `sycl::program`, but addressing that would take more work to fix. Since `sycl::aspect::usm_system_allocator` was deprecated in favor of `sycl::aspect::usm_system_allocations` in line with other aspects, the DPCTL enum was renamed accordingly. Tests were changed. This change is user visible.
1 parent 56ba791 commit e612cb0

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
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/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.code();
42+
auto err_code = e.code().value();
4343
handler_(static_cast<int>(err_code));
4444
}
4545
}

libsyclinterface/tests/test_sycl_device_aspects.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ auto build_params()
9999
cl::sycl::aspect::usm_shared_allocations),
100100
std::make_pair("usm_restricted_shared_allocations",
101101
cl::sycl::aspect::usm_restricted_shared_allocations),
102-
std::make_pair("usm_system_allocator",
103-
cl::sycl::aspect::usm_system_allocator));
102+
std::make_pair("usm_system_allocations",
103+
cl::sycl::aspect::usm_system_allocations));
104104

105105
auto pairs =
106106
build_param_pairs<const char *,
@@ -141,7 +141,7 @@ struct TestDPCTLSyclDeviceInterfaceAspects
141141
auto syclAspect = GetParam().second.second;
142142
try {
143143
hasAspect = D->has(syclAspect);
144-
} catch (cl::sycl::runtime_error const &re) {
144+
} catch (sycl::exception const &e) {
145145
}
146146
}
147147

libsyclinterface/tests/test_sycl_device_subdevices.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkCreateSubDevicesByAffinityNotApplicable)
149149
EXPECT_TRUE(DPCTLDeviceVector_Size(DVRef) == expected_size);
150150
EXPECT_NO_FATAL_FAILURE(DPCTLDeviceVector_Delete(DVRef));
151151
}
152-
} catch (runtime_error const &re) {
152+
} catch (exception const &e) {
153153
}
154154
}
155155
}

0 commit comments

Comments
 (0)