Visible to Intel only — GUID: GUID-7AA3728E-60AD-4B72-91DB-6665EB906312
Visible to Intel only — GUID: GUID-7AA3728E-60AD-4B72-91DB-6665EB906312
DPCT1074
Message
The SYCL Image class does not support some of the flags used in the original code. Unsupported flags were ignored. Data read from SYCL Image could not be normalized as specified in the original code.
Detailed Help
Data read from tex in original code is normalized to a float in the range of (0, 1] by default, unless CU_TRSF_READ_AS_INTEGER is set. While data read from SYCL* image cannot be normalized to a float in the range of (0, 1] using the standard SYCL API. All flags used in the original code are ignored, except coordinate normalization mode.
Suggestions to Fix
Adjust the code manually.
For example, this original CUDA* code:
// User does not set CU_TRSF_READ_AS_INTEGER here.
cuTexRefSetFlags(tex, CU_TRSF_NORMALIZED_COORDINATES);
cuTexRefSetFormat(tex, CU_AD_FORMAT_UNSIGNED_INT16, 1);
...
result = tex2D<float>(tex, 0.5f, 0.5f);
results in the following migrated SYCL code:
/*
DPCT1074:0: The SYCL Image class does not support some of the flags used in
the original code. Unsupported flags were ignored. Data read from SYCL Image
could not be normalized as specified in the original code.
*/
tex->set(sycl::coordinate_normalization_mode::normalized);
tex->set_channel_type(sycl::image_channel_type::unsigned_int16);
tex->set_channel_num(1);
...
result = tex.read(0.5f, 0.5f); // data normalization does not match original code
which is manually adjusted to:
tex->set(sycl::coordinate_normalization_mode::normalized);
tex->set_channel_type(sycl::image_channel_type::unsigned_int16);
tex->set_channel_num(1);
...
result = tex.read(0.5f, 0.5f) / float(std::numeric_limits<std::uint16_t>::max());