Skip to content

Commit 5b119c1

Browse files
authored
Merge pull request #2042 from IntelPython/resolve-cmplr-deprecation-warning
Use `khr_default_context()` per DPC++ 2025.2 compiler deprecation warning
2 parents e39b013 + f8c20ce commit 5b119c1

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

CHANGELOG.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
### Changed
1414

1515
* Support for Boolean data-type is added to `dpctl.tensor.ceil`, `dpctl.tensor.floor`, and `dpctl.tensor.trunc` [gh-2033](https://github.com/IntelPython/dpctl/pull/2033)
16+
* Changed implementation of `DPCTLPlatform_GetDefaultContext` from using deprecated `ext_oneapi_get_default_context` to `khr_get_default_context` [#2042](https://github.com/IntelPython/dpctl/pull/2042).
1617

1718
### Fixed
1819

@@ -223,7 +224,7 @@ The full list of changes that went into this release are:
223224
* Fix for crash during testing with open source SYCL bundle by updating CPU RT library used [gh-1762](https://github.com/IntelPython/dpctl/pull/1762)
224225
* Add missing include to fix build break with newer LLVM [gh-1776](https://github.com/IntelPython/dpctl/pull/1776)
225226
* Add `#include <utility>` for definition of `std::move` used [gh-1787](https://github.com/IntelPython/dpctl/pull/1787)
226-
* Change to CMake script to accomodate DPC++ transition from PI to UR architecture [gh-1788](https://github.com/IntelPython/dpctl/pull/1788)
227+
* Change to CMake script to accommodate DPC++ transition from PI to UR architecture [gh-1788](https://github.com/IntelPython/dpctl/pull/1788)
227228
* Document `tensor._flags.Flags` class [gh-1794](https://github.com/IntelPython/dpctl/pull/1794)
228229
* Fix for unreferenced unreleased bug in copy-and-cast code logic [gh-1799](https://github.com/IntelPython/dpctl/pull/1799)
229230
* Explicitly include headers used in C++ translation units implementing reduction operations [gh-1802](https://github.com/IntelPython/dpctl/pull/1802)
@@ -378,7 +379,7 @@ This release reaches milestone of 100% compliance of `dpctl.tensor` functions wi
378379
* Added bitwise elementwise functions `dpctl.tensor.bitwise_and`, `dpctl.tensor.bitwise_xor`, `dpctl.tensor.bitwise_or`, `dpctl.tensor.bitwise_invert`
379380
* Added bitwise shift functions `dpctl.tensor.bitwise_left_shift` and `dpctl.tensor.bitwise_right_shift`.
380381
* Added `dpctl.tensor.atan2` and `dpctl.tensor.signbit` elementwise functions.
381-
* Added `dpctl.tensor.minumum` and `dpctl.tensor.maximum` binary elementwise functions.
382+
* Added `dpctl.tensor.minimum` and `dpctl.tensor.maximum` binary elementwise functions.
382383
* Supported equality checking and hashing for `dpctl.SyclPlatform`.
383384
* Implemented `types` property for all unary and binary elementwise functions [#1361](https://github.com/IntelPython/dpctl/pull/1361)
384385
* Added `dpctl.tensor.repeat` and `dpctl.tensor.tile` functions.
@@ -523,7 +524,7 @@ This release reaches milestone of 100% compliance of `dpctl.tensor` functions wi
523524
* Updated supported version of DLPack to 0.8 [#1073](https://github.com/IntelPython/dpctl/pull/1073)
524525
* Implemented queue cache per context/device pair and deployed it in `dpctl.memory`, `dpctl.tensor.from_dlpack` and `dpctl.tensor` array creation functions [#1076](https://github.com/IntelPython/dpctl/pull/1076), [#1079](https://github.com/IntelPython/dpctl/pull/1079)
525526

526-
* Maintainance, CI work: [#1001](https://github.com/IntelPython/dpctl/pull/1001), [#1009](https://github.com/IntelPython/dpctl/pull/1009), [#1011](https://github.com/IntelPython/dpctl/pull/1011), [#1024](https://github.com/IntelPython/dpctl/pull/1024), [#1030](https://github.com/IntelPython/dpctl/pull/1030), [#1032](https://github.com/IntelPython/dpctl/pull/1032), [#1035](https://github.com/IntelPython/dpctl/pull/1035), [#1037](https://github.com/IntelPython/dpctl/pull/1037), [#1039](https://github.com/IntelPython/dpctl/pull/1039), [#1041](https://github.com/IntelPython/dpctl/pull/1041), [#1045](https://github.com/IntelPython/dpctl/pull/1045), [#1047](https://github.com/IntelPython/dpctl/pull/1047), [#1055](https://github.com/IntelPython/dpctl/pull/1055), [#1057](https://github.com/IntelPython/dpctl/pull/1057), [#1059](https://github.com/IntelPython/dpctl/pull/1059), [#1068](https://github.com/IntelPython/dpctl/pull/1068), [#1070](https://github.com/IntelPython/dpctl/pull/1070), [#1074](https://github.com/IntelPython/dpctl/pull/1074), [#1077](https://github.com/IntelPython/dpctl/pull/1077), [#1078](https://github.com/IntelPython/dpctl/pull/1078), [#1081](https://github.com/IntelPython/dpctl/pull/1081), [#1084](https://github.com/IntelPython/dpctl/pull/1084), [#1085](https://github.com/IntelPython/dpctl/pull/1085), [#1088](https://github.com/IntelPython/dpctl/pull/1088), [#1086](https://github.com/IntelPython/dpctl/pull/1086), [#1092](https://github.com/IntelPython/dpctl/pull/1092), [#1093](https://github.com/IntelPython/dpctl/pull/1093)
527+
* Maintenance, CI work: [#1001](https://github.com/IntelPython/dpctl/pull/1001), [#1009](https://github.com/IntelPython/dpctl/pull/1009), [#1011](https://github.com/IntelPython/dpctl/pull/1011), [#1024](https://github.com/IntelPython/dpctl/pull/1024), [#1030](https://github.com/IntelPython/dpctl/pull/1030), [#1032](https://github.com/IntelPython/dpctl/pull/1032), [#1035](https://github.com/IntelPython/dpctl/pull/1035), [#1037](https://github.com/IntelPython/dpctl/pull/1037), [#1039](https://github.com/IntelPython/dpctl/pull/1039), [#1041](https://github.com/IntelPython/dpctl/pull/1041), [#1045](https://github.com/IntelPython/dpctl/pull/1045), [#1047](https://github.com/IntelPython/dpctl/pull/1047), [#1055](https://github.com/IntelPython/dpctl/pull/1055), [#1057](https://github.com/IntelPython/dpctl/pull/1057), [#1059](https://github.com/IntelPython/dpctl/pull/1059), [#1068](https://github.com/IntelPython/dpctl/pull/1068), [#1070](https://github.com/IntelPython/dpctl/pull/1070), [#1074](https://github.com/IntelPython/dpctl/pull/1074), [#1077](https://github.com/IntelPython/dpctl/pull/1077), [#1078](https://github.com/IntelPython/dpctl/pull/1078), [#1081](https://github.com/IntelPython/dpctl/pull/1081), [#1084](https://github.com/IntelPython/dpctl/pull/1084), [#1085](https://github.com/IntelPython/dpctl/pull/1085), [#1088](https://github.com/IntelPython/dpctl/pull/1088), [#1086](https://github.com/IntelPython/dpctl/pull/1086), [#1092](https://github.com/IntelPython/dpctl/pull/1092), [#1093](https://github.com/IntelPython/dpctl/pull/1093)
527528

528529

529530
### Fixed
@@ -585,7 +586,7 @@ This release reaches milestone of 100% compliance of `dpctl.tensor` functions wi
585586

586587
### Added
587588

588-
* Implemented and deployed dedicated kernels for copying with casting [#781](https://github.com/IntelPython/dpctl/781), used in `__setitem__`, implementaion of `asarray`, `dpctl.tensor.copy` functions.
589+
* Implemented and deployed dedicated kernels for copying with casting [#781](https://github.com/IntelPython/dpctl/781), used in `__setitem__`, implementation of `asarray`, `dpctl.tensor.copy` functions.
589590
* Implemented dedicated copying kernel for `dpctl.tensor.reshape` function [#810](https://github.com/IntelPython/dpctl/810), added support for `copy` keyword [#807](https://github.com/IntelPython/dpctl/807).
590591
* Implemented dedicated kernel to copy with casting from `numpy.ndarray` into `dpctl.tensor.usm_ndarray` [#817](https://github.com/IntelPython/dpctl/pull/817).
591592

@@ -696,7 +697,7 @@ This release reaches milestone of 100% compliance of `dpctl.tensor` functions wi
696697
- Add a new C API utility function (`DPCTLDeviceMgr_GetDeviceInfoStr`) to return the device info as a C string object [#620](https://github.com/IntelPython/dpctl/pull/620)
697698
- New Github workflow to build dpclt with nightly Intel llvm/sycl + drivers [#621](https://github.com/IntelPython/dpctl/pull/621)
698699
- Always raise SubDeviceCreationError even when sub-device counts are zero [#622](https://github.com/IntelPython/dpctl/pull/622)
699-
- Updated OpenCL interoprability code to fix build with Intel llvm/sycl bundle [#625](https://github.com/IntelPython/dpctl/pull/625)
700+
- Updated OpenCL interoperability code to fix build with Intel llvm/sycl bundle [#625](https://github.com/IntelPython/dpctl/pull/625)
700701
- Enabled use of default platform context extension in SYCL compilers that implement this extension [#627](https://github.com/IntelPython/dpctl/pull/627)
701702
- Implemented `dpctl.utils.get_execution_queue(queue_seq)` utility to help implementing "compute-follows data" convention for offload target [#632](https://github.com/IntelPython/dpctl/pull/632)
702703
[#631](https://github.com/IntelPython/dpctl/pull/631)
@@ -987,7 +988,7 @@ supports USM.
987988
## [0.4.0] - 2020-11-04
988989
### Added
989990
- Device descriptors "max_compute_units", "max_work_item_dimensions", "max_work_item_sizes", "max_work_group_size", "max_num_sub_groups" and "aspects" for int64 atomics inside dpctl C API and inside the dpctl.SyclDevice class.
990-
- MemoryUSM* classes moved to `dpctl.memory` module, added support for aligned allocation, added support for `prefetch` and `mem_advise` (sychronous) methods, implemented `copy_to_host`, `copy_from_host` and `copy_from_device` methods, pickling support, and zero-copy interoperability with Python objects which implement `__sycl_usm_array_inerface__` protocol.
991+
- MemoryUSM* classes moved to `dpctl.memory` module, added support for aligned allocation, added support for `prefetch` and `mem_advise` (synchronous) methods, implemented `copy_to_host`, `copy_from_host` and `copy_from_device` methods, pickling support, and zero-copy interoperability with Python objects which implement `__sycl_usm_array_inerface__` protocol.
991992
- Helper scripts to generate API documentation for both C API and Python.
992993

993994
### Fixed
@@ -1072,7 +1073,7 @@ supports USM.
10721073
### Changed
10731074
- Refactored API to expose a minimal sycl::queue interface.
10741075
- Modify cpu_queues, gpu_queues and active_queues to functions.
1075-
- Change static vectors to static pointers to verctors. It disables call for destructors. Destructors are also call in undefined order.
1076+
- Change static vectors to static pointers to vectors. It disables call for destructors. Destructors are also call in undefined order.
10761077
- Rename package PyDPPL to dpCtl.
10771078
- Use dpcpp.exe on Windows instead of dpcpp-cl.exe deleted in oneAPI beta08.
10781079

docs/doc_sources/user_guides/dlpack.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ When sharing USM allocation (of any ``sycl::usm::kind``) with ``void * ptr`` bou
4646
// Keep in mind, the device may be a sub-device
4747
const sycl::device &ptr_dev = sycl::get_pointer_device(ptr, ctx);
4848
49-
#if SYCL_EXT_ONEAPI_DEFAULT_CONTEXT
50-
const sycl::context &default_ctx = ptr_dev.get_platform().ext_oneapi_get_default_context();
49+
#if SYCL_KHR_DEFAULT_CONTEXT
50+
const sycl::context &default_ctx = ptr_dev.get_platform().khr_get_default_context();
5151
#else
5252
static_assert(false, "ext_oneapi_default_context extension is required");
5353
#endif
@@ -106,8 +106,8 @@ Importing DLPack with ``device_type == kDLOneAPI``
106106
// );
107107
108108
// Get default platform context
109-
#if SYCL_EXT_ONEAPI_DEFAULT_CONTEXT
110-
const sycl::context &default_ctx = root_device.get_platform().ext_oneapi_get_default_context();
109+
#if SYCL_KHR_DEFAULT_CONTEXT
110+
const sycl::context &default_ctx = root_device.get_platform().khr_get_default_context();
111111
#else
112112
static_assert(false, "ext_oneapi_default_context extension is required");
113113
#endif

libsyclinterface/source/dpctl_sycl_platform_interface.cpp

+10-3
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,24 @@ DPCTLPlatform_GetDefaultContext(__dpctl_keep const DPCTLSyclPlatformRef PRef)
227227
{
228228
auto P = unwrap<platform>(PRef);
229229
if (P) {
230-
#ifdef SYCL_EXT_ONEAPI_DEFAULT_CONTEXT
230+
#if defined(SYCL_KHR_DEFAULT_CONTEXT) || \
231+
defined(SYCL_EXT_ONEAPI_DEFAULT_CONTEXT)
231232
try {
232-
const auto &default_ctx = P->ext_oneapi_get_default_context();
233+
const auto &default_ctx = P->
234+
#ifdef SYCL_KHR_DEFAULT_CONTEXT
235+
khr_get_default_context()
236+
#else
237+
ext_oneapi_get_default_context()
238+
#endif // SYCL_KHR_DEFAULT_CONTEXT
239+
;
233240
return wrap<context>(new context(default_ctx));
234241
} catch (const std::exception &ex) {
235242
error_handler(ex, __FILE__, __func__, __LINE__);
236243
return nullptr;
237244
}
238245
#else
239246
return nullptr;
240-
#endif
247+
#endif // SYCL_KHR_DEFAULT_CONTEXT || SYCL_EXT_ONEAPI_DEFAULT_CONTEXT
241248
}
242249
else {
243250
error_handler(

0 commit comments

Comments
 (0)