SYCLomatic
SYCLomatic copied to clipboard
Mistranslation of CUDA constant memory
Is your feature request related to a problem? Please describe
Syclomatic translates memory marked with __constant__
in CUDA as just a standard marked read only SYCL buffer/accessor. This means that the memory is allocated in global memory instead of constant memory, which means that it doesn't benefit from the constant cache.
Describe the solution you would like
For syclomatic to translate memory marked with __constant__
into SYCL Specialization constants or some other means to access cuda constant memory cache instead of read only accessors.
Describe alternatives you have considered N/A
Additional context This can be seen in Intel's oneAPI-samples where one of the SYCL migration examples uses constant memory .
@tomatih
- In SYCL side, there is no constant memory, "Constant memory no longer appears in the SYCL device memory model in SYCL 2020." in https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html
- SYCL Specialization constants is a compiler constant, will be literal when compiling kernel. For example, in a loop block each time we call a kernel, before call, the constant variable value can be changed. while for SYCL Specialization constants, each time the value change will result in kernel function re-compiled.
cc @AerialMantis
The issue was raised a while ago:
https://github.com/intel/llvm/issues/5827
@jinz2014 There is no further action needed in SYCLomatic, so I close this issue.