在OpenCL 中输出CLinfo信息

        在命令终端输入:clinfo,可以查看OpenCL 相关的信息。在OpenCL 程序开发的过程中也可以通过API 获取相应的信息。

OpenCLInfo.cpp 代码如下:


#include <iostream>
#include <fstream>
#include <sstream>#if defined(_WIN32)
#include <malloc.h> // needed for alloca
#endif // _WIN32#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
# include <alloca.h>
#endif // linux#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif///
// Display information for a particular platform.
// Assumes that all calls to clGetPlatformInfo returns
// a value of type char[], which is valid for OpenCL 1.1.
//
void DisplayPlatformInfo(cl_platform_id id, cl_platform_info name,std::string str)
{cl_int errNum;std::size_t paramValueSize;errNum = clGetPlatformInfo(id,name,0,NULL,&paramValueSize);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL platform " << str << "." << std::endl;return;}char * info = (char *)alloca(sizeof(char) * paramValueSize);errNum = clGetPlatformInfo(id,name,paramValueSize,info,NULL);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL platform " << str << "." << std::endl;return;}std::cout << "\t" << str << ":\t" << info << std::endl; 
}template<typename T>
void appendBitfield(T info, T value, std::string name, std::string & str)
{if (info & value) {if (str.length() > 0){str.append(" | ");}str.append(name);}
}		///
// Display information for a particular device.
// As different calls to clGetDeviceInfo may return
// values of different types a template is used. 
// As some values returned are arrays of values, a templated class is
// used so it can be specialized for this case, see below.
//
template <typename T>
class InfoDevice
{
public:static void display(cl_device_id id, cl_device_info name,std::string str){cl_int errNum;std::size_t paramValueSize;errNum = clGetDeviceInfo(id,name,0,NULL,&paramValueSize);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL device info " << str << "." << std::endl;return;}T * info = (T *)alloca(sizeof(T) * paramValueSize);errNum = clGetDeviceInfo(id,name,paramValueSize,info,NULL);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL device info " << str << "." << std::endl;return;}// Handle a few special casesswitch (name){case CL_DEVICE_TYPE:{std::string deviceType;appendBitfield<cl_device_type>(*(reinterpret_cast<cl_device_type*>(info)),CL_DEVICE_TYPE_CPU, "CL_DEVICE_TYPE_CPU", deviceType);appendBitfield<cl_device_type>(*(reinterpret_cast<cl_device_type*>(info)),CL_DEVICE_TYPE_GPU, "CL_DEVICE_TYPE_GPU", deviceType);appendBitfield<cl_device_type>(*(reinterpret_cast<cl_device_type*>(info)),CL_DEVICE_TYPE_ACCELERATOR, "CL_DEVICE_TYPE_ACCELERATOR", deviceType);appendBitfield<cl_device_type>(*(reinterpret_cast<cl_device_type*>(info)),CL_DEVICE_TYPE_DEFAULT, "CL_DEVICE_TYPE_DEFAULT", deviceType);std::cout << "\t\t" << str << ":\t" << deviceType << std::endl;}break;case CL_DEVICE_SINGLE_FP_CONFIG:{std::string fpType;appendBitfield<cl_device_fp_config>(*(reinterpret_cast<cl_device_fp_config*>(info)),CL_FP_DENORM, "CL_FP_DENORM", fpType); appendBitfield<cl_device_fp_config>(*(reinterpret_cast<cl_device_fp_config*>(info)),CL_FP_INF_NAN, "CL_FP_INF_NAN", fpType); appendBitfield<cl_device_fp_config>(*(reinterpret_cast<cl_device_fp_config*>(info)),CL_FP_ROUND_TO_NEAREST, "CL_FP_ROUND_TO_NEAREST", fpType); appendBitfield<cl_device_fp_config>(*(reinterpret_cast<cl_device_fp_config*>(info)),CL_FP_ROUND_TO_ZERO, "CL_FP_ROUND_TO_ZERO", fpType); appendBitfield<cl_device_fp_config>(*(reinterpret_cast<cl_device_fp_config*>(info)),CL_FP_ROUND_TO_INF, "CL_FP_ROUND_TO_INF", fpType); appendBitfield<cl_device_fp_config>(*(reinterpret_cast<cl_device_fp_config*>(info)),CL_FP_FMA, "CL_FP_FMA", fpType); #ifdef CL_FP_SOFT_FLOATappendBitfield<cl_device_fp_config>(*(reinterpret_cast<cl_device_fp_config*>(info)),CL_FP_SOFT_FLOAT, "CL_FP_SOFT_FLOAT", fpType); 
#endifstd::cout << "\t\t" << str << ":\t" << fpType << std::endl;}case CL_DEVICE_GLOBAL_MEM_CACHE_TYPE:{std::string memType;appendBitfield<cl_device_mem_cache_type>(*(reinterpret_cast<cl_device_mem_cache_type*>(info)), CL_NONE, "CL_NONE", memType); appendBitfield<cl_device_mem_cache_type>(*(reinterpret_cast<cl_device_mem_cache_type*>(info)), CL_READ_ONLY_CACHE, "CL_READ_ONLY_CACHE", memType); appendBitfield<cl_device_mem_cache_type>(*(reinterpret_cast<cl_device_mem_cache_type*>(info)), CL_READ_WRITE_CACHE, "CL_READ_WRITE_CACHE", memType); std::cout << "\t\t" << str << ":\t" << memType << std::endl;}break;case CL_DEVICE_LOCAL_MEM_TYPE:{std::string memType;appendBitfield<cl_device_local_mem_type>(*(reinterpret_cast<cl_device_local_mem_type*>(info)), CL_GLOBAL, "CL_LOCAL", memType);appendBitfield<cl_device_local_mem_type>(*(reinterpret_cast<cl_device_local_mem_type*>(info)), CL_GLOBAL, "CL_GLOBAL", memType);std::cout << "\t\t" << str << ":\t" << memType << std::endl;}break;case CL_DEVICE_EXECUTION_CAPABILITIES:{std::string memType;appendBitfield<cl_device_exec_capabilities>(*(reinterpret_cast<cl_device_exec_capabilities*>(info)), CL_EXEC_KERNEL, "CL_EXEC_KERNEL", memType);appendBitfield<cl_device_exec_capabilities>(*(reinterpret_cast<cl_device_exec_capabilities*>(info)), CL_EXEC_NATIVE_KERNEL, "CL_EXEC_NATIVE_KERNEL", memType);std::cout << "\t\t" << str << ":\t" << memType << std::endl;}break;case CL_DEVICE_QUEUE_PROPERTIES:{std::string memType;appendBitfield<cl_device_exec_capabilities>(*(reinterpret_cast<cl_device_exec_capabilities*>(info)), CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, "CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE", memType);appendBitfield<cl_device_exec_capabilities>(*(reinterpret_cast<cl_device_exec_capabilities*>(info)), CL_QUEUE_PROFILING_ENABLE, "CL_QUEUE_PROFILING_ENABLE", memType);std::cout << "\t\t" << str << ":\t" << memType << std::endl;}break;default:std::cout << "\t\t" << str << ":\t" << *info << std::endl;break;}}
};///
// Simple trait class used to wrap base types.
//
template <typename T>
class ArrayType
{
public:static bool isChar() { return false; }
};///
// Specialized for the char (i.e. null terminated string case).
//
template<>
class ArrayType<char>
{
public:static bool isChar() { return true; }
};///
// Specialized instance of class InfoDevice for array types.
//
template <typename T>
class InfoDevice<ArrayType<T> >
{
public:static void display(cl_device_id id, cl_device_info name,std::string str){cl_int errNum;std::size_t paramValueSize;errNum = clGetDeviceInfo(id,name,0,NULL,&paramValueSize);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL device info " << str << "." << std::endl;return;}T * info = (T *)alloca(sizeof(T) * paramValueSize);errNum = clGetDeviceInfo(id,name,paramValueSize,info,NULL);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL device info " << str << "." << std::endl;return;}if (ArrayType<T>::isChar()){std::cout << "\t" << str << ":\t" << info << std::endl; }else if (name == CL_DEVICE_MAX_WORK_ITEM_SIZES){cl_uint maxWorkItemDimensions;errNum = clGetDeviceInfo(id,CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS,sizeof(cl_uint),&maxWorkItemDimensions,NULL);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL device info " << "CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS." << std::endl;return;}std::cout << "\t" << str << ":\t" ; for (cl_uint i = 0; i < maxWorkItemDimensions; i++){std::cout << info[i] << " "; }std::cout << std::endl;}}
};///
//  Enumerate platforms and display information about them 
//  and their associated devices.
//
void displayInfo(void)
{cl_int errNum;cl_uint numPlatforms;cl_platform_id * platformIds;cl_context context = NULL;// First, query the total number of platformserrNum = clGetPlatformIDs(0, NULL, &numPlatforms);if (errNum != CL_SUCCESS || numPlatforms <= 0){std::cerr << "Failed to find any OpenCL platform." << std::endl;return;}// Next, allocate memory for the installed plaforms, and qeury // to get the list.platformIds = (cl_platform_id *)alloca(sizeof(cl_platform_id) * numPlatforms);// First, query the total number of platformserrNum = clGetPlatformIDs(numPlatforms, platformIds, NULL);if (errNum != CL_SUCCESS){std::cerr << "Failed to find any OpenCL platforms." << std::endl;return;}std::cout << "Number of platforms: \t" << numPlatforms << std::endl; // Iterate through the list of platforms displaying associated informationfor (cl_uint i = 0; i < numPlatforms; i++) {// First we display information associated with the platformDisplayPlatformInfo(platformIds[i], CL_PLATFORM_PROFILE, "CL_PLATFORM_PROFILE");DisplayPlatformInfo(platformIds[i], CL_PLATFORM_VERSION, "CL_PLATFORM_VERSION");DisplayPlatformInfo(platformIds[i], CL_PLATFORM_VENDOR, "CL_PLATFORM_VENDOR");DisplayPlatformInfo(platformIds[i], CL_PLATFORM_EXTENSIONS, "CL_PLATFORM_EXTENSIONS");// Now query the set of devices associated with the platformcl_uint numDevices;errNum = clGetDeviceIDs(platformIds[i],CL_DEVICE_TYPE_ALL,0,NULL,&numDevices);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL devices." << std::endl;return;}cl_device_id * devices = (cl_device_id *)alloca(sizeof(cl_device_id) * numDevices);errNum = clGetDeviceIDs(platformIds[i],CL_DEVICE_TYPE_ALL,numDevices,devices,NULL);if (errNum != CL_SUCCESS){std::cerr << "Failed to find OpenCL devices." << std::endl;return;}std::cout << "\tNumber of devices: \t" << numDevices << std::endl; // Iterate through each device, displaying associated informationfor (cl_uint j = 0; j < numDevices; j++){InfoDevice<cl_device_type>::display(devices[j], CL_DEVICE_TYPE, "CL_DEVICE_TYPE");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_VENDOR_ID, "CL_DEVICE_VENDOR_ID");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MAX_COMPUTE_UNITS, "CL_DEVICE_MAX_COMPUTE_UNITS");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, "CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS");InfoDevice<ArrayType<size_t> >::display(devices[j], CL_DEVICE_MAX_WORK_ITEM_SIZES, "CL_DEVICE_MAX_WORK_ITEM_SIZES");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_MAX_WORK_GROUP_SIZE, "CL_DEVICE_MAX_WORK_GROUP_SIZE");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, "CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, "CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, "CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, "CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, "CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, "CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE");#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALFInfoDevice<cl_uint>::display(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, "CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR, "CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT, "CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, "CL_DEVICE_NATIVE_VECTOR_WIDTH_INT");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, "CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, "CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, "CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, "CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF");
#endifInfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MAX_CLOCK_FREQUENCY, "CL_DEVICE_MAX_CLOCK_FREQUENCY");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_ADDRESS_BITS, "CL_DEVICE_ADDRESS_BITS");InfoDevice<cl_ulong>::display(devices[j], CL_DEVICE_MAX_MEM_ALLOC_SIZE, "CL_DEVICE_MAX_MEM_ALLOC_SIZE");InfoDevice<cl_bool>::display(devices[j], CL_DEVICE_IMAGE_SUPPORT, "CL_DEVICE_IMAGE_SUPPORT");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MAX_READ_IMAGE_ARGS, "CL_DEVICE_MAX_READ_IMAGE_ARGS");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MAX_WRITE_IMAGE_ARGS, "CL_DEVICE_MAX_WRITE_IMAGE_ARGS");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_IMAGE2D_MAX_WIDTH, "CL_DEVICE_IMAGE2D_MAX_WIDTH");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_IMAGE2D_MAX_WIDTH, "CL_DEVICE_IMAGE2D_MAX_WIDTH");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_IMAGE2D_MAX_HEIGHT, "CL_DEVICE_IMAGE2D_MAX_HEIGHT");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_IMAGE3D_MAX_WIDTH, "CL_DEVICE_IMAGE3D_MAX_WIDTH");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_IMAGE3D_MAX_HEIGHT, "CL_DEVICE_IMAGE3D_MAX_HEIGHT");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_IMAGE3D_MAX_DEPTH, "CL_DEVICE_IMAGE3D_MAX_DEPTH");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MAX_SAMPLERS, "CL_DEVICE_MAX_SAMPLERS");InfoDevice<std::size_t>::display(devices[j], CL_DEVICE_MAX_PARAMETER_SIZE, "CL_DEVICE_MAX_PARAMETER_SIZE");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MEM_BASE_ADDR_ALIGN, "CL_DEVICE_MEM_BASE_ADDR_ALIGN");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, "CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE");InfoDevice<cl_device_fp_config>::display(devices[j], CL_DEVICE_SINGLE_FP_CONFIG, "CL_DEVICE_SINGLE_FP_CONFIG");InfoDevice<cl_device_mem_cache_type>::display(devices[j], CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, "CL_DEVICE_GLOBAL_MEM_CACHE_TYPE");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, "CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE");InfoDevice<cl_ulong>::display(devices[j], CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, "CL_DEVICE_GLOBAL_MEM_CACHE_SIZE");InfoDevice<cl_ulong>::display(devices[j], CL_DEVICE_GLOBAL_MEM_SIZE, "CL_DEVICE_GLOBAL_MEM_SIZE");InfoDevice<cl_ulong>::display(devices[j], CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, "CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE");InfoDevice<cl_uint>::display(devices[j], CL_DEVICE_MAX_CONSTANT_ARGS, "CL_DEVICE_MAX_CONSTANT_ARGS");InfoDevice<cl_device_local_mem_type>::display(devices[j], CL_DEVICE_LOCAL_MEM_TYPE, "CL_DEVICE_LOCAL_MEM_TYPE");InfoDevice<cl_ulong>::display(devices[j], CL_DEVICE_LOCAL_MEM_SIZE, "CL_DEVICE_LOCAL_MEM_SIZE");InfoDevice<cl_bool>::display(devices[j], CL_DEVICE_ERROR_CORRECTION_SUPPORT, "CL_DEVICE_ERROR_CORRECTION_SUPPORT");#ifdef CL_DEVICE_HOST_UNIFIED_MEMORYInfoDevice<cl_bool>::display(devices[j], CL_DEVICE_HOST_UNIFIED_MEMORY, "CL_DEVICE_HOST_UNIFIED_MEMORY");
#endifInfoDevice<std::size_t>::display(devices[j], CL_DEVICE_PROFILING_TIMER_RESOLUTION, "CL_DEVICE_PROFILING_TIMER_RESOLUTION");InfoDevice<cl_bool>::display(devices[j], CL_DEVICE_ENDIAN_LITTLE, "CL_DEVICE_ENDIAN_LITTLE");InfoDevice<cl_bool>::display(devices[j], CL_DEVICE_AVAILABLE, "CL_DEVICE_AVAILABLE");InfoDevice<cl_bool>::display(devices[j], CL_DEVICE_COMPILER_AVAILABLE, "CL_DEVICE_COMPILER_AVAILABLE");InfoDevice<cl_device_exec_capabilities>::display(devices[j], CL_DEVICE_EXECUTION_CAPABILITIES, "CL_DEVICE_EXECUTION_CAPABILITIES");InfoDevice<cl_command_queue_properties>::display(devices[j], CL_DEVICE_QUEUE_PROPERTIES, "CL_DEVICE_QUEUE_PROPERTIES");InfoDevice<cl_platform_id>::display(devices[j], CL_DEVICE_PLATFORM, "CL_DEVICE_PLATFORM");InfoDevice<ArrayType<char> >::display(devices[j], CL_DEVICE_NAME, "CL_DEVICE_NAME");InfoDevice<ArrayType<char> >::display(devices[j], CL_DEVICE_VENDOR, "CL_DEVICE_VENDOR");InfoDevice<ArrayType<char> >::display(devices[j], CL_DRIVER_VERSION, "CL_DRIVER_VERSION");InfoDevice<ArrayType<char> >::display(devices[j], CL_DEVICE_PROFILE, "CL_DEVICE_PROFILE");InfoDevice<ArrayType<char> >::display(devices[j], CL_DEVICE_VERSION, "CL_DEVICE_VERSION");#ifdef CL_DEVICE_OPENCL_C_VERSIONInfoDevice<ArrayType<char> >::display(devices[j], CL_DEVICE_OPENCL_C_VERSION, "CL_DEVICE_OPENCL_C_VERSION");
#endifInfoDevice<ArrayType<char> >::display(devices[j], CL_DEVICE_EXTENSIONS, "CL_DEVICE_EXTENSIONS");std::cout << std::endl << std::endl;}}
}///
//	main() for OpenCLInfo example
//
int main(int argc, char** argv)
{cl_context context = 0;displayInfo();return 0;
}

CMakeList.txt如下:

cmake_minimum_required(VERSION 3.10) # 3.10 << C_STANDARD 11project(OpenCLInfo)find_package(OpenCL REQUIRED)add_executable(${PROJECT_NAME} OpenCLInfo.cpp )target_link_libraries(${PROJECT_NAME} PRIVATE OpenCL::OpenCL)set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 11C_STANDARD_REQUIRED ONC_EXTENSIONS OFF)target_compile_definitions(${PROJECT_NAME} PRIVATE CL_TARGET_OPENCL_VERSION=100)

运行结果如下:

Number of platforms:    1CL_PLATFORM_PROFILE:    FULL_PROFILECL_PLATFORM_VERSION:    OpenCL 3.0 CUDA 12.0.151CL_PLATFORM_VENDOR:     NVIDIA CorporationCL_PLATFORM_EXTENSIONS: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_device_uuid cl_khr_pci_bus_info cl_khr_external_semaphore cl_khr_external_memory cl_khr_external_semaphore_opaque_fd cl_khr_external_memory_opaque_fdNumber of devices:      1CL_DEVICE_TYPE: CL_DEVICE_TYPE_GPUCL_DEVICE_VENDOR_ID:    4318CL_DEVICE_MAX_COMPUTE_UNITS:    22CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:     3CL_DEVICE_MAX_WORK_ITEM_SIZES:  1024 1024 64 CL_DEVICE_MAX_WORK_GROUP_SIZE:  1024CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR:  1CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT: 1CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT:   1CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG:  1CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: 1CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE:        1CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF:  0CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR:     1CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT:    1CL_DEVICE_NATIVE_VECTOR_WIDTH_INT:      1CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG:     1CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT:    1CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE:   1CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF:     0CL_DEVICE_MAX_CLOCK_FREQUENCY:  1830CL_DEVICE_ADDRESS_BITS: 64CL_DEVICE_MAX_MEM_ALLOC_SIZE:   1555496960CL_DEVICE_IMAGE_SUPPORT:        1CL_DEVICE_MAX_READ_IMAGE_ARGS:  256CL_DEVICE_MAX_WRITE_IMAGE_ARGS: 32CL_DEVICE_IMAGE2D_MAX_WIDTH:    32768CL_DEVICE_IMAGE2D_MAX_WIDTH:    32768CL_DEVICE_IMAGE2D_MAX_HEIGHT:   32768CL_DEVICE_IMAGE3D_MAX_WIDTH:    16384CL_DEVICE_IMAGE3D_MAX_HEIGHT:   16384CL_DEVICE_IMAGE3D_MAX_DEPTH:    16384CL_DEVICE_MAX_SAMPLERS: 32CL_DEVICE_MAX_PARAMETER_SIZE:   4352CL_DEVICE_MEM_BASE_ADDR_ALIGN:  4096CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE:     128CL_DEVICE_SINGLE_FP_CONFIG:     CL_FP_DENORM | CL_FP_INF_NAN | CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_FMACL_DEVICE_SINGLE_FP_CONFIG:     CL_READ_ONLY_CACHE | CL_READ_WRITE_CACHECL_DEVICE_GLOBAL_MEM_CACHE_TYPE:        CL_READ_WRITE_CACHECL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE:    128CL_DEVICE_GLOBAL_MEM_CACHE_SIZE:        720896CL_DEVICE_GLOBAL_MEM_SIZE:      6221987840CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE:     65536CL_DEVICE_MAX_CONSTANT_ARGS:    9CL_DEVICE_LOCAL_MEM_TYPE:CL_DEVICE_LOCAL_MEM_SIZE:       49152CL_DEVICE_ERROR_CORRECTION_SUPPORT:     0CL_DEVICE_HOST_UNIFIED_MEMORY:  0CL_DEVICE_PROFILING_TIMER_RESOLUTION:   1000CL_DEVICE_ENDIAN_LITTLE:        1CL_DEVICE_AVAILABLE:    1CL_DEVICE_COMPILER_AVAILABLE:   1CL_DEVICE_EXECUTION_CAPABILITIES:       CL_EXEC_KERNELCL_DEVICE_QUEUE_PROPERTIES:     CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLECL_DEVICE_PLATFORM:     0x55885f0195c0CL_DEVICE_NAME: NVIDIA GeForce GTX 1660CL_DEVICE_VENDOR:       NVIDIA CorporationCL_DRIVER_VERSION:      525.105.17CL_DEVICE_PROFILE:      FULL_PROFILECL_DEVICE_VERSION:      OpenCL 3.0 CUDACL_DEVICE_OPENCL_C_VERSION:     OpenCL C 1.2 CL_DEVICE_EXTENSIONS:   cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_device_uuid cl_khr_pci_bus_info cl_khr_external_semaphore cl_khr_external_memory cl_khr_external_semaphore_opaque_fd cl_khr_external_memory_opaque_fd

参考文献:《OpenCL 编程指南》

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/59046.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

原生鸿蒙应用市场:开发者的新机遇与深度探索

文章目录 自动化检测前移&#xff1a;提升开发效率与质量的新利器数据服务&#xff1a;数据驱动的精细化运营助手测试服务&#xff1a;保障应用质量的关键环节应用加密&#xff1a;保护应用安全与权益的利器从开发到运营的全方位支持写在最后 2024年10月22日&#xff0c;华为在…

【建造&机械】垃圾车检测系统源码&数据集全套:改进yolo11-SPPF-LSKA

改进yolo11-swintransformer等200全套创新点大全&#xff1a;垃圾车检测系统源码&#xff06;数据集全套 1.图片效果展示 项目来源 人工智能促进会 2024.10.30 注意&#xff1a;由于项目一直在更新迭代&#xff0c;上面“1.图片效果展示”和“2.视频效果展示”展示的系统图片…

全差分运放电路分析

可以看到&#xff0c;该运放有正负两个反馈。首先需要申明的是&#xff1a;全差动运算放大器仍然满足虚短虚断的特性。 从上图中可以看到&#xff0c;运放的正输入端有一个Vin信号&#xff0c;负输入端没有接输入信号&#xff1b;这是一种典型的将单端输入型号转化成差分信号的…

C# 第一阶段(桌面软件)

1&#xff1a;先按照别人的思路来一遍&#xff0c;下面是一篇很不错的新手教程&#xff1b; C#从零开始学习&#xff08;图文教程&#xff09;&#xff0c;持续更新中~_学习_逐鹿之森-开放原子开发者工作坊 (csdn.net) Visual Studio下载&#xff1a;Thank You for Downloadi…

Win/Linux/Kylin 系统安装指定版本 jdk(8u171为例)

现在安装一个jdk环境&#xff0c; 应该也不是什么麻烦事&#xff0c;教程满天飞&#xff0c;但如果你需要安装指定版本的jdk&#xff0c;那文章还是有点乱&#xff0c;给的下载地址也不太对&#xff0c;不太好找&#xff0c;有的版本还要花钱买积分.......比较靠谱还是官网&…

Java 正则基础

本文里简单的记录了一下Java正则的内容&#xff0c;因为之前学了python版的&#xff0c;所以零基础的可以去看一下视频&#xff1a;正则专题。而且没有列出正则里的其他方法&#xff0c;需要的可以百度一下 快速入门 class RegExp {public static void main(String[] args) {…

std::bind绑定普通函数、模板、类成员函数、类模板函数测试和简单策略

绑定普通函数 绑定具体值 代码 #include <iostream> #include <vector> #include <cassert> #include <functional> using namespace std;int add_func(int a, int b) {return a b; }int main() {auto func std::bind(add_func, 5, 10);cout <…

在区块链技术中,什么是工作量证明(PoW)?

工作量证明&#xff08;Proof - of - Work&#xff0c;PoW&#xff09;是区块链网络中的一种共识机制。它是一种用于验证节点是否为区块链的维护和扩展付出了足够计算资源&#xff08;即工作量&#xff09;的方法。通过让节点完成一个具有一定难度的计算任务&#xff0c;来竞争…

CentOS 7 软件/程序安装示例

安装软件/程序 wget&#xff0c;前提需要用 root 用户 1、搜索软件/程序 yum search wget 搜索到软件/程序。 2、安装软件/程序 yum -y install wget 安装完成。

USB协议学习

文章目录 USB发展背景发展变化速度等级通讯接口 四种传输主设备 & 从设备主设备从设备 连接与检测高速设备与主机连接USB总线常见的几种状态 枚举过程特点 控制传输学习资料 USB发展背景 发展变化 USB1.1&#xff1a;规范了USB低全速传输&#xff1b; USB2.0&#xff1a;…

qt QRadioButton详解

QRadioButton 是一个可以切换选中&#xff08;checked&#xff09;或未选中&#xff08;unchecked&#xff09;状态的选项按钮。单选按钮通常呈现给用户一个“多选一”的选择&#xff0c;即在一组单选按钮中&#xff0c;一次只能选中一个按钮。 重要方法 QRadioButton(QWidget…

内核——全局句柄表

实验环境&#xff1a;win7 x32 首先引入一段基础概念&#xff1b; 1.在windows下所有的资源都是用对象的方式进行管理的(文件、进程、设备等都是对象)&#xff0c;当要访问一个对象时&#xff0c;如打开一个文件&#xff0c;系统就会创建一个对象句柄&#xff0c;通过这个句柄…

windows系统类似于linux的nohup命令后台启动jar服务

一、首先新建一个后缀名为.bat文件 二、将jar包放在与jar包同一个路径下 三、编写.bat文件 echo off start javaw -Xms512m -Xmx1024m -XX:PermSize256m -XX:MaxPermSize512m -XX:MaxNewSize512m -jar xxxxx-22900.jar >> StartupLog.log 2>&1 & exit 四…

PC端查看历史消息,鼠标向上滚动加载数据时页面停留在上次查看的位置

在工作中&#xff0c;碰到PC端类似聊天框&#xff0c;鼠标向上滚动&#xff0c;触顶时分页获取数据&#xff1b;但是将接口获得的数据连接到循环数组数据前面时&#xff0c;由于数据变化&#xff0c;滚动条会直接滚动到最顶端&#xff0c;显然这个效果不友好。最好的效果就是&a…

随着飞行汽车的亮相,在环保方面有什么保护措施吗

飞行汽车具备环保潜力&#xff0c;采用电动或混合动力系统减少污染&#xff0c;并拓展应用场景。多家企业布局&#xff0c;沃飞长空作为国内eVTOL(电动垂直起降航空器)研发的领先企业&#xff0c;在环保这一点做的非常到位&#xff0c;AE200采用纯电动力系统,零碳排放,静默飞行…

【Excel】常用公式记录

这里写自定义目录标题 根据身份证号获取年龄 根据身份证号获取年龄 替换公式中的 A2 TEXT(SUMPRODUCT(DATEDIF(TEXT(IF(LEN(A2)15,19,0)&MID(A2,7,LEN(A2)/2-1),“#0-00-00”),NOW(),{“y”,“ym”,“md”})*{10000,100,1}),“00岁零00个月零00天”)

LiveQing视频点播流媒体RTMP推流服务功能-支持电子放大拉框放大直播视频拉框放大录像视频流拉框放大电子放大

LiveQing视频点播流媒体RTMP推流服务功能-支持电子放大拉框放大直播视频拉框放大录像视频流拉框放大电子放大 1、鉴权直播2、视频点播3、RTMP推流视频直播和点播流媒体服务 1、鉴权直播 云直播服务-》鉴权直播 -》播放 &#xff0c;左键单击可以拉取矩形框&#xff0c;放大选中…

Android笔记(三十一):Deeplink失效问题

背景 通过deeplink启动应用之后&#xff0c;没关闭应用的情况下&#xff0c;再次使用deeplink会失效的问题&#xff0c;是系统bug导致的。此bug仅在某些设备&#xff08;Nexus 5X&#xff09;上重现&#xff0c;launchMode并且仅当应用程序最初通过深层链接启动并再次通过深层…

人工智能能改变哪些行业?深入分析应用场景与前景

人工智能&#xff08;AI&#xff09;技术的发展历程可追溯到20世纪50年代。最初&#xff0c;AI的概念是由计算机科学家阿兰图灵提出的&#xff0c;他设想了一种能够模拟人类思维的机器。随后&#xff0c;在1956年的达特茅斯会议上&#xff0c;人工智能作为一门独立学科正式诞生…

【缓存与加速技术实践】Redis数据类型

文章目录 Redis 数据类型String 数据类型List 数据类型Hash 数据类型Set 数据类型Sorted Set 数据类型 Redis 数据类型 Redis支持五种主要的数据类型&#xff1a; String&#xff08;字符串&#xff09;、List&#xff08;列表&#xff09;、Hash&#xff08;散列&#xff09;…