Intel® Inspector Help
Occurs when a null or an invalid pointer is passed to a kernel via buffer or queue.
ID |
Code Location |
Description |
---|---|---|
1 |
Allocation site |
Represents a source location of a pointer with no registered allocation operations or a deleted pointer. |
cl::sycl::buffer<InputT, 1> inputBuf(inputPtr, size); queue.submit([&](cl::sycl::handler &cgh) { auto inputAcc = inputBuf.template get_access<cl::sycl::access::mode::read>(cgh); cgh.parallel_for<class my_task>(cl::sycl::range<1> { size }, [=](cl::sycl::id<1> idx) { outputPtr[0] += some_function(inputAcc[idx]); } }
A kernel argument is invalid if it contains:
DPC++ Example
int* inputPtr; // Memory not allocated
DPC++ Example
Int* inputPtr = new int[N]; for(int i=0; i<N; i++) inputPtr[I] = …; delete[] inputPtr; cl::sycl::buffer<InputT, 1> inputBuf(inputPtr, size);
DPC++ Example
int* inputPtr = nullptr; cl::sycl::buffer<InputT, 1> inputBuf(inputPtr, size);
DPC++ Example
int* inputPtr = new int[N]; cl::sycl::buffer<InputT, 1> inputBuf(inputPtr, size); // The array is not filled in with values
Depending on the type of invalid kernel argument, use the following correction hints: