Skip to content

[CUDA] CTS atomic tests fail with unresolved extern function '_Z22__spirv_AtomicExchangePU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf' #5096

@yuxianch

Description

@yuxianch

Describe the bug
CTS atomic tests fail with unresolved extern function '_Z22__spirv_AtomicExchangePU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf' on Linux with CUDA backend

To Reproduce

  1. Get SYCL with CUDA support (GSG) and KhronosGroup/SYCL-CTS@b61c52a
  2. Build CTS tests
cd SYCL-CTS
mkdir build && cd build
cmake -G "Ninja" -DSYCL_IMPLEMENTATION=Intel_SYCL -DINTEL_SYCL_ROOT=<path to built sycl> -DOpenCL_LIBRARY=<path to built sycl>/lib/libOpenCL.so -DOpenCL_INCLUDE_DIR=<path to built sycl>/include/sycl -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-fsycl -fsycl-unnamed-lambda -Wno-deprecated-declarations" -DINTEL_SYCL_FLAGS="-fsycl-device-code-split=per_kernel" -DCMAKE_EXE_LINKER_FLAGS=" -Wl,-no-relax " -DINTEL_SYCL_TRIPLE=nvptx64-nvidia-cuda -DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=Off -DSYCL_CTS_ENABLE_DOUBLE_TESTS=On -DSYCL_CTS_ENABLE_HALF_TESTS=On ..
ninja test_atomic

Error message:

FAILED: bin/test_atomic
: && <path to built sycl>/bin/clang++ -DSYCL2020_DISABLE_DEPRECATION_WARNINGS -ffp-model=precise  -fsycl -fsycl-unnamed-lambda -Wno-deprecated-declarations      -Wl,-no-relax    -fsycl -sycl-std=2020 -fsycl-device-code-split=per_kernel -fsycl-targets=nvptx64-nvidia-cuda tests/atomic/CMakeFiles/test_atomic_objects.dir/atomic_api_32.cpp.o tests/common/CMakeFiles/main_function_object.dir/main.cpp.o -o bin/test_atomic  -Wl,-rpath,<path to built sycl>/lib util/libutil.a oclmath/liboclmath.a <path to built sycl>/lib/libOpenCL.so && :
ptxas fatal   : Unresolved extern function '_Z22__spirv_AtomicExchangePU3AS1fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf'
llvm-foreach:
ptxas fatal   : Unresolved extern function '_Z22__spirv_AtomicExchangePU3AS3fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf'
llvm-foreach:
clang++: error: ptxas command failed with exit code 255 (use -v to see invocation)
clang version 14.0.0 (https://github.com/intel/llvm.git e560dfe88ee69b3de4a5fe5472382defba19cee0)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: <path to built sycl>/bin
clang++: note: diagnostic msg: Error generating preprocessed source(s).
ninja: build stopped: cannot make progress due to previous errors.

The unresolved function is declared in ./include/CL/__spirv/spirv_ops.hpp.

$ c++filt _Z22__spirv_AtomicExchangePU3AS3fN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagEf
__spirv_AtomicExchange(float AS3*, __spv::Scope::Flag, __spv::MemorySemanticsMask::Flag, float)

Environment

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.29.05    Driver Version: 495.29.05    CUDA Version: 11.5     |
|-------------------------------+----------------------+----------------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    CTSImpacts Khronos SYCL CTSbugSomething isn't workingcompilerCompiler related issuecudaCUDA back-end

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions