Boolean Support in CUDA

Does CUDA support boolean keyword? How different is an integer/floating point operation from boolean in CUDA?

I want to store an array of boolean numbers e.g. A = [ 1 0 1 1 1 0 1 0 0 1 ] and operate on it.

Does CUDA support boolean keyword? How different is an integer/floating point operation from boolean in CUDA?

I want to store an array of boolean numbers e.g. A = [ 1 0 1 1 1 0 1 0 0 1 ] and operate on it.

I think most modern compilers (including nvcc) define bool with something equivalent to this:

typedef unsigned char bool;

Actually in respect to memory a bool array will be seen as unsigned char e.g. for storing “shared bool ff[10000];” You will need 10000 bytes (NOT bits). On the other hand any operation on bool (or in fact unsigned char) element will be preceded by its conversion to (unsigned)integer so You will save some memory space but You’ll need additional conversion operations at the same time.