int idx = blockIdx.x * blockDim.x + threadIdx.x;
shared[idx] = input[idx];
will give you an error and should look like this:
int idx = blockIdx.x * blockDim.x + threadIdx.x;
int tid = threadIdx.x;
shared[tid] = input[idx];
Solutions to technical problems that I come across. Keywords: The Web, Ubuntu, Windows, JavaScript, jQuery, AngularJS, PHP, Java, C++, mySQL, noSQL, and more.
int idx = blockIdx.x * blockDim.x + threadIdx.x;
shared[idx] = input[idx];
int idx = blockIdx.x * blockDim.x + threadIdx.x;
int tid = threadIdx.x;
shared[tid] = input[idx];
i am having the same error and using tid is not helping as well ... what else can be the problem??
ReplyDeleteThanks a lot! When I had this problem, it was "segmentation fault" too.
ReplyDeleteThanks a lot your post saved me a lot of time sir.
ReplyDelete