UoB-HPC / miniBUDE

A BUDE virtual-screening benchmark, in many programming models
Apache License 2.0
24 stars 13 forks source link

SYCL implementation #9

Closed tom91136 closed 4 years ago

tom91136 commented 4 years ago

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.

tomdeakin commented 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.

tom91136 commented 4 years ago

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:

Let me know if this is correct and if so which option do we go with.

jrprice commented 4 years ago

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.

tom91136 commented 4 years ago

@andreipoe I think this is ready

tom91136 commented 4 years ago

Updated to track changes from the makedeck script