From 769406d1b5772d743b803a33a5874bef8f4f9000 Mon Sep 17 00:00:00 2001 From: Greg Lueck Date: Tue, 17 Sep 2024 18:05:35 -0400 Subject: [PATCH] Add KHR for default context --- adoc/extensions/index.adoc | 4 +- adoc/extensions/sycl_khr_default_context.adoc | 57 +++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 adoc/extensions/sycl_khr_default_context.adoc diff --git a/adoc/extensions/index.adoc b/adoc/extensions/index.adoc index 07062df6..1a13364a 100644 --- a/adoc/extensions/index.adoc +++ b/adoc/extensions/index.adoc @@ -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] diff --git a/adoc/extensions/sycl_khr_default_context.adoc b/adoc/extensions/sycl_khr_default_context.adoc new file mode 100644 index 00000000..671b776f --- /dev/null +++ b/adoc/extensions/sycl_khr_default_context.adoc @@ -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 <> that are +associated with this platform.