DPCT1022

メッセージ

maxGridSizemax_nd_range のサイズが完全に一致していません。コードの正当性を検証してください。

詳細な説明

SYCL* には、maxGridSize に相当するものはありません。SYCL* の nd_ranges は、CUDA* のグリッドのように最大 3 次元に対応しており、nd_range の最大サイズはデータタイプの幅 (size_t) です。インテル® DPC++ 互換性ツールは、maxGridSizesize_t 幅に初期化される max_nd_range_size ヘルパーに置き換えます。

修正方法の提案

コードの正当性を検証してください。

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


1void foo() { 
2 cudaDeviceProp prop; 
3 cudaGetDeviceProperties(&prop, 0); 
4 if (prop.maxGridSize[0] >= TASK_SIZE) { 
5// submit the task on one kernel 
6   ...
7 } else { 
8// split the task into multi kernels 
9   ...
10 } 
11}

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


1void foo() { 
2 dpct::device_info prop; 
3 dpct::dev_mgr::instance().get_device(0).get_device_info(prop); 
4 /* 
5 DPCT1022:0: There is no exact match between the maxGridSize and the 
6 max_nd_range size.Verify the correctness of the code.
7 */ 
8 if (prop.get_max_nd_range_size()[0] >= TASK_SIZE) { 
9 // submit the task on one kernel 
10    ... 
11 } else { 
12 // split the task into multi kernels 
13    ... 
14 } 
15}

このコードは次のように書き換えられます。


1void foo() { 
2 // submit the task on one kernel 
3    ... 
4}