PDA

View Full Version : clGetDeviceInfo



phil_ps
07-30-2009, 02:54 PM
Hi,

I am implementing an OpenCL library through support from google summer of code and I have a question.

What is the difference between CL_DEVICE_MEM_BASE_ADDR_ALIGN and CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE in clGetDeviceInfo?

Thanks
Phil

dbs2
07-31-2009, 11:16 AM
From the spec:

CL_DEVICE_MEM_BASE_ADDR_ALIGN
cl_uint
Describes the alignment in bits of the base address of any allocated memory object.

CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE
cl_uint
The smallest alignment in bytes which can be used for any data type.

For many implementations these will be the same, but some implementations may need to have different allocations for heap/stack-based data. (E.g., char[2] may be able to be aligned to a single byte, whereas a global char* may need to be aligned to 128 bytes.)