ReSharper 2026.3 Help

コードインスペクション: メモリ空間のローカル変数は 'extern' または静的である必要があります

インスペクションは、CUDA メモリ空間指定子 __device__、 __constant__、 __managed__ 、または __tile__ のいずれかで宣言された自動ローカル変数を報告します。 これらの指定子を持つローカル変数は、 extern または static である必要があります。

サンプル

__device__ void process() { __device__ int cache; }
__device__ void process() { static __device__ int cache; }

デバイスコードでブロック内のすべてのスレッドによって共有されるローカル変数が必要な場合は、 __shared__ を使用してください。

2026 年 11 月 6 日