Ok here goes
I am trying to write a message passing mechanism using CUDA .
I started out by writing a classic semaphore where i wanted to serialize the writing process of each thread to global memory.
global void Kernel(void)
//Assign a unique Id to each processing element
int PID=threadIdx.x + (blockIdx.x*blockDim.x);
device int Semaphore;
//Master Region accessible by only the master thread
Semaphore = -1; //Initialize semaphore
//Wait for entering into critical region
//Critical Region Here (only 1 thread enters here at a time )
//The next thread can now enter into the critical region
The launch configuration was :
#define BLOCKS 16
#define THREADS 100
DimGrid.x = BLOCKS;
DimBlock.x = THREADS;
//Launch the Grid
When i executed the code machine hanged up for precisely 4.2 seconds ( i was running a background timer). The control returned but with an exception fired.
“Microsoft C++ exception: cudaError_enum at memory location 0x0013fea4”
Guys what do you think, also there is no hardware support for TEST(var) instruction.
no control over the thread scheduler too, what do i do? the problem i am trying to solve requires critical section handling.
Obviously i am doing something wrong… :blink:
P.S : I am running this on a GTX version.
[EDIT] Problem solved will post the solution in a new thread :)