Visible to Intel only — GUID: GUID-9DD23DB8-D747-47BC-B10A-D0C61229E307
Visible to Intel only — GUID: GUID-9DD23DB8-D747-47BC-B10A-D0C61229E307
DPCT1019
Message
local_mem_size in SYCL is not a complete equivalent of <variable name> in CUDA. You may need to adjust the code.
Detailed Help
In CUDA*, the sharedMemPerBlock reports the size of the shared memory in bytes available per block. The SYCL* equivalent of a CUDA block is a work-group. The SYCL equivalent of shared memory is local memory. There is no limitation on the size of the local memory per work-group in SYCL. There is a limit on the maximum size of the local memory in bytes available per compute unit, which is exposed by the info::device::local_mem_size device descriptor in SYCL.
Suggestions to Fix
Verify the code correctness.
For example, this original CUDA code:
void foo() {
cudaDeviceProp prop;
cudaGetDeviceProperties(&prop, 0);
if (prop.sharedMemPerBlock >= threshold) {
// submit the task
Code piece A
} else {
// change the block size or block number
Code piece B
}
}
results in the following migrated SYCL code:
void foo() {
dpct::device_info prop;
dpct::dev_mgr::instance().get_device(0).get_device_info(prop);
/*
DPCT1019:0: local_mem_size in SYCL is not a complete equivalent of
sharedMemPerBlock in CUDA. You may need to adjust the code.
*/
if (prop.get_local_mem_size() >= threshold) {
// submit the task
Code piece A
} else {
// change the block size or block number
Code piece B
}
}
which is rewritten to:
void foo() {
dpct::device_info prop;
dpct::dev_mgr::instance().get_device(0).get_device_info(prop);
if (prop.get_local_mem_size() >= threshold) {
// submit the task
Code piece A
} else {
// change the block size or block number
Code piece B
}
}