Visible to Intel only — GUID: GUID-6AB34D97-DA76-4C5D-B175-44BFE2A0379D
Visible to Intel only — GUID: GUID-6AB34D97-DA76-4C5D-B175-44BFE2A0379D
DPCT1104
Message
<expression text> should point to a dynamic library loaded in memory. The dynamic library should supply wrapped kernel functions.
Detailed Help
The CUDA* application expects <expression text> to point to a CUDA module whose file image has been copied to memory. The user should ensure that the CUDA code that generated the CUDA module is migrated to SYCL* code, compiled to generate a kernel library, and then copied to memory by the migrated SYCL application.
Suggestions to Fix
The user should find the module source files that are used to make the CUDA module and migrate the module source files 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 build 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 user should ensure that the application will load the kernel library image into memory at runtime. For the following example this can be ensured by setting <kernel library filename> to library.so.
For example, this original CUDA code:
void test() {
CUmodule module;
const void *image = loadFile("module.ptx");
cuModuleLoadData(&module, image);
}
results in the following migrated SYCL code:
void test() {
dpct::kernel_library module;
const void *image = loadFile("module.ptx");
/*
DPCT1104:0: 'image' should point to a dynamic library loaded in memory. The
dynamic library should supply wrapped kernel functions.
*/
module = dpct::load_kernel_library_mem(image);
}
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"
const void *image = loadFile("library.so");
module = dpct::load_kernel_library_mem(image);
}