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..fb700377 --- /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.