ViennaCL - The Vienna Computing Library
1.5.2
|
A class representing a compute device (e.g. a GPU) More...
#include <device.hpp>
Public Member Functions | |
device () | |
device (cl_device_id dev) | |
device (const device &other) | |
cl_uint | address_bits () const |
The default compute device address space size specified as an unsigned integer value in bits. Currently supported values are 32 or 64 bits. | |
cl_bool | available () const |
Is CL_TRUE if the device is available and CL_FALSE if the device is not available. | |
cl_bool | compiler_available () const |
Is CL_FALSE if the implementation does not have a compiler available to compile the program source. Is CL_TRUE if the compiler is available. This can be CL_FALSE for the embedded platform profile only. | |
cl_bool | endian_little () const |
Is CL_TRUE if the OpenCL device is a little endian device and CL_FALSE otherwise. | |
cl_bool | error_correction_support () const |
Is CL_TRUE if the device implements error correction for all accesses to compute device memory (global and constant) and CL_FALSE otherwise. | |
cl_device_exec_capabilities | execution_capabilities () const |
Describes the execution capabilities of the device. | |
std::string | extensions () const |
Returns a space-separated list of extension names (the extension names themselves do not contain any spaces). | |
cl_ulong | global_mem_cache_size () const |
Size of global memory cache in bytes. | |
cl_device_mem_cache_type | global_mem_cache_type () const |
Type of global memory cache supported. Valid values are: CL_NONE, CL_READ_ONLY_CACHE, and CL_READ_WRITE_CACHE. | |
cl_uint | global_mem_cacheline_size () const |
Size of global memory cache in bytes. | |
cl_ulong | global_mem_size () const |
Size of global memory in bytes. | |
cl_bool | image_support () const |
Is CL_TRUE if the device and the host have a unified memory subsystem and is CL_FALSE otherwise. | |
size_t | image2d_max_height () const |
Max height of 2D image in pixels. The minimum value is 8192 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
size_t | image2d_max_width () const |
Max width of 2D image in pixels. The minimum value is 8192 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
size_t | image3d_max_depth () const |
Max depth of 3D image in pixels. The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
size_t | image3d_max_height () const |
Max height of 3D image in pixels. The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
size_t | image3d_max_width () const |
Max width of 3D image in pixels. The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
cl_ulong | local_mem_size () const |
Size of local memory arena in bytes. The minimum value is 32 KB. | |
cl_device_local_mem_type | local_mem_type () const |
Type of local memory supported. This can be set to CL_LOCAL implying dedicated local memory storage such as SRAM, or CL_GLOBAL. | |
cl_uint | max_clock_frequency () const |
Maximum configured clock frequency of the device in MHz. | |
cl_uint | max_compute_units () const |
The number of parallel compute cores on the OpenCL device. The minimum value is 1. | |
cl_uint | max_constant_args () const |
Max number of arguments declared with the __constant qualifier in a kernel. The minimum value is 8. | |
cl_ulong | max_constant_buffer_size () const |
Max size in bytes of a constant buffer allocation. The minimum value is 64 KB. | |
cl_ulong | max_mem_alloc_size () const |
Max size of memory object allocation in bytes. The minimum value is max(1/4th of CL_DEVICE_GLOBAL_MEM_SIZE, 128*1024*1024) | |
size_t | max_parameter_size () const |
Max size in bytes of the arguments that can be passed to a kernel. The minimum value is 1024. | |
cl_uint | max_read_image_args () const |
Max number of simultaneous image objects that can be read by a kernel. The minimum value is 128 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
cl_uint | max_samplers () const |
Max number of simultaneous image objects that can be read by a kernel. The minimum value is 128 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
size_t | max_work_group_size () const |
Maximum number of work-items in a work-group executing a kernel using the data parallel execution model. The minimum value is 1. | |
cl_uint | max_work_item_dimensions () const |
Maximum dimensions that specify the global and local work-item IDs used by the data parallel execution model. The minimum value is 3. | |
std::vector< size_t > | max_work_item_sizes () const |
Maximum number of work-items that can be specified in each dimension of the work-group. | |
cl_uint | max_write_image_args () const |
Max number of simultaneous image objects that can be written to by a kernel. The minimum value is 8 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE. | |
cl_uint | mem_base_addr_align () const |
Describes the alignment in bits of the base address of any allocated memory object. | |
cl_uint | min_data_type_align_size () const |
The smallest alignment in bytes which can be used for any data type. | |
std::string | name () const |
Device name string. | |
device_architecture_family | architecture_family () const |
Device architecture family. | |
cl_platform_id | platform () const |
The platform associated with this device. | |
cl_uint | preferred_vector_width_char () const |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector. | |
cl_uint | preferred_vector_width_short () const |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector. | |
cl_uint | preferred_vector_width_int () const |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector. | |
cl_uint | preferred_vector_width_long () const |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector. | |
cl_uint | preferred_vector_width_float () const |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector. | |
cl_uint | preferred_vector_width_double () const |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector. | |
std::string | profile () const |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector. | |
size_t | profiling_timer_resolution () const |
Describes the resolution of device timer. This is measured in nanoseconds. | |
cl_command_queue_properties | queue_properties () const |
Describes the command-queue properties supported by the device. | |
cl_device_fp_config | single_fp_config () const |
Describes single precision floating-point capability of the OpenCL device. | |
cl_device_type | type () const |
The OpenCL device type. | |
std::string | vendor () const |
Vendor name string. | |
cl_uint | vendor_id () const |
A unique device vendor identifier. An example of a unique device identifier could be the PCIe ID. | |
std::string | version () const |
Vendor name string. | |
std::string | driver_version () const |
Vendor name string. | |
bool | double_support () const |
ViennaCL convenience function: Returns true if the device supports double precision. | |
std::string | double_support_extension () const |
ViennaCL convenience function: Returns the device extension which enables double precision (usually cl_khr_fp64, but AMD used cl_amd_fp64 in the past) | |
cl_device_id | id () const |
Returns the OpenCL device id. | |
std::string | info (vcl_size_t indent=0, char indent_char= ' ') const |
Returns an info string with a few properties of the device. Use full_info() to get all details. | |
std::string | full_info (vcl_size_t indent=0, char indent_char= ' ') const |
Returns an info string with all device properties defined in the OpenCL 1.1 standard, listed in alphabetical order. Use info() for a short overview. | |
bool | operator== (device const &other) const |
bool | operator== (cl_device_id other) const |
A class representing a compute device (e.g. a GPU)
device | ( | ) | [inline, explicit] |
device | ( | cl_device_id | dev | ) | [inline, explicit] |
cl_uint address_bits | ( | ) | const [inline] |
The default compute device address space size specified as an unsigned integer value in bits. Currently supported values are 32 or 64 bits.
device_architecture_family architecture_family | ( | ) | const [inline] |
Device architecture family.
cl_bool available | ( | ) | const [inline] |
Is CL_TRUE if the device is available and CL_FALSE if the device is not available.
cl_bool compiler_available | ( | ) | const [inline] |
Is CL_FALSE if the implementation does not have a compiler available to compile the program source. Is CL_TRUE if the compiler is available. This can be CL_FALSE for the embedded platform profile only.
bool double_support | ( | ) | const [inline] |
ViennaCL convenience function: Returns true if the device supports double precision.
std::string double_support_extension | ( | ) | const [inline] |
ViennaCL convenience function: Returns the device extension which enables double precision (usually cl_khr_fp64, but AMD used cl_amd_fp64 in the past)
std::string driver_version | ( | ) | const [inline] |
Vendor name string.
cl_bool endian_little | ( | ) | const [inline] |
Is CL_TRUE if the OpenCL device is a little endian device and CL_FALSE otherwise.
cl_bool error_correction_support | ( | ) | const [inline] |
Is CL_TRUE if the device implements error correction for all accesses to compute device memory (global and constant) and CL_FALSE otherwise.
cl_device_exec_capabilities execution_capabilities | ( | ) | const [inline] |
Describes the execution capabilities of the device.
This is a bit-field that describes one or more of the following values: CL_EXEC_KERNEL - The OpenCL device can execute OpenCL kernels. CL_EXEC_NATIVE_KERNEL - The OpenCL device can execute native kernels. The mandated minimum capability is CL_EXEC_KERNEL.
std::string extensions | ( | ) | const [inline] |
Returns a space-separated list of extension names (the extension names themselves do not contain any spaces).
The list of extension names returned currently can include one or more of the following approved extension names: cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp16 cl_khr_gl_sharing cl_khr_gl_event cl_khr_d3d10_sharing
std::string full_info | ( | vcl_size_t | indent = 0 , |
char | indent_char = ' ' |
||
) | const [inline] |
Returns an info string with all device properties defined in the OpenCL 1.1 standard, listed in alphabetical order. Use info() for a short overview.
indent | Number of optional blanks to be added at the start of each line |
indent_char | Character to be used for indenting |
cl_ulong global_mem_cache_size | ( | ) | const [inline] |
Size of global memory cache in bytes.
cl_device_mem_cache_type global_mem_cache_type | ( | ) | const [inline] |
Type of global memory cache supported. Valid values are: CL_NONE, CL_READ_ONLY_CACHE, and CL_READ_WRITE_CACHE.
cl_uint global_mem_cacheline_size | ( | ) | const [inline] |
Size of global memory cache in bytes.
cl_ulong global_mem_size | ( | ) | const [inline] |
Size of global memory in bytes.
cl_device_id id | ( | ) | const [inline] |
Returns the OpenCL device id.
size_t image2d_max_height | ( | ) | const [inline] |
Max height of 2D image in pixels. The minimum value is 8192 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
size_t image2d_max_width | ( | ) | const [inline] |
Max width of 2D image in pixels. The minimum value is 8192 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
size_t image3d_max_depth | ( | ) | const [inline] |
Max depth of 3D image in pixels. The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
size_t image3d_max_height | ( | ) | const [inline] |
Max height of 3D image in pixels. The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
size_t image3d_max_width | ( | ) | const [inline] |
Max width of 3D image in pixels. The minimum value is 2048 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
cl_bool image_support | ( | ) | const [inline] |
Is CL_TRUE if the device and the host have a unified memory subsystem and is CL_FALSE otherwise.
Is CL_TRUE if images are supported by the OpenCL device and CL_FALSE otherwise.
std::string info | ( | vcl_size_t | indent = 0 , |
char | indent_char = ' ' |
||
) | const [inline] |
Returns an info string with a few properties of the device. Use full_info() to get all details.
Returns the following device properties: name, vendor, type, availability, max compute units, max work group size, global mem size, local mem size, local mem type, host unified memory
indent | Number of optional blanks to be added at the start of each line |
indent_char | Character to be used for indenting |
cl_ulong local_mem_size | ( | ) | const [inline] |
Size of local memory arena in bytes. The minimum value is 32 KB.
cl_device_local_mem_type local_mem_type | ( | ) | const [inline] |
Type of local memory supported. This can be set to CL_LOCAL implying dedicated local memory storage such as SRAM, or CL_GLOBAL.
cl_uint max_clock_frequency | ( | ) | const [inline] |
Maximum configured clock frequency of the device in MHz.
cl_uint max_compute_units | ( | ) | const [inline] |
The number of parallel compute cores on the OpenCL device. The minimum value is 1.
cl_uint max_constant_args | ( | ) | const [inline] |
Max number of arguments declared with the __constant qualifier in a kernel. The minimum value is 8.
cl_ulong max_constant_buffer_size | ( | ) | const [inline] |
Max size in bytes of a constant buffer allocation. The minimum value is 64 KB.
cl_ulong max_mem_alloc_size | ( | ) | const [inline] |
Max size of memory object allocation in bytes. The minimum value is max(1/4th of CL_DEVICE_GLOBAL_MEM_SIZE, 128*1024*1024)
size_t max_parameter_size | ( | ) | const [inline] |
Max size in bytes of the arguments that can be passed to a kernel. The minimum value is 1024.
For this minimum value, only a maximum of 128 arguments can be passed to a kernel.
cl_uint max_read_image_args | ( | ) | const [inline] |
Max number of simultaneous image objects that can be read by a kernel. The minimum value is 128 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
cl_uint max_samplers | ( | ) | const [inline] |
Max number of simultaneous image objects that can be read by a kernel. The minimum value is 128 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
size_t max_work_group_size | ( | ) | const [inline] |
Maximum number of work-items in a work-group executing a kernel using the data parallel execution model. The minimum value is 1.
cl_uint max_work_item_dimensions | ( | ) | const [inline] |
Maximum dimensions that specify the global and local work-item IDs used by the data parallel execution model. The minimum value is 3.
std::vector<size_t> max_work_item_sizes | ( | ) | const [inline] |
Maximum number of work-items that can be specified in each dimension of the work-group.
Returns n size_t entries, where n is the value returned by the query for CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS. The minimum value is (1, 1, 1).
cl_uint max_write_image_args | ( | ) | const [inline] |
Max number of simultaneous image objects that can be written to by a kernel. The minimum value is 8 if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.
cl_uint mem_base_addr_align | ( | ) | const [inline] |
Describes the alignment in bits of the base address of any allocated memory object.
cl_uint min_data_type_align_size | ( | ) | const [inline] |
The smallest alignment in bytes which can be used for any data type.
std::string name | ( | ) | const [inline] |
Device name string.
bool operator== | ( | device const & | other | ) | const [inline] |
bool operator== | ( | cl_device_id | other | ) | const [inline] |
cl_platform_id platform | ( | ) | const [inline] |
The platform associated with this device.
cl_uint preferred_vector_width_char | ( | ) | const [inline] |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
cl_uint preferred_vector_width_double | ( | ) | const [inline] |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
If the cl_khr_fp64 extension is not supported, this function returns 0.
cl_uint preferred_vector_width_float | ( | ) | const [inline] |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
cl_uint preferred_vector_width_int | ( | ) | const [inline] |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
cl_uint preferred_vector_width_long | ( | ) | const [inline] |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
cl_uint preferred_vector_width_short | ( | ) | const [inline] |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
std::string profile | ( | ) | const [inline] |
Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
If the cl_khr_fp16 extension is not supported, this function returns 0.OpenCL profile string. Returns the profile name supported by the device.
The profile name returned can be one of the following strings: FULL_PROFILE - if the device supports the OpenCL specification EMBEDDED_PROFILE - if the device supports the OpenCL embedded profile.
size_t profiling_timer_resolution | ( | ) | const [inline] |
Describes the resolution of device timer. This is measured in nanoseconds.
cl_command_queue_properties queue_properties | ( | ) | const [inline] |
Describes the command-queue properties supported by the device.
This is a bit-field that describes one or more of the following values: CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE CL_QUEUE_PROFILING_ENABLE3 These properties are described in the table for clCreateCommandQueue in the OpenCL standard. The mandated minimum capability is CL_QUEUE_PROFILING_ENABLE.
cl_device_fp_config single_fp_config | ( | ) | const [inline] |
Describes single precision floating-point capability of the OpenCL device.
This is a bit-field that describes one or more of the following values: CL_FP_DENORM - denorms are supported. CL_FP_INF_NAN - INF and NaNs are supported. CL_FP_ROUND_TO_NEAREST - round to nearest even rounding mode supported. CL_FP_ROUND_TO_ZERO - round to zero rounding mode supported. CL_FP_ROUND_TO_INF - round to +ve and -ve infinity rounding modes supported. CP_FP_FMA - IEEE754-2008 fused multiply-add is supported. CL_FP_SOFT_FLOAT - Basic floating-point operations (such as addition, subtraction, multiplication) are implemented in software.
The mandated minimum floating-point capability is CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN.
cl_device_type type | ( | ) | const [inline] |
The OpenCL device type.
Currently supported values are one of or a combination of: CL_DEVICE_TYPE_CPU, CL_DEVICE_TYPE_GPU, CL_DEVICE_TYPE_ACCELERATOR, or CL_DEVICE_TYPE_DEFAULT.
std::string vendor | ( | ) | const [inline] |
Vendor name string.
cl_uint vendor_id | ( | ) | const [inline] |
A unique device vendor identifier. An example of a unique device identifier could be the PCIe ID.
std::string version | ( | ) | const [inline] |
Vendor name string.