Skip to content
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

Add KHR for default context #624

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions adoc/extensions/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ working group.
These extensions may be promoted to core features in future versions of the SYCL
specification, but their design is subject to change.

(There are currently no extensions in this appendix.)

// leveloffset=2 allows extensions to be written as standalone documents
// include::sycl_khr_extension_name.adoc[leveloffset=2]

include::sycl_khr_default_context.adoc[leveloffset=2]
57 changes: 57 additions & 0 deletions adoc/extensions/sycl_khr_default_context.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[[sec:khr-default-context]]
= SYCL_KHR_DEFAULT_CONTEXT

When a [code]#queue# object is constructed without passing an explicit
[code]#context# object, the queue uses the platform's default context.
This extension adds a new query function to retrieve this default context from a
[code]#platform# object.

[[sec:khr-default-context-dependencies]]
== Dependencies

This extension has no dependencies on other extensions.

[[sec:khr-default-context-feature-test]]
== Feature test macro

An implementation supporting this extension must predefine the macro
[code]#SYCL_KHR_DEFAULT_CONTEXT# to one of the values defined in the table
below.

[%header,cols="1,5"]
|===
|Value
|Description

|1
|Initial version of this extension.
|===

[[sec:khr-default-context-platform]]
== Extensions to the platform class

This extension adds the following new member functions to the [code]#platform#
class.

[source,role=synopsis,id=api:khr-default-context-platform]
----
namespace sycl {
class platform {
context khr_get_default_context() const;
// ...
};
}
----

[[sec:khr-default-context-platform-member-funcs]]
=== Member functions

.[apidef]#platform::khr_get_default_context#
[source,role=synopsis,id=api:platform-khr-get-default-context]
----
context khr_get_default_context() const
----

_Returns:_ A copy of the default context object for this platform.
The default context contains all of the <<root-device, root devices>> that are
associated with this platform.