Visible to Intel only — GUID: GUID-84A314CE-AAF5-4316-A96F-E08C92821C5E
Visible to Intel only — GUID: GUID-84A314CE-AAF5-4316-A96F-E08C92821C5E
DPCT1062
Message
SYCL Image doesn’t support normalized read mode.
Detailed Help
This warning is emitted when cudaReadModeNormalizedFloat is used as the third argument of texture in the original code. Since SYCL* Image doesn’t support normalized read mode, cudaReadModeNormalizedFloat will be ignored during migration.
It may cause errors in the resulting code, for example, redefinition of overloaded functions, if the overloaded functions are differentiated based on the texture type in the original code.
For example, this original CUDA* code:
__device__ void foo(const texture<char4, 2, cudaReadModeNormalizedFloat> tex) {
float4 f = tex2D(tex, 0.5f, 0.5f);
}
__device__ void foo (const texture<char4, 2, cudaReadModeElementType> tex) {
char4 c = tex2D(tex, 0.5f, 0.5f);
}
results in the following migrated SYCL code:
/*
DPCT1062:0: SYCL Image doesn't support normalized read mode.
*/
void foo(dpct::image_accessor_ext<sycl::char4, 2> tex) {
sycl::float4 f = tex.read(0.5f, 0.5f);
}
void foo(dpct::image_accessor_ext<sycl::char4, 2> tex) {
sycl::char4 c = tex.read(0.5f, 0.5f);
}
which is rewritten to:
void foo1(dpct::image_accessor_ext<sycl::char4, 2> tex) {
sycl::char4 temp_c = tex.read(0.5f, 0.5f);
sycl::float4 f{temp_c.x(), temp_c.y(), temp_c.z(), temp_c.w()};
f = f / 255.f;
}
void foo2(dpct::image_accessor_ext<sycl::char4, 2> tex) {
sycl::char4 c = tex.read(0.5f, 0.5f);
}
Suggestions to Fix
Review the code and update as needed.