Visible to Intel only — GUID: GUID-383468C9-FA90-4B11-B98D-6C4C8C0BC1A9
Visible to Intel only — GUID: GUID-383468C9-FA90-4B11-B98D-6C4C8C0BC1A9
DPCT1103
Message
<expression text> should be a dynamic library. The dynamic library should supply wrapped kernel functions.
Detailed Help
The CUDA* application expects <expression text> to be the name of a CUDA module. The user should ensure that the CUDA code that generated the CUDA module is migrated to SYCL* code and compiled to generate a kernel library.
Suggestions to Fix
The user should find the module source files that are used to make the CUDA module and migrate them to SYCL using the --extra-arg=-ptx option of Intel® DPC++ Compatibility Tool to generate wrapped kernel functions:
dpct <module source file(s)> --extra-arg=--ptx
The migrated module source file(s) should be compiled to make a kernel library.
On Linux*:
icpx -fsycl <migrated module source file(s)> -fPIC -shared -o <kernel library filename>
On Windows*:
icpx -fsycl <migrated module source file(s)> -shared -o <kernel library filename>
The <kernel library filename> should be chosen so that <expression text> will have the same filename at runtime. For the following example, <kernel library filename> should be set to library.so.
For example, this original CUDA code:
void test() {
CUmodule module;
std::string ptxFile("module.ptx");
cuModuleLoad(&module, ptxFile.c_str());
}
results in the following migrated SYCL code:
void test() {
dpct::kernel_library module;
std::string ptxFile("module.ptx");
/*
DPCT1103:0: 'ptxFile.c_str()' should be a dynamic library. The dynamic library
should supply wrapped kernel functions.
*/
module = dpct::load_kernel_library(ptxFile.c_str());
}
which is rewritten to:
void test() {
dpct::kernel_library module;
// "library.so" is compiled from the SYCL code which is migrated from CUDA code
// used to build "module.ptx"
std::string libraryFile("library.so");
module = dpct::load_kernel_library(libraryFile);
}