Visible to Intel only — GUID: GUID-418C0769-8B45-4CF4-9A22-C5F63335E479
Visible to Intel only — GUID: GUID-418C0769-8B45-4CF4-9A22-C5F63335E479
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);
...
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);
...