diff --git a/adoc/chapters/architecture.adoc b/adoc/chapters/architecture.adoc index ff3e8d3a..ec19cfd5 100644 --- a/adoc/chapters/architecture.adoc +++ b/adoc/chapters/architecture.adoc @@ -1389,7 +1389,7 @@ implementation-defined. [[sec:coordination]] -=== Coordination and Synchronization +=== Coordination and synchronization Coordination between the host and any devices can be expressed in the host SYCL application using calls into the SYCL runtime. @@ -1403,7 +1403,7 @@ Such functions can be used to ensure that the host and any devices do not access data concurrently, and/or to reason about the ordering of operations across the host and any devices. -==== Host-Device Coordination +==== Host-device coordination The following operations can be used to coordinate host and device(s): @@ -1456,7 +1456,7 @@ So it is up to the programmer to use a member function to wait for completion in some cases if this does not fit the goal. See <> for more information on object life time. -==== Work-item Coordination +==== Work-item coordination A <> provides a mechanism to coordinate all work-items in the same group. diff --git a/adoc/chapters/device_compiler.adoc b/adoc/chapters/device_compiler.adoc index 5b89c137..d75680ff 100644 --- a/adoc/chapters/device_compiler.adoc +++ b/adoc/chapters/device_compiler.adoc @@ -205,6 +205,16 @@ Amongst other things, this restriction makes it illegal for a implementation defines the [code]#SYCL_EXTERNAL# macro as described in <>. +Inside a <> or in the case of a +<>, any code accepted by the C++ standard in this +case is also accepted in a SYCL <>. + +[NOTE] +==== +The restriction waiver in <> or +<> allows any kind of meta-programming in a +<>. +==== [[subsec:scalartypes]] == Built-in scalar data types @@ -377,8 +387,17 @@ in <> must be defined by all conformant implementations. A number of kernel features defined by this SYCL specification are optional; they may be supported on some devices but not on other devices. + +As stated in <>, the restrictions for +optional kernel features do not apply to discarded statements or to manifestly +constant-evaluated expressions or conversions in device code. +Device code may use optional features in <> or +<> even if the device does not support the +optional feature. + As described in <>, an application can test whether a device -supports these features by testing whether the device has an associated aspect. +supports an optional feature by testing whether the device has an associated +aspect. The following aspects are those that correspond to optional kernel features: * [code]#fp16# diff --git a/adoc/chapters/glossary.adoc b/adoc/chapters/glossary.adoc index 379bacdc..2fb43ce9 100644 --- a/adoc/chapters/glossary.adoc +++ b/adoc/chapters/glossary.adoc @@ -188,6 +188,12 @@ For the full description please refer to <>. One of the device with the highest non-negative value is selected. See <> for more details. +[[discarded-statement]]discarded statement:: + ISO C++ +[stmt.if]+ describes a discarded statement as the branch statement + of an [code]#if constexpr# which is not instantiated because of the boolean + condition. + For more context, see <>. + [[event]]event:: A SYCL object that represents the status of an operation that is being executed by the SYCL runtime. @@ -339,6 +345,14 @@ For the full description please refer to <>. Local memory is a memory region associated with a <> and accessible only by <> in that <>. +[[manifestly-constant-evaluated]]manifestly constant-evaluated expression or conversion:: + ISO C++ +[expr.const]+ describes manifestly constant-evaluated expression or + conversion like constant expressions, condition of an +if constexpr+, an + immediate invocation, used in template parameters, in constant + initialization, etc. + This is evaluated at compile-time by the compiler. + For more context, see <>. + [[mem-fence]]mem-fence:: A memory fence provides control over re-ordering of memory load and store operations when coupled with an atomic operation. @@ -353,7 +367,6 @@ For the full description please refer to <>. A <> in a device image whose value can be used by an online compiler as an immediate value during the compilation. - [[nd-item]]nd-item:: A unique identifier representing a single <> and <> within the index space of a SYCL kernel execution. diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 2332823d..5f2b2f9c 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -9933,7 +9933,6 @@ For interoperability with the <>, users should rely on types exposed by the decorated version. If the value of [code]#access::decorated# is [code]#access::decorated::legacy#, the 1.2.1 interface is exposed. -This interface is deprecated. The template traits [code]#remove_decoration# and type alias [code]#remove_decoration_t# retrieve the non-decorated pointer or reference from @@ -10136,7 +10135,7 @@ operator=(const multi_ptr&) ---- a@ Available only when: [code]#(Space == access::address_space::generic_space && AS != access::address_space::constant_space)#. -Assigns the value of the left hand side [code]#multi_ptr# into the [code]#generic_ptr#. +Assigns the value of the right hand side [code]#multi_ptr# into the [code]#generic_ptr#. a@ [source] @@ -10149,7 +10148,7 @@ operator=(multi_ptr&&) a@ Available only when: [code]#(Space == access::address_space::generic_space && AS != access::address_space::constant_space)#. -Move the value of the left hand side [code]#multi_ptr# into the [code]#generic_ptr#. +Move the value of the right hand side [code]#multi_ptr# into the [code]#generic_ptr#. a@ [source] @@ -10642,10 +10641,6 @@ below. include::{header_dir}/pointer.h[lines=4..-1] ---- -Note that using [code]#global_ptr#, [code]#local_ptr#, [code]#constant_ptr# or -[code]#private_ptr# without specifying the decoration is deprecated. -The default argument is provided for compatibility with 1.2.1. - [[subsec:samplers]] === Image samplers @@ -13892,9 +13887,10 @@ property::reduction::initialize_to_identity identity value passed to the reduction interface, or to the identity value determined by the [code]#known_identity# trait if no identity value was specified. If no identity value was specified and an identity value - cannot be determined by the [code]#known_identity# trait, the compiler - must raise a diagnostic. When this property is set, the original value of - the reduction variable is not included in the reduction. + cannot be determined by the [code]#known_identity# trait, the + implementation must throw an [code]#exception# with the + [code]#errc::invalid# error code. When this property is set, the original + value of the reduction variable is not included in the reduction. |==== diff --git a/adoc/chapters/what_changed.adoc b/adoc/chapters/what_changed.adoc index f4322252..8449b3ab 100644 --- a/adoc/chapters/what_changed.adoc +++ b/adoc/chapters/what_changed.adoc @@ -385,7 +385,6 @@ Changes in [code]#multi_ptr# interface: Returned pointer and reference are not annotated by an address space; ** interface exposing decorated types. Returned pointer and reference are annotated by an address space; - ** legacy 1.2.1 interface (deprecated). * deprecation of the 1.2.1 interface; * deprecation of [code]#constant_ptr#; * [code]#global_ptr#, [code]#local_ptr# and [code]#private_ptr# alias take the @@ -468,4 +467,8 @@ parameters did not clearly specify which accessor's size determines the amount of memory that is copied. The spec now clarifies that the [code]#src# accessor's size is used. +Any code considered as a <> or as a +<> by the C++ standard is now also accepted in +SYCL device function. + // %%%%%%%%%%%%%%%%%%%%%%%%%%%% end what_changed %%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/adoc/config/rouge/lib/rouge/lexers/sycl.rb b/adoc/config/rouge/lib/rouge/lexers/sycl.rb index 657d1f24..d8e3ca6c 100644 --- a/adoc/config/rouge/lib/rouge/lexers/sycl.rb +++ b/adoc/config/rouge/lib/rouge/lexers/sycl.rb @@ -312,6 +312,7 @@ class Sycl < Cpp context_bound cpu_selector decorated_constant_ptr + decorated_generic_ptr decorated_global_ptr decorated_local_ptr decorated_private_ptr diff --git a/adoc/extensions/index.adoc b/adoc/extensions/index.adoc index 3058c1ea..188e33a1 100644 --- a/adoc/extensions/index.adoc +++ b/adoc/extensions/index.adoc @@ -7,10 +7,9 @@ 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] include::sycl_khr_static_addrspace_cast.adoc[leveloffset=2] include::sycl_khr_dynamic_addrspace_cast.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. diff --git a/adoc/headers/multipointer.h b/adoc/headers/multipointer.h index c9e727b8..32cb6aac 100644 --- a/adoc/headers/multipointer.h +++ b/adoc/headers/multipointer.h @@ -15,7 +15,7 @@ enum class address_space : /* unspecified */ { enum class decorated : /* unspecified */ { no, yes, - legacy // Deprecated in SYCL 2020 + legacy }; } // namespace access diff --git a/adoc/headers/multipointerlegacy.h b/adoc/headers/multipointerlegacy.h index f413cad0..0d510730 100644 --- a/adoc/headers/multipointerlegacy.h +++ b/adoc/headers/multipointerlegacy.h @@ -4,7 +4,6 @@ namespace sycl { // Legacy interface, inherited from 1.2.1. -// Deprecated. template class [[deprecated]] multi_ptr { public: @@ -162,7 +161,6 @@ class [[deprecated]] multi_ptr { }; // Legacy interface, inherited from 1.2.1. -// Deprecated. // Specialization of multi_ptr for void and const void // VoidType can be either void or const void template diff --git a/adoc/headers/pointer.h b/adoc/headers/pointer.h index 98905914..7c472332 100644 --- a/adoc/headers/pointer.h +++ b/adoc/headers/pointer.h @@ -30,6 +30,11 @@ template ; +template +using generic_ptr = + multi_ptr; + // Template specialization aliases for different pointer address spaces. // The interface exposes non-decorated pointer while keeping the // address space information internally. @@ -48,6 +53,11 @@ using raw_private_ptr = multi_ptr; +template +using raw_generic_ptr = + multi_ptr; + // Template specialization aliases for different pointer address spaces. // The interface exposes decorated pointer. @@ -66,4 +76,9 @@ using decorated_private_ptr = multi_ptr; +template +using decorated_generic_ptr = + multi_ptr; + } // namespace sycl diff --git a/adoc/scripts/reflow.py b/adoc/scripts/reflow.py index f5bf81b1..0869562c 100755 --- a/adoc/scripts/reflow.py +++ b/adoc/scripts/reflow.py @@ -53,7 +53,7 @@ # A single letter followed by a period, typically a middle initial. endInitial = re.compile(r'^[A-Z]\.$') # An abbreviation, which does not (usually) end a line. -endAbbrev = re.compile(r'(e\.g|i\.e|c\.f|\bvs\b|\bco\b|\bltd\b|\bch\b)\.$', re.IGNORECASE) +endAbbrev = re.compile(r'(e\.g|i\.e|\bvs\b|\bco\b|\bltd\b|\bch\b|\bcf\b)\.$', re.IGNORECASE) # A lower case word. When "etc." is followed by this, it does not end a line. startsLowerCase = re.compile(r'\(?[a-z]')