DPCT1019

メッセージ

SYCL* の local_mem_size は、CUDA* の <variable name> と完全に等価ではありません。コードを調整する必要があります。

詳細な説明

CUDA* では、sharedMemPerBlock はブロックごとに利用可能な共有メモリーのサイズをバイト単位で報告します。SYCL* のワークグループは、CUDA* のブロックに相当します。SYCL* のローカルメモリーは、共有メモリーに相当します。SYCL* では、work-group ごとのローカルメモリーのサイズに制限はありません。計算ユニットごとに利用可能なローカルメモリーの最大サイズ (バイト) には制限があり、SYCL* の info::device::local_mem_size デバイス記述子で取得できます。

修正方法の提案#

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

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


1void foo() { 
2 cudaDeviceProp prop; 
3 cudaGetDeviceProperties(&prop, 0); 
4 if (prop.sharedMemPerBlock >= threshold) { 
5 // submit the task 
6 Code piece A 
7 } else { 
8 // change the block size or block number 
9 Code piece B 
10 } 
11}

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


1void foo() { 
2 dpct::device_info prop; 
3 dpct::dev_mgr::instance().get_device(0).get_device_info(prop); 
4 /* 
5 DPCT1019:0: local_mem_size in SYCL is not a complete equivalent of 
6 sharedMemPerBlock in CUDA. You may need to adjust the code. 
7 */ 
8 if (prop.get_local_mem_size() >= threshold) { 
9 // submit the task 
10 Code piece A 
11 } else { 
12 // change the block size or block number 
13 Code piece B 
14 } 
15}

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


1void foo() { 
2 dpct::device_info prop; 
3 dpct::dev_mgr::instance().get_device(0).get_device_info(prop); 
4 if (prop.get_local_mem_size() >= threshold) { 
5 // submit the task 
6 Code piece A 
7 } else { 
8 // change the block size or block number 
9 Code piece B 
10 } 
11}