Global value

Hi Guys,

How I can using global value?

example:

int a = 0;

thread
{
a++;
}

It not working :(

Hi.

A value global to what? To all threads in a block, to all running threads, to the host and the device ?

Global for All threads.

If you want the same variable to be accessible to all threads of a given threadblock, declare it with the shared modifier.

Paulius

Thanks