when I run my executable cuda file in cuda-gdb, I get error:
CUDA Exception: Warp Illegal Address
The exception was
triggered at PC 0x1015608
Program received signal CUDA_EXCEPTION_14, Warp Illegal Address.
[Switching focus to CUDA kernel 0, grid 206, block (13,0,0), thread (90,0,0), device 0, sm 0, warp 2, lane 26]
0x0000000001015630 in searchline(float4*, float4*, float4*, int*, float*)<<<(25,1,1),(1024,1,1)>>> ()
(cuda-gdb) quit
Here is my kernel code:
__device__ int snum[2];
__global__ void searchline(float4 *data1,float4 *data2,float4* data3,int *num,float *odata)
{
int index=threadIdx.x+blockDim.x*blockIdx.x;
float temp=0;
float4 temp1;
if(index<25600)
{
temp=odata[index];
temp1=data1[index];
if(temp>50&&temp<300)
{
data2[snum[0]]=temp1;
atomicAdd(&snum[0],1);
__syncthreads();
}
else if(temp>500)
{
data2[snum[1]]=temp1;
atomicAdd(&snum[1],1);
__syncthreads();
}
}
__syncthreads();
if(threadIdx.x==0)
{
snum[0]=ssnum[0];
snum[1]=ssnum[1];
}
}
How can I solve this error? Thanks!