如何使用clGetDeviceInfo来获取CL_DEVICE_ADDRESS_BITS
How do you use clGetDeviceInfo to get CL_DEVICE_ADDRESS_BITS?
如何使用clGetDeviceInfo来获取CL_DEVICE_ADDRESS_BITS?https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetDeviceInfo.html
下面的函数应该可以完成这个任务。
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: %un", size, address_bits);
}
有问题或意见吗?
相关文章:
- 赛通"Cannot take address of memoryview slice"
- C++:寻找"returning address of local variable..."的更正
- 为什么打印 c 样式字符串的'address of index n'会导致子字符串的输出
- 隐式转换产生"error: taking address of temporary"(GCC 与 clang)
- 将 aws-iot-device-sdk-cpp-v2 与 CMake 结合使用
- -fsanitize=Address with clang++ 与 g++ 的不同输出
- 向量数组"Cannot access memory at address"
- 加载安全区图像"A device attached to the system is not functioning"
- CMake + CUDA "invalid device function"即使使用正确的 SM 版本
- MEX 文件可以使用 -fsanitize=address 运行吗?
- 为什么我的重载 + 运算符在返回时会产生"Invalid address specified to RtlValidateHeap"错误?
- 如何修复警告"the compiler can assume that the address of 'object' will never be NULL"
- 在无效地址上,boost::asio::ip:::address::from_string 没有引发异常
- Address To Const Char *?
- "Member function must be called or its address taken in function" C++错误
- 当"taking address of temporary"错误妨碍干净的代码时
- 如何获取向量的每个第 N 个元素的"address"
- C++ API 中的张量流加载模型并得到"from device: CUDA_ERROR_OUT_OF_MEMORY"错误
- 调试"Invalid address space"错误
- 在C++中接收错误"member function must be called or its address taken in function"