clGetDeviceInfo returning large integers sometimes

I have the following code to get the address bits and size for the global work group.

size_t size;
size_t address_bits;
clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, 0, NULL, &size);
clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, size, (void *)&address_bits, NULL);

Occasionally address_bits will set to some extremely large integer such as 139741055942720.000000, when it should be 64.

Any idea what is causing this?

[QUOTE=Jayfire0;42508]I have the following code to get the address bits and size for the global work group.

size_t size;
size_t address_bits;
clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, 0, NULL, &size);
clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, size, (void *)&address_bits, NULL);

Occasionally address_bits will set to some extremely large integer such as 139741055942720.000000, when it should be 64.

Any idea what is causing this?[/QUOTE]

Update: Figured it out. It had to do with the casting on address_bits. Address_bits had to be of type cl_uint for the getInfo calls. The before I called clEnqueueNDRangeKernel, I did:

size_t temp = address_bits;
and then called
ret = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, &temp, NULL, 0, NULL,NULL);

This completely fixed my issue. I tried just casting the address_bits in the clEnqueue call but that did not work for whatever reason.