Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anton-v-gorshkov opened this issue Jun 5, 2020 · 6 comments
Closed

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

anton-v-gorshkov opened this issue Jun 5, 2020 · 6 comments
Assignees
Labels
cuda CUDA back-end

Comments

@anton-v-gorshkov
Copy link
Contributor

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
@bader bader added the cuda CUDA back-end label Jun 5, 2020
@Ruyk
Copy link
Contributor

Ruyk commented Jun 15, 2020

Can you confirm the problem only occurs with constant memory? I have modified locally the test case to use non-constant memory but get the same error.

@Ruyk
Copy link
Contributor

Ruyk commented Jun 15, 2020

I think this could be related to #1841

@Ruyk
Copy link
Contributor

Ruyk commented Jun 15, 2020

It also seems the problem disappears when using -O2 instead of -O0

@anton-v-gorshkov
Copy link
Contributor Author

It also seems the problem disappears when using -O2 instead of -O0

True

@anton-v-gorshkov
Copy link
Contributor Author

Can you confirm the problem only occurs with constant memory? I have modified locally the test case to use non-constant memory but get the same error.

The issue was discovered for constant memory only - but if you could attach your version of reproducer, I can check it on my machine as well.

@bader
Copy link
Contributor

bader commented Oct 11, 2020

Can't reproduce this problem with the latest build.

SYCL_BE=PI_CUDA ./test

WARNING: The legacy environment variables SYCL_BE and SYCL_DEVICE_TYPE are deprecated. Please use SYCL_DEVICE_FILTER instead. For details, please refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md

Device: TITAN RTX
Expected Output: 123, 321
Real Output: 123, 321

It was (probably) addressed by #1841.

@bader bader closed this as completed Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda CUDA back-end
Projects
None yet
Development

No branches or pull requests

3 participants