Visible to Intel only — GUID: GUID-AE7335B1-5AF6-4E13-8D33-730008D5066B
Visible to Intel only — GUID: GUID-AE7335B1-5AF6-4E13-8D33-730008D5066B
DPCT1060
Message
SYCL range can only be a 1D, 2D, or 3D vector. Adjust the code.
Detailed Help
This warning is emitted when the number of dimensions of memory in the original code exceeds 3. Since SYCL* range supports only 1, 2 or 3 dimensions, the resulting code is not SYCL-compliant.
To fix the resulting code you can use the low-dimensional arrays to simulate high-dimensional arrays.
The following fix example demonstrates how to use a 3D array to simulate a 4D array.
For example, this original CUDA* code:
__constant__ int const_array[dimX][dimY][dimZ][dimW];
__global__ void kernel(int x, int y, int z, int w) {
int a = const_array[x][y][z][w];
}
results in the following migrated SYCL code:
/*
DPCT1060:0: SYCL range can only be a 1D, 2D, or 3D vector. Adjust the code.
*/
static dpct::constant_memory<int, 4> const_array(dimX, dimY, dimZ, dimW);
void kernel(int x, int y, int z, int w,
sycl::accessor<int, 4, sycl::access_mode::read, sycl::access::target::device> const_array) {
int a = const_array[x][y][z][w];
}
which is rewritten to:
static dpct::constant_memory<int, 3> const_array(dimX, dimY, dimZ * dimW);
void kernel(int x, int y, int z, int w,
sycl::accessor<int, 3, sycl::access_mode::read, sycl::access::target::device> const_array) {
int a = const_array[x][y][w * dimZ + z];
}
Suggestions to Fix
You may need to rewrite this code.