如何使用clGetDeviceInfo获取CL_DEVICE_ADDRESS_BITS?

时间:2016-09-09 19:21:53

标签: c++ opencl gpgpu

如何使用clGetDeviceInfo获取CL_DEVICE_ADDRESS_BITS? https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetDeviceInfo.html

1 个答案:

答案 0 :(得分:1)

以下功能应该可以做到这一点。

void print_address_device_bits(cl_device_id *mydevice)
{
    size_t size;
    cl_uint address_bits;
    clGetDeviceInfo(*mydevice, CL_DEVICE_ADDRESS_BITS, 0, NULL, &size);
    clGetDeviceInfo(*mydevice, CL_DEVICE_ADDRESS_BITS, size, &address_bits, NULL);
    printf("size: %lu ,, bits: %u\n", size, address_bits);
}

有任何问题或意见吗?