Skip to content

[Doc] Deprecate ext_oneapi_default_context #17135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
= SYCL(TM) Proposals: Platform Default Contexts
James Brodman <[email protected]>
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.

Original file line number Diff line number Diff line change
@@ -1,34 +1,2 @@
= SYCL(TM) Proposals: Platform Default Contexts
James Brodman <[email protected]>
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].
1 change: 1 addition & 0 deletions sycl/include/sycl/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase<platform> {
/// 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<device> ext_oneapi_get_composite_devices() const;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/AbiNeutral/device-info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void initGlobalDevicePoolState() {
}
gDevPool.contexts.resize(1);
gDevPool.contexts[0] = std::make_unique<sycl::context>(
gDevPool.devices[0]->get_platform().ext_oneapi_get_default_context());
gDevPool.devices[0]->get_platform().khr_get_default_context());
}

static void initDevicePoolCallOnce() {
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/multi_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading