Visible to Intel only — GUID: GUID-F5A3835F-F517-4F03-B9A3-5753960048CA
Visible to Intel only — GUID: GUID-F5A3835F-F517-4F03-B9A3-5753960048CA
DPCT1112
Message
If the filter mode is set to linear, the behavior of image “read” may be different from tex1Dfetch in the original code. You may need to adjust the code.
Detailed Help
The CUDA* tex1Dfetch function always applies the nearest filtering mode. In the migrated code, the image read function applies the filtering mode that is set for the texture object. There may be a different result on the image read, so you may need to align the filter mode on image read.
Suggestions to Fix
For example, this original CUDA code:
cudaTextureDesc desc;
desc.filterMode = cudaFilterModeLinear;
...
cudaTextureObject_t obj;
cudaCreateTextureObject(&obj, ..., &desc, ...);
...
tex1Dfetch(..., obj, ...);
results in the following migrated SYCL* code:
dpct::sampling_info desc;
desc.set(sycl::filtering_mode::linear);
...
dpct::image_wrapper_base_p obj;
obj = dpct::create_image_wrapper(..., desc);
...
/*
DPCT1112:0: If the filter mode is set to 'linear', the behavior of image
"read" may be different from "tex1Dfetch" in the original code. You may need
to adjust the code.
*/
obj.read(...);
which is rewritten to:
dpct::sampling_info desc;
desc.set(sycl::filtering_mode::nearest); // Update the filtering mode from linear to nearest
...
dpct::image_wrapper_base_p obj;
obj = dpct::create_image_wrapper(..., desc);
...