DPCT1059

メッセージ

SYCL* は、4 チャネルのイメージ形式のみをサポートしています。コードを調整します。

説明

SYCL* は、4 チャネルのイメージ形式のみをサポートしています。この警告は、ツールがオリジナルコードに対応するサポートされていないイメージ形式のコードを生成すると出力されます。移行したコードでイメージ形式を変更できます。この回避策は、コードのパフォーマンスに影響を与える可能性があります。

例えば、以下の移行した DPC++ コードについて考えてみます。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// migrated DPC++ code, which is using unsupported image format:

dpct::image_wrapper<cl::sycl::uint2, 2> tex; // 2-channel image is not supported

void test_image(dpct::image_accessor_ext<cl::sycl::uint2, 2> acc) {
  cl::sycl::uint2 tex_data;
  tex_data = acc.read(0, 0);
}
int main() {
  ... dpct::get_default_queue().submit([&](cl::sycl::handler &cgh) {
    ... auto acc = tex.get_access(cgh);
    auto smpl = tex.get_sampler();
    ... cgh.single_task<class dpct_single_kernel>([=] {
      test_image(dpct::image_accessor_ext<cl::sycl::uint2, 2>(smpl, acc));
    });
  });
  ...
}

このコードを以下のように手動で調整します。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// manually adjusted code:

dpct::image_wrapper<cl::sycl::uint4, 2> tex;

void test_image(dpct::image_accessor_ext<cl::sycl::uint4, 2> acc) {
  cl::sycl::uint4 tex_data;
  tex_data = acc.read(0, 0);
}
int main() {
  ... dpct::get_default_queue().submit([&](cl::sycl::handler &cgh) {
    ... auto acc = tex.get_access(cgh);
    auto smpl = tex.get_sampler();
    ... cgh.single_task<class dpct_single_kernel>([=] {
      test_image(dpct::image_accessor_ext<cl::sycl::uint4, 2>(smpl, acc));
    });
  });
  ...
}

修正方法の提案

このコードを書き換える必要があります。