clGetDeviceInfo

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

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.)