Skip to content

SYCL-CTS test_vector_swizzles doesn't compile for NVPTX target. #6505

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

Closed
bader opened this issue Aug 1, 2022 · 11 comments · Fixed by #7220
Closed

SYCL-CTS test_vector_swizzles doesn't compile for NVPTX target. #6505

bader opened this issue Aug 1, 2022 · 11 comments · Fixed by #7220
Labels
bug Something isn't working CTS Impacts Khronos SYCL CTS cuda CUDA back-end

Comments

@bader
Copy link
Contributor

bader commented Aug 1, 2022

Describe the bug
I'm building SYCL-CTS using DPC++ with NVPTX target support and building of the test_vector_swizzles fails with following error:

ptxas fatal   : Unresolved extern function '_Z18__spirv_AtomicIAddPyN5__spv5Scope4FlagENS0_19MemorySemanticsMask4FlagEy'

NOTE: Might be related to #5647 and #5215.

To Reproduce
Please describe the steps to reproduce the behavior:

git clone --recurse-submodules https://github.com/KhronosGroup/SYCL-CTS.git
cd SYCL-CTS
cmake -S . -B build -DSYCL_IMPLEMENTATION=DPCPP -DSYCL_CTS_EXCLUDE_TEST_CATEGORIES=ci/dpcpp.filter -DSYCL_CTS_ENABLE_DOUBLE_TESTS=OFF -DSYCL_CTS_ENABLE_HALF_TESTS=OFF -DSYCL_CTS_ENABLE_DEPRECATED_FEATURES_TESTS=OFF -DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=OFF -DDPCPP_INSTALL_DIR=<compiler-install-dir> -DDPCPP_TARGET_TRIPLES=nvptx64-nvidia-cuda
cmake --build ./build

Environment (please complete the following information):

  • OS: Linux
  • Target device and vendor: GeForce RTX 2060 0.0 [CUDA 11.0]
  • DPC++ version:
    clang version 15.0.0 (https://github.com/intel/llvm.git ab05021)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /iusers/aabader/llvm/build/bin
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
    Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Candidate multilib: x32;@MX32
    Selected multilib: .;@m64
    Found CUDA installation: /usr/local/cuda, version 11.0
@bader bader added bug Something isn't working cuda CUDA back-end CTS Impacts Khronos SYCL CTS labels Aug 1, 2022
@bader
Copy link
Contributor Author

bader commented Aug 1, 2022

I see that this issue also impacts test_optional_kernel_features.

@bader
Copy link
Contributor Author

bader commented Aug 15, 2022

The test passes on the same machine with DPC++ built from bfc7e98.

test_optional_kernel_features still fails.

@bader
Copy link
Contributor Author

bader commented Aug 15, 2022

@AerialMantis, if you won't be able to reproduce this problem with the recent DPC++, please, close the ticket.

@bader
Copy link
Contributor Author

bader commented Aug 15, 2022

That's very strange as I haven't updated CUDA version, so my theory is that patches from llvm.org and spir-v translator remove uses of atomic add instructions.

@AerialMantis
Copy link
Contributor

Thanks @bader, that's interesting, @jchlanda has just picked up this task, so he will be looking into it, if we're not able to reproduce it, we'll consider it resolved as you suggest.

@jchlanda
Copy link
Contributor

I've just checked with the top of llvm/sycl f963 and top of CTS da7b and the swizzle tests build just fine.

@bader
Copy link
Contributor Author

bader commented Sep 18, 2022

@jchlanda, are you able to build test_optional_kernel_features?

@jchlanda
Copy link
Contributor

Huh, so test_optional_kernel_features fails with the same missing symbol, I'll re-open the ticket.

ptxas fatal   : Unresolved extern function '_Z18__spirv_AtomicIAddPyN5__spv5Scope4FlagENS0_19MemorySemanticsMask4FlagEy'

@jchlanda
Copy link
Contributor

This will be fixed when #7220 gets merged.

@bader
Copy link
Contributor Author

bader commented Nov 15, 2022

This will be fixed when #7220 gets merged.

@jchlanda, please, link this pull request to close the issue when PR is merged.

pvchupin pushed a commit that referenced this issue Dec 6, 2022
Retire the by hand mangling of substituted function in favor of
constructing corresponding `FunctionDecls` and letting clang mangle it
for us. This ensures that we never diverge from clang's mangling
idiosyncrasies and bugfixes would likely be in the AST creation, not
mangling itself.

The tool has been rewritten as a `ClangTool` implementing
`FrontendAction`.

Additionally, we provide the option to perform a test run, in which no
substitutions are made, while checking that remangled name does not
diverge from the original mangled name. The tests are added to
`check-libclc` target.

The diffs are a bit ugly, it might be easier to inspect the file mode,
basically the change lives entirely in `Remangler` class, and if you
follow `Remangler::remangle` it will lead you through what it does.

Fixes: #6505

Co-authored-by: Aaron Ballman <[email protected]>
Co-authored-by: premanandrao <[email protected]>
Co-authored-by: Steffen Larsen <[email protected]>
@pvchupin pvchupin reopened this Dec 7, 2022
@jchlanda
Copy link
Contributor

#7220 was fixed in #7723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CTS Impacts Khronos SYCL CTS cuda CUDA back-end
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants