================
@@ -873,6 +873,107 @@ expression.
}];
}
+def SYCLAddressSpaceDocs : Documentation {
+ let Category = DocCatType;
+ let Heading = "SYCL Address Spaces";
+ let Content = [{
+.. note::
+
+ These attributes are intended for use in the implementation of SYCL run-time
+ libraries and should not be used in any other context.
+ Programmers writing code intended to conform to the SYCL specification
should
+ use the address space facilities specified in the following sections of the
+ SYCL 2020 specification.
+
+ * `4.7.2, "Buffers" <SYCL-2020-4.7.2_>`_
+ * `4.7.6, "Accessors" <SYCL-2020-4.7.6_>`_.
+ * `4.7.7, "Address space classes" <SYCL-2020-4.7.7_>`_.
+ * `F.7, "sycl_khr_static_addrspace_cast" <SYCL-2020-F.7_>`_.
+ * `F.8, "sycl_khr_dynamic_addrspace_cast" <SYCL-2020-F.8_>`_.
+
+The SYCL address space attributes listed below correspond to the five address
+spaces described by
+`SYCL 2020 section 3.8.2, "SYCL device memory model" <SYCL-2020-3.8.2_>`_ and
+`SYCL 2020 section 4.7.7, "Address space classes" <SYCL-2020-4.7.7_>`_.
+
+.. list-table::
+ :header-rows: 1
+
+ * - Address space attribute
+ - SYCL address space
+ - Description
+ * - ``[[clang::sycl_global]]``
+ - global
+ - A memory region accessible by all work-items executing on a device.
+ * - ``[[clang::sycl_local]]``
+ - local
+ - A memory region accessible by all work-items of a single work-group.
+ * - ``[[clang::sycl_private]]``
+ - private
+ - A memory region that is private to a single work-item.
+ * - ``[[clang::sycl_generic]]``
+ - generic
+ - A virtual memory region from which the global, local, and private memory
+ regions may all be accessed.
+ * - ``[[clang::sycl_constant]]``
+ - constant
+ - (*deprecated*) A memory region that holds constant data for an executing
+ kernel.
+
+The SYCL address space attributes are type attributes that may be applied to
+the object type of an object pointer or object reference type.
+A type specifier with a SYCL address space specifies a distinct type from the
+otherwise unattributed type.
+For example, ``int *`` and ``int [[clang::sycl_global]]*`` designate distinct
+pointer types which participate in overload resolution and template
+specialization.
+
+Conversions between SYCL address space attributed types are permitted as
+follows.
+
+* Types attributed with the global, local, or private address space attributes
+ are implicitly convertible to matching types with the generic address space
+ attribute.
+* Types attributed with the generic address space attribute may be converted
----------------
elizabethandrews wrote:
This PR description also implies address space cast should be used for casting
between openCL address spaces - https://reviews.llvm.org/D60193
_"Note that functionality of casting pointers to different address spaces has
been previously removed from all other cast operators and can only be currently
done using C style casts."_
https://github.com/llvm/llvm-project/pull/200849
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits