[PATCH] D99488: [SYCL][Doc] Add address space handling section to SYCL documentation

Victor Lomuller via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 29 09:41:53 PDT 2021


Naghasan added inline comments.


================
Comment at: clang/docs/SYCLSupport.md:914-919
+Default address space represents "Generic-memory", which is a virtual address
+space which overlaps the global, local and private address spaces. SYCL mode
+enables conversion to/from default address space from/to address space
+attributed type.
+
+SPIR target allocates SYCL namespace scope variables in global address space.
----------------
aaron.ballman wrote:
> 
I think this section should be extended.

Pointers to `Default` address space should get lowered into a pointer to a generic address space (or flat to reuse more general terminology).
But depending on the allocation context, the `default` address space of a non-pointer type is assigned to a specific address space. This is described in https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:commonAddressSpace.

This is also in line with the behaviour of CUDA (small example https://godbolt.org/z/veqTfo9PK).


================
Comment at: clang/docs/SYCLSupport.md:818-819
+
+SYCL specification uses C++ classes to represent pointers to disjoint memory
+regions on an accelerator to enable compilation with standard C++ toolchain and
+SYCL compiler toolchain. Section 3.8.2 of SYCL 2020 specification defines
----------------
Or more simply just `SYCL specification uses C++ wrapper classes`.

`multi_ptr` are not "pointers to" but a wrapper around the actual pointer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99488/new/

https://reviews.llvm.org/D99488



More information about the cfe-commits mailing list