我有一些使用共享内存的代码:
__global__ void PDH_kernel(/*arguments*/) {
extern __shared__ atom currentBlocks[];
int thisThread = blockDim.x * blockIdx.x + threadIdx.x;
double dist;
int histogramBin;
int next;
if (thisThread < PDH_acnt) {
currentBlocks[threadIdx.x] = aList[thisThread];
for (int i = blockIdx.x + 1; i < gridDim.x; i++) {
next = thisThread + (i * blockDim.x);
currentBlocks[threadIdx.x + blockDim.x] = aList[next];
__syncthreads();
当我使用“下一代” CUDA调试程序(在“扩展”>“ Nsight”>“启动CUDA调试(下一代)”)在Visual Studio(社区,2019年,版本16.1.1)中对其进行调试时,我m无法看到上面的数组currentBlocks
的内容;调试器将显示数组的地址,然后显示{ ??? }
。我正在使用Debug x64配置来编译程序。
其他可能相关的信息:
是否需要附加其他标志才能正确查看此数组?