DPCT1084

メッセージ

<function name> 関数呼び出しには、統一できなかった異なるテンプレート・インスタンスの複数の移行結果があります。コードを調整する必要があります。

説明

インテル® DPC++ 互換性ツールは、コードを正しく移行できませんでした。コードを手動で変更してください。

以下の例では、オリジナルコード、移行したコード、移行したコードを修正するために行った手動の変更を示します。

例えば、以下のオリジナル CUDA* コードについて考えてみます。


1 __constant__ int4 example_i[32]; 
2 __constant__ float4 example_f[32]; 
3 
4 struct example_int { 
5    __device__ int4 foo(int idx) const { 
6       return example_i[idx]; 
7    } 
8 }; 
9 
10 struct example_float { 
11    __device__ float4 foo(int idx) const { 
12       return example_f[idx]; 
13    } 
14 }; 
15 
16 template <typename T> 
17    _global_ void example_kernel() { 
18       ...19 T example_v; 
20    float j = example_v.foo(idx).x; 
21 }

このコードは、以下の SYCL* コードに移行されます。


1 dpct::constant_memory<sycl::int4, 1> example_i(32); 
2 dpct::constant_memory<sycl::float4, 1> example_f(32); 
3 
4 struct example_int { 
5    sycl::int4 foo()(int idx, sycl::int4 *example_i) const { 
6       return example_i[idx]; 
7    } 
8 }; 
9 
10 struct example_float { 
11    sycl::float4 foo()(int idx, sycl::float4 *example_i) const { 
12       return example_i[idx]; 
13    } 
14 }; 
15 
16 template <typename T> 
17 void example_kernel(sycl::nd_item<3> item_ct1, sycl::float4 *example_f) { 
18    ... 
19    T example_v; 
20    /* DPCT1083 */ 
21    float j = example_v.foo(idx, example_f).x(); 
22 }

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


1 dpct::constant_memory<sycl::int4, 1> example_i(32); 
2 dpct::constant_memory<sycl::float4, 1> example_f(32); 
3 
4 struct example_int { 
5    typedef sycl::int4 data_type; 
6    sycl::int4 foo()(int idx, sycl::int4 *example_i) const { 
7       return example_i[idx]; 
8    } 
9 }; 
10 
11 struct example_float { 
12    typedef sycl::float4 data_type; 
13    sycl::float4 foo()(int idx, sycl::float4 *example_i) const { 
14       return example_i[idx]; 
15    } 
16 }; 
17 
18 template <typename T> 
19 void example_kernel(sycl::nd_item<3> item_ct1, typename T::data_type *example_f) { 
20       ... 
21    T example_v; 
22    /* DPCT1083 */ 
23    float j = example_v.foo(idx, example_f).x(); 
24 }

修正方法の提案

コードを手動で調整する必要があります。