File: device.h

package info (click to toggle)
clinfo 0.0.20130513-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 464 kB
  • ctags: 146
  • sloc: sh: 1,054; cpp: 853; makefile: 8
file content (113 lines) | stat: -rw-r--r-- 3,357 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef clinfo_device_h_
#define clinfo_device_h_ 1

#include <CL/cl.h>
#include <CL/cl_ext.h>

#include <string>
#include <vector>

struct device
{
        device(cl_device_id);

        void load();

        cl_device_id const id;

        cl_device_id parent_device;

        std::string name;
        cl_platform_id platform;
        cl_device_type type;
        cl_uint vendor_id;
        std::string vendor;
        std::string profile;
        std::string version;
        std::string opencl_c_version;
        std::string driver_version;

        std::string built_in_kernels;

        // Availability
        cl_bool available;

        // Extensions
        std::string extensions;

        // General info
        cl_uint max_clock_frequency;
        cl_uint max_compute_units;
        cl_uint address_bits;
        cl_bool endian_little;
        cl_bool error_correction_support;
        cl_device_exec_capabilities execution_capabilities;
        cl_command_queue_properties queue_properties;

        std::vector<size_t> max_work_item_sizes;

        size_t max_parameter_size;
        cl_uint max_constant_args;
        cl_ulong max_constant_buffer_size;
        size_t max_work_group_size;
        size_t printf_buffer_size;

        cl_ulong profiling_timer_resolution;

        // Partitioning
        cl_uint partition_max_sub_devices;
        cl_device_partition_property partition_properties;
        cl_device_affinity_domain partition_affinity_domain;
        cl_uint partition_type;

        // Tools
        cl_bool compiler_available;
        cl_bool linker_available;

        // Floating Point
        cl_device_fp_config half_fp_config;
        cl_device_fp_config single_fp_config;
        cl_device_fp_config double_fp_config;

        // Vector
        cl_uint native_vector_width_char, preferred_vector_width_char;
        cl_uint native_vector_width_short, preferred_vector_width_short;
        cl_uint native_vector_width_int, preferred_vector_width_int;
        cl_uint native_vector_width_long, preferred_vector_width_long;
        cl_uint native_vector_width_half, preferred_vector_width_half;
        cl_uint native_vector_width_float, preferred_vector_width_float;
        cl_uint native_vector_width_double, preferred_vector_width_double;

        // Memory
        cl_bool host_unified_memory;
        cl_ulong global_mem_size;
        cl_ulong local_mem_size;
        cl_device_local_mem_type local_mem_type;
        cl_ulong max_mem_alloc_size;
        cl_uint min_data_type_align_size;
        cl_uint mem_base_addr_align;

        // Cache
        cl_device_mem_cache_type global_mem_cache_type;
        cl_ulong global_mem_cache_size;
        cl_uint global_mem_cacheline_size;

        // Images
        cl_bool image_support;
        size_t image2d_max_width, image2d_max_height;
        size_t image3d_max_width, image3d_max_height, image3d_max_depth;
        cl_uint max_read_image_args, max_write_image_args;
        cl_uint max_samplers;
        cl_uint image_max_array_size;
        cl_uint image_max_buffer_size;

        // Interop
        cl_uint preferred_interop_user_sync;

private:
        template<typename T> void query(T &, cl_device_info);
        void query(std::string &, cl_device_info);
        template<typename T, typename L> void query(std::vector<T> &, L, cl_device_info);
};

#endif