23 #ifndef HIP_INCLUDE_HIP_DRIVER_TYPES_H
24 #define HIP_INCLUDE_HIP_DRIVER_TYPES_H
26 #include <hip/hip_common.h>
28 #if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
29 #include "driver_types.h"
30 #elif (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
34 #define HIP_INCLUDE_HIP_HCC_DETAIL_DRIVER_TYPES_H
35 #if !defined(__HIPCC_RTC__)
39 #endif // !defined(__HIPCC_RTC__)
40 typedef void* hipDeviceptr_t;
41 typedef enum hipChannelFormatKind {
42 hipChannelFormatKindSigned = 0,
43 hipChannelFormatKindUnsigned = 1,
44 hipChannelFormatKindFloat = 2,
45 hipChannelFormatKindNone = 3
46 }hipChannelFormatKind;
52 enum hipChannelFormatKind f;
54 #define HIP_TRSA_OVERRIDE_FORMAT 0x01
55 #define HIP_TRSF_READ_AS_INTEGER 0x01
56 #define HIP_TRSF_NORMALIZED_COORDINATES 0x02
57 #define HIP_TRSF_SRGB 0x10
58 typedef enum hipArray_Format {
59 HIP_AD_FORMAT_UNSIGNED_INT8 = 0x01,
60 HIP_AD_FORMAT_UNSIGNED_INT16 = 0x02,
61 HIP_AD_FORMAT_UNSIGNED_INT32 = 0x03,
62 HIP_AD_FORMAT_SIGNED_INT8 = 0x08,
63 HIP_AD_FORMAT_SIGNED_INT16 = 0x09,
64 HIP_AD_FORMAT_SIGNED_INT32 = 0x0a,
65 HIP_AD_FORMAT_HALF = 0x10,
66 HIP_AD_FORMAT_FLOAT = 0x20
71 enum hipArray_Format Format;
72 unsigned int NumChannels;
78 enum hipArray_Format Format;
79 unsigned int NumChannels;
89 enum hipArray_Format Format;
90 unsigned int NumChannels;
92 unsigned int textureType;
94 #if !defined(__HIPCC_RTC__)
100 hipDeviceptr_t srcDevice;
107 hipDeviceptr_t dstDevice;
113 #endif // !defined(__HIPCC_RTC__)
124 unsigned int min_mipmap_level;
125 unsigned int max_mipmap_level;
127 enum hipArray_Format format;
134 typedef enum hipResourceType {
135 hipResourceTypeArray = 0x00,
136 hipResourceTypeMipmappedArray = 0x01,
137 hipResourceTypeLinear = 0x02,
138 hipResourceTypePitch2D = 0x03
140 typedef enum HIPresourcetype_enum {
141 HIP_RESOURCE_TYPE_ARRAY = 0x00,
142 HIP_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01,
143 HIP_RESOURCE_TYPE_LINEAR = 0x02,
144 HIP_RESOURCE_TYPE_PITCH2D = 0x03
149 typedef enum HIPaddress_mode_enum {
150 HIP_TR_ADDRESS_MODE_WRAP = 0,
151 HIP_TR_ADDRESS_MODE_CLAMP = 1,
152 HIP_TR_ADDRESS_MODE_MIRROR = 2,
153 HIP_TR_ADDRESS_MODE_BORDER = 3
158 typedef enum HIPfilter_mode_enum {
159 HIP_TR_FILTER_MODE_POINT = 0,
160 HIP_TR_FILTER_MODE_LINEAR = 1
180 typedef enum hipResourceViewFormat {
181 hipResViewFormatNone = 0x00,
182 hipResViewFormatUnsignedChar1 = 0x01,
183 hipResViewFormatUnsignedChar2 = 0x02,
184 hipResViewFormatUnsignedChar4 = 0x03,
185 hipResViewFormatSignedChar1 = 0x04,
186 hipResViewFormatSignedChar2 = 0x05,
187 hipResViewFormatSignedChar4 = 0x06,
188 hipResViewFormatUnsignedShort1 = 0x07,
189 hipResViewFormatUnsignedShort2 = 0x08,
190 hipResViewFormatUnsignedShort4 = 0x09,
191 hipResViewFormatSignedShort1 = 0x0a,
192 hipResViewFormatSignedShort2 = 0x0b,
193 hipResViewFormatSignedShort4 = 0x0c,
194 hipResViewFormatUnsignedInt1 = 0x0d,
195 hipResViewFormatUnsignedInt2 = 0x0e,
196 hipResViewFormatUnsignedInt4 = 0x0f,
197 hipResViewFormatSignedInt1 = 0x10,
198 hipResViewFormatSignedInt2 = 0x11,
199 hipResViewFormatSignedInt4 = 0x12,
200 hipResViewFormatHalf1 = 0x13,
201 hipResViewFormatHalf2 = 0x14,
202 hipResViewFormatHalf4 = 0x15,
203 hipResViewFormatFloat1 = 0x16,
204 hipResViewFormatFloat2 = 0x17,
205 hipResViewFormatFloat4 = 0x18,
206 hipResViewFormatUnsignedBlockCompressed1 = 0x19,
207 hipResViewFormatUnsignedBlockCompressed2 = 0x1a,
208 hipResViewFormatUnsignedBlockCompressed3 = 0x1b,
209 hipResViewFormatUnsignedBlockCompressed4 = 0x1c,
210 hipResViewFormatSignedBlockCompressed4 = 0x1d,
211 hipResViewFormatUnsignedBlockCompressed5 = 0x1e,
212 hipResViewFormatSignedBlockCompressed5 = 0x1f,
213 hipResViewFormatUnsignedBlockCompressed6H = 0x20,
214 hipResViewFormatSignedBlockCompressed6H = 0x21,
215 hipResViewFormatUnsignedBlockCompressed7 = 0x22
216 }hipResourceViewFormat;
217 typedef enum HIPresourceViewFormat_enum
219 HIP_RES_VIEW_FORMAT_NONE = 0x00,
220 HIP_RES_VIEW_FORMAT_UINT_1X8 = 0x01,
221 HIP_RES_VIEW_FORMAT_UINT_2X8 = 0x02,
222 HIP_RES_VIEW_FORMAT_UINT_4X8 = 0x03,
223 HIP_RES_VIEW_FORMAT_SINT_1X8 = 0x04,
224 HIP_RES_VIEW_FORMAT_SINT_2X8 = 0x05,
225 HIP_RES_VIEW_FORMAT_SINT_4X8 = 0x06,
226 HIP_RES_VIEW_FORMAT_UINT_1X16 = 0x07,
227 HIP_RES_VIEW_FORMAT_UINT_2X16 = 0x08,
228 HIP_RES_VIEW_FORMAT_UINT_4X16 = 0x09,
229 HIP_RES_VIEW_FORMAT_SINT_1X16 = 0x0a,
230 HIP_RES_VIEW_FORMAT_SINT_2X16 = 0x0b,
231 HIP_RES_VIEW_FORMAT_SINT_4X16 = 0x0c,
232 HIP_RES_VIEW_FORMAT_UINT_1X32 = 0x0d,
233 HIP_RES_VIEW_FORMAT_UINT_2X32 = 0x0e,
234 HIP_RES_VIEW_FORMAT_UINT_4X32 = 0x0f,
235 HIP_RES_VIEW_FORMAT_SINT_1X32 = 0x10,
236 HIP_RES_VIEW_FORMAT_SINT_2X32 = 0x11,
237 HIP_RES_VIEW_FORMAT_SINT_4X32 = 0x12,
238 HIP_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13,
239 HIP_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14,
240 HIP_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15,
241 HIP_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16,
242 HIP_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17,
243 HIP_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18,
244 HIP_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19,
245 HIP_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a,
246 HIP_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b,
247 HIP_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c,
248 HIP_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d,
249 HIP_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e,
250 HIP_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f,
251 HIP_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20,
252 HIP_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21,
253 HIP_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22
254 } HIPresourceViewFormat;
259 enum hipResourceType resType;
315 enum hipResourceViewFormat format;
319 unsigned int firstMipmapLevel;
320 unsigned int lastMipmapLevel;
321 unsigned int firstLayer;
322 unsigned int lastLayer;
337 unsigned int reserved[16];
343 #if !defined(__HIPCC_RTC__)
344 typedef enum hipMemcpyKind {
345 hipMemcpyHostToHost = 0,
346 hipMemcpyHostToDevice = 1,
347 hipMemcpyDeviceToHost = 2,
348 hipMemcpyDeviceToDevice = 3,
377 enum hipMemcpyKind kind;
380 unsigned int srcXInBytes;
386 hipDeviceptr_t srcDevice;
388 unsigned int srcPitch;
389 unsigned int srcHeight;
390 unsigned int dstXInBytes;
396 hipDeviceptr_t dstDevice;
398 unsigned int dstPitch;
399 unsigned int dstHeight;
400 unsigned int WidthInBytes;
404 static inline struct hipPitchedPtr make_hipPitchedPtr(void* d,
size_t p,
size_t xsz,
413 static inline struct hipPos make_hipPos(size_t x, size_t y, size_t z) {
420 static inline struct hipExtent make_hipExtent(size_t w, size_t h, size_t d) {
427 typedef enum hipFunction_attribute {
428 HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK,
429 HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES,
430 HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES,
431 HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES,
432 HIP_FUNC_ATTRIBUTE_NUM_REGS,
433 HIP_FUNC_ATTRIBUTE_PTX_VERSION,
434 HIP_FUNC_ATTRIBUTE_BINARY_VERSION,
435 HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA,
436 HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES,
437 HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT,
438 HIP_FUNC_ATTRIBUTE_MAX
439 }hipFunction_attribute;
440 #endif // !defined(__HIPCC_RTC__)
442 #error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");