CUDA-MEMCHECK報告這種信息的發佈模式CUDA內核: ========= Error: process didn't terminate successfully
========= Invalid __global__ read of size 4
========= at 0x000002c8 in xx_kernel
========= by thread (0,0,0)
我想阻止一些塊,直到一個變量設置爲特定值。所以我編寫這段代碼來測試一個簡單的do-while循環是否可行。 __device__ int tag = 0;
__global__ void kernel() {
if (threadIdx.x == 0) {
volatile int v;
do {
v = tag;
}
wh