Open DongBaiYue opened 10 months ago
Can you reproduce this bug?
@npmiller @mdtoguchi @AerialMantis
This command clang++ -std=c++17 -O3 -fsycl -fsycl-targets=nvptx64-nvidia-cuda main.cpp -ldl
does not have any references to the generated shared objects, is that purposeful? The executable built from main.cpp
needs to have some kind of reference to the shared objects to or it won't know what to look for to resolve.
This command
clang++ -std=c++17 -O3 -fsycl -fsycl-targets=nvptx64-nvidia-cuda main.cpp -ldl
does not have any references to the generated shared objects, is that purposeful? The executable built frommain.cpp
needs to have some kind of reference to the shared objects to or it won't know what to look for to resolve.
dlfcn allows runtime dynamic library loading, no need to link at compile time。
dlopen()
dlsym()
For the above reproducer
//expected result
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
//actual result
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAterminate called after throwing an instance of 'sycl::_V1::exception'
what(): Native API failed. Native API returns: -46 (PI_ERROR_INVALID_KERNEL_NAME)
Aborted (core dumped)
The error occurs when funcB is executed after funcA is successfully executed.
Describe the bug 'PI_ERROR_INVALID_KERNEL_NAME' error when dynamic library with kernel is loaded by dlopen secondly on linux with CUDA backend.
To Reproduce Error message:
The small reproducer:
Environment (please complete the following information):
Additional context if DPC++ version is 2022-12,Error message is: