Skip to content

[SYCL][CUDA] Incorrect work with constant memory #1819

@anton-v-gorshkov

Description

@anton-v-gorshkov

main.cpp.txt

After migration of Rodinia-Heartwall benchmark from CUDA to DPC++ it was found that Codeplay DPC++ compiler may work with constant memory incorrectly - constant data passed to the kernel may be invalid.

Small reproducer is in attachment.

How to reproduce:

$ source /opt/intel/inteloneapi/dpcpp-ct/latest/env/vars.sh
$ clang++ -O0 -g -std=c++11 -fsycl -fsycl-unnamed-lambda -fsycl-targets=nvptx64-nvidia-cuda-sycldevice main.cpp -o test -Xsycl-target-backend=nvptx64-nvidia-cuda-sycldevice --cuda-gpu-arch=sm_75 -lsycl -lOpenCL
$ export SYCL_BE=PI_CUDA
$ ./test
Device: GeForce RTX 2070
Expected Output: 123, 321
Real Output: 123, 1 # INVALID

I've used the latest compiler from June 04.

For Intel Graphics it works fine:

$ clang++ -O0 -g -std=c++11 -fsycl -fsycl-unnamed-lambda main.cpp -o test -lsycl -lOpenCL
$ unset SYCL_BE
$ ./test
Device: Intel(R) Gen9 HD Graphics NEO
Expected Output: 123, 321
Real Output: 123, 321 # VALID

Metadata

Metadata

Assignees

Labels

cudaCUDA back-end

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions