diff --git a/sycl/doc/extensions/deprecated/sycl_ext_oneapi_default_context.asciidoc b/sycl/doc/extensions/deprecated/sycl_ext_oneapi_default_context.asciidoc new file mode 100644 index 0000000000000..494034bb1bb28 --- /dev/null +++ b/sycl/doc/extensions/deprecated/sycl_ext_oneapi_default_context.asciidoc @@ -0,0 +1,44 @@ += SYCL(TM) Proposals: Platform Default Contexts +James Brodman +v0.1 +:source-highlighter: pygments +:icons: font +:y: icon:check[role="green"] +:n: icon:times[role="red"] +:dpcpp: pass:[DPC++] + +== Platform Default Contexts + +== Status + +This extension has been deprecated. Although it is still supported in {dpcpp}, +we expect that the interfaces defined in this specification will be removed in +an upcoming {dpcpp} release. *Shipping software products should stop using +APIs defined in this specification and use an alternative instead.* + +== Overview + +This extension adds the notion of a default SYCL context per SYCL platform. The default context for each platform contains all devices in the platform. + +The platform class gains one new method: + +[cols="^60a,40"] +|=== +| Member Function | Description + +| +[source,c++] +---- +context ext_oneapi_get_default_context() +---- + +| Returns the current default context for this `platform` + +|=== + +This extension also modifies the behavior of `queue` constructors. Queues will no longer create a new `context` upon construction. Instead, they will use the default context from the device's platform. + +== Feature Test Macro + +This extension defines the macro `SYCL_EXT_ONEAPI_DEFAULT_CONTEXT` to `1` to indicate that it is enabled. + diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_default_context.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_default_context.asciidoc index 6b9e764f1b446..9245f599d572b 100644 --- a/sycl/doc/extensions/supported/sycl_ext_oneapi_default_context.asciidoc +++ b/sycl/doc/extensions/supported/sycl_ext_oneapi_default_context.asciidoc @@ -1,34 +1,2 @@ -= SYCL(TM) Proposals: Platform Default Contexts -James Brodman -v0.1 -:source-highlighter: pygments -:icons: font -:y: icon:check[role="green"] -:n: icon:times[role="red"] - -== Platform Default Contexts - -This extension adds the notion of a default SYCL context per SYCL platform. The default context for each platform contains all devices in the platform. - -The platform class gains one new method: - -[cols="^60a,40"] -|=== -| Member Function | Description - -| -[source,c++] ----- -context ext_oneapi_get_default_context() ----- - -| Returns the current default context for this `platform` - -|=== - -This extension also modifies the behavior of `queue` constructors. Queues will no longer create a new `context` upon construction. Instead, they will use the default context from the device's platform. - -== Feature Test Macro - -This extension defines the macro `SYCL_EXT_ONEAPI_DEFAULT_CONTEXT` to `1` to indicate that it is enabled. - +This extension has been deprecated, but the specification is still available +link:../deprecated/sycl_ext_oneapi_default_context.asciidoc[here]. diff --git a/sycl/include/sycl/platform.hpp b/sycl/include/sycl/platform.hpp index 21605d6c56370..4ec5b1f697e64 100644 --- a/sycl/include/sycl/platform.hpp +++ b/sycl/include/sycl/platform.hpp @@ -204,6 +204,7 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase { /// Return this platform's default context /// /// \return the default context + __SYCL_DEPRECATED("use khr_get_default_context() instead") context ext_oneapi_get_default_context() const; std::vector ext_oneapi_get_composite_devices() const; diff --git a/sycl/test-e2e/AbiNeutral/device-info.cpp b/sycl/test-e2e/AbiNeutral/device-info.cpp index f5affc9690bfe..b2575ee029eda 100644 --- a/sycl/test-e2e/AbiNeutral/device-info.cpp +++ b/sycl/test-e2e/AbiNeutral/device-info.cpp @@ -67,7 +67,7 @@ static void initGlobalDevicePoolState() { } gDevPool.contexts.resize(1); gDevPool.contexts[0] = std::make_unique( - gDevPool.devices[0]->get_platform().ext_oneapi_get_default_context()); + gDevPool.devices[0]->get_platform().khr_get_default_context()); } static void initDevicePoolCallOnce() { diff --git a/sycl/test-e2e/KernelCompiler/multi_device.cpp b/sycl/test-e2e/KernelCompiler/multi_device.cpp index 94d1d3ac1508c..f00abaee8724b 100644 --- a/sycl/test-e2e/KernelCompiler/multi_device.cpp +++ b/sycl/test-e2e/KernelCompiler/multi_device.cpp @@ -23,7 +23,7 @@ __kernel void Kernel2(short in, __global short *out) { int main() { sycl::platform Platform; - auto Context = Platform.ext_oneapi_get_default_context(); + auto Context = Platform.khr_get_default_context(); { auto devices = Context.get_devices();