Closed tom91136 closed 4 years ago
In Issue #8 it mentions that OpenCL doesn't use VLAs. You instead use local memory for those arrays in SYCL, but do you also use local memory in OpenCL for them? I had a quick look, and it doesn't look like it. IMO, we need to keep this consistent in both versions, so you'll need to use private memory for these arrays (lops
, transform
, etc) in SYCL too.
If I understand the situation correctly: CL compiles the kernel at runtime so setting dynamically sized private memory is straightforward. In SYCL's case, we can't compile anything at runtime so I think we have two options:
posesPerWI
at runtime; make it a compile time flagLet me know if this is correct and if so which option do we go with.
Downgrade the SYCL version to not allow setting the posesPerWI at runtime; make it a compile time flag
This is exactly what the OpenMP version does, so I'd suggest that this also reasonable for SYCL.
SYCL 2020 added support for specialization constants which should allow you to make the array size a runtime value again. Apparently the DPC++ 2021 beta supports this but I'm guessing other compilers you care about won't yet.
@andreipoe I think this is ready
Updated to track changes from the makedeck script
Your standard SYCL implementation ported from the OpenCL kernel. As we're dealing with SYCL, I've upgraded all sources to C++ so everything looks idiomatic. The only notable thing is the lack of VLA support in SYCL which the OpenCL version used(touched on in #8), this was emulated by replacing all VLAs with local memory with one extra dimension allocated to the local id.