1 /* Include OpenCL header, and define OpenCL extensions, since what is and is not
2 * available in the official headers is very system-dependent */
8 #include <OpenCL/opencl.h>
13 /* These two defines were introduced in the 1.2 headers
14 * on 2012-11-30, so earlier versions don't have them
15 * (e.g. Debian wheezy)
18 #ifndef CL_DEVICE_IMAGE_PITCH_ALIGNMENT
19 #define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A
20 #define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B
23 /* 2.0 headers are not very common for the time being, so
24 * let's copy the defines for the new CL_DEVICE_* properties
27 #ifndef CL_VERSION_2_0
28 #define CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS 0x104C
29 #define CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE 0x104D
30 #define CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES 0x104E
31 #define CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE 0x104F
32 #define CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE 0x1050
33 #define CL_DEVICE_MAX_ON_DEVICE_QUEUES 0x1051
34 #define CL_DEVICE_MAX_ON_DEVICE_EVENTS 0x1052
35 #define CL_DEVICE_SVM_CAPABILITIES 0x1053
36 #define CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE 0x1054
37 #define CL_DEVICE_MAX_PIPE_ARGS 0x1055
38 #define CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS 0x1056
39 #define CL_DEVICE_PIPE_MAX_PACKET_SIZE 0x1057
40 #define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT 0x1058
41 #define CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT 0x1059
42 #define CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT 0x105A
44 #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER (1 << 0)
45 #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER (1 << 1)
46 #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM (1 << 2)
47 #define CL_DEVICE_SVM_ATOMICS (1 << 3)
49 typedef cl_bitfield cl_device_svm_capabilities;
52 #ifndef CL_VERSION_2_1
53 #define CL_PLATFORM_HOST_TIMER_RESOLUTION 0x0905
54 #define CL_DEVICE_IL_VERSION 0x105B
55 #define CL_DEVICE_MAX_NUM_SUB_GROUPS 0x105C
56 #define CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS 0x105D
64 #define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920
65 #define CL_PLATFORM_NOT_FOUND_KHR -1001
69 #define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
72 #define CL_DEVICE_HALF_FP_CONFIG 0x1033
74 /* cl_khr_terminate_context */
75 #define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x200F
77 /* cl_nv_device_attribute_query */
78 #define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000
79 #define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001
80 #define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002
81 #define CL_DEVICE_WARP_SIZE_NV 0x4003
82 #define CL_DEVICE_GPU_OVERLAP_NV 0x4004
83 #define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
84 #define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
85 #define CL_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT_NV 0x4007
86 #define CL_DEVICE_PCI_BUS_ID_NV 0x4008
87 #define CL_DEVICE_PCI_SLOT_ID_NV 0x4009
89 /* cl_ext_atomic_counters_{32,64} */
90 #define CL_DEVICE_MAX_ATOMIC_COUNTERS_EXT 0x4032
92 /* cl_amd_device_attribute_query */
93 #define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
94 #define CL_DEVICE_TOPOLOGY_AMD 0x4037
95 #define CL_DEVICE_BOARD_NAME_AMD 0x4038
96 #define CL_DEVICE_GLOBAL_FREE_MEMORY_AMD 0x4039
97 #define CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD 0x4040
98 #define CL_DEVICE_SIMD_WIDTH_AMD 0x4041
99 #define CL_DEVICE_SIMD_INSTRUCTION_WIDTH_AMD 0x4042
100 #define CL_DEVICE_WAVEFRONT_WIDTH_AMD 0x4043
101 #define CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD 0x4044
102 #define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD 0x4045
103 #define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD 0x4046
104 #define CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD 0x4047
105 #define CL_DEVICE_LOCAL_MEM_BANKS_AMD 0x4048
106 #define CL_DEVICE_THREAD_TRACE_SUPPORTED_AMD 0x4049
107 #define CL_DEVICE_GFXIP_MAJOR_AMD 0x404A
108 #define CL_DEVICE_GFXIP_MINOR_AMD 0x404B
109 #define CL_DEVICE_AVAILABLE_ASYNC_QUEUES_AMD 0x404C
111 #ifndef CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD
112 #define CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD 1
116 struct { cl_uint type; cl_uint data[5]; } raw;
117 struct { cl_uint type; cl_char unused[17]; cl_char bus; cl_char device; cl_char function; } pcie;
118 } cl_device_topology_amd;
121 /* cl_amd_offline_devices */
122 #define CL_CONTEXT_OFFLINE_DEVICES_AMD 0x403F
124 /* cl_ext_device_fission */
125 #define cl_ext_device_fission 1
127 typedef cl_ulong cl_device_partition_property_ext;
129 #define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050
130 #define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051
131 #define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052
132 #define CL_DEVICE_PARTITION_BY_NAMES_INTEL 0x4052 /* cl_intel_device_partition_by_names */
133 #define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053
135 #define CL_DEVICE_PARENT_DEVICE_EXT 0x4054
136 #define CL_DEVICE_PARTITION_TYPES_EXT 0x4055
137 #define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056
138 #define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057
139 #define CL_DEVICE_PARTITION_STYLE_EXT 0x4058
141 #define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1
142 #define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2
143 #define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3
144 #define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4
145 #define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10
146 #define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100
148 /* cl_intel_advanced_motion_estimation */
149 #define CL_DEVICE_ME_VERSION_INTEL 0x407E
151 /* cl_qcom_ext_host_ptr */
152 #define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0
153 #define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1
156 #define CL_DEVICE_SPIR_VERSIONS 0x40E0
158 /* cl_altera_device_temperature */
159 #define CL_DEVICE_CORE_TEMPERATURE_ALTERA 0x40F3
161 /* cl_intel_simultaneous_sharing */
162 #define CL_DEVICE_SIMULTANEOUS_INTEROPS_INTEL 0x4104
163 #define CL_DEVICE_NUM_SIMULTANEOUS_INTEROPS_INTEL 0x4105
165 /* cl_intel_required_subgroup_size */
166 #define CL_DEVICE_SUB_GROUP_SIZES_INTEL 0x4108