Skip to content

Commit b2b0a3a

Browse files
authored
[Doc] Deprecate ext_oneapi_default_context (#17135)
Deprecate this in favor of khr_default_context
1 parent d5c01ed commit b2b0a3a

File tree

5 files changed

+49
-36
lines changed

5 files changed

+49
-36
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
= SYCL(TM) Proposals: Platform Default Contexts
2+
James Brodman <james[email protected]>
3+
v0.1
4+
:source-highlighter: pygments
5+
:icons: font
6+
:y: icon:check[role="green"]
7+
:n: icon:times[role="red"]
8+
:dpcpp: pass:[DPC++]
9+
10+
== Platform Default Contexts
11+
12+
== Status
13+
14+
This extension has been deprecated. Although it is still supported in {dpcpp},
15+
we expect that the interfaces defined in this specification will be removed in
16+
an upcoming {dpcpp} release. *Shipping software products should stop using
17+
APIs defined in this specification and use an alternative instead.*
18+
19+
== Overview
20+
21+
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.
22+
23+
The platform class gains one new method:
24+
25+
[cols="^60a,40"]
26+
|===
27+
| Member Function | Description
28+
29+
|
30+
[source,c++]
31+
----
32+
context ext_oneapi_get_default_context()
33+
----
34+
35+
| Returns the current default context for this `platform`
36+
37+
|===
38+
39+
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.
40+
41+
== Feature Test Macro
42+
43+
This extension defines the macro `SYCL_EXT_ONEAPI_DEFAULT_CONTEXT` to `1` to indicate that it is enabled.
44+
Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,2 @@
1-
= SYCL(TM) Proposals: Platform Default Contexts
2-
James Brodman <james[email protected]>
3-
v0.1
4-
:source-highlighter: pygments
5-
:icons: font
6-
:y: icon:check[role="green"]
7-
:n: icon:times[role="red"]
8-
9-
== Platform Default Contexts
10-
11-
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.
12-
13-
The platform class gains one new method:
14-
15-
[cols="^60a,40"]
16-
|===
17-
| Member Function | Description
18-
19-
|
20-
[source,c++]
21-
----
22-
context ext_oneapi_get_default_context()
23-
----
24-
25-
| Returns the current default context for this `platform`
26-
27-
|===
28-
29-
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.
30-
31-
== Feature Test Macro
32-
33-
This extension defines the macro `SYCL_EXT_ONEAPI_DEFAULT_CONTEXT` to `1` to indicate that it is enabled.
34-
1+
This extension has been deprecated, but the specification is still available
2+
link:../deprecated/sycl_ext_oneapi_default_context.asciidoc[here].

sycl/include/sycl/platform.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase<platform> {
204204
/// Return this platform's default context
205205
///
206206
/// \return the default context
207+
__SYCL_DEPRECATED("use khr_get_default_context() instead")
207208
context ext_oneapi_get_default_context() const;
208209

209210
std::vector<device> ext_oneapi_get_composite_devices() const;

sycl/test-e2e/AbiNeutral/device-info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void initGlobalDevicePoolState() {
6767
}
6868
gDevPool.contexts.resize(1);
6969
gDevPool.contexts[0] = std::make_unique<sycl::context>(
70-
gDevPool.devices[0]->get_platform().ext_oneapi_get_default_context());
70+
gDevPool.devices[0]->get_platform().khr_get_default_context());
7171
}
7272

7373
static void initDevicePoolCallOnce() {

sycl/test-e2e/KernelCompiler/multi_device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ __kernel void Kernel2(short in, __global short *out) {
2323

2424
int main() {
2525
sycl::platform Platform;
26-
auto Context = Platform.ext_oneapi_get_default_context();
26+
auto Context = Platform.khr_get_default_context();
2727

2828
{
2929
auto devices = Context.get_devices();

0 commit comments

Comments
 (0)