DPCT1059#
Message#
SYCL only supports 4-channel image format. Adjust the code.
Detailed Help#
SYCL* supports only 4-channel image format. The warning is emitted, when the tool generates code with unsupported image format, which corresponds to the original code. You can fix the resulting code by changing the image format. Note: suggested workaround may impact code performance.
For example, the following migrated SYCL code:
1 // migrated SYCL code, which is using unsupported image format:
2
3 dpct::image_wrapper<cl::sycl::uint2, 2> tex; // 2-channel image is not supported
4
5 void test_image(dpct::image_accessor_ext<cl::sycl::uint2, 2> acc) {
6 cl::sycl::uint2 tex_data;
7 tex_data = acc.read(0, 0);
8 }
9 int main() {
10 ... dpct::get_default_queue().submit([&](cl::sycl::handler &cgh) {
11 ... auto acc = tex.get_access(cgh);
12 auto smpl = tex.get_sampler();
13 ... cgh.single_task<class dpct_single_kernel>([=] {
14 test_image(dpct::image_accessor_ext<cl::sycl::uint2, 2>(smpl, acc));
15 });
16 });
17 ...
18 }
is manually adjusted to:
1 dpct::image_wrapper<cl::sycl::uint4, 2> tex;
2
3 void test_image(dpct::image_accessor_ext<cl::sycl::uint4, 2> acc) {
4 cl::sycl::uint4 tex_data;
5 tex_data = acc.read(0, 0);
6 }
7 int main() {
8 ... dpct::get_default_queue().submit([&](cl::sycl::handler &cgh) {
9 ... auto acc = tex.get_access(cgh);
10 auto smpl = tex.get_sampler();
11 ... cgh.single_task<class dpct_single_kernel>([=] {
12 test_image(dpct::image_accessor_ext<cl::sycl::uint4, 2>(smpl, acc));
13 });
14 });
15 ...
16 }
Suggestions to Fix#
You may need to rewrite this code.