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__)
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;
95 #if !defined(__HIPCC_RTC__)
101 hipDeviceptr_t srcDevice;
108 hipDeviceptr_t dstDevice;
125 unsigned int min_mipmap_level;
126 unsigned int max_mipmap_level;
128 enum hipArray_Format format;
135 typedef enum hipResourceType {
136 hipResourceTypeArray = 0x00,
137 hipResourceTypeMipmappedArray = 0x01,
138 hipResourceTypeLinear = 0x02,
139 hipResourceTypePitch2D = 0x03
141 typedef enum HIPresourcetype_enum {
142 HIP_RESOURCE_TYPE_ARRAY = 0x00,
143 HIP_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01,
144 HIP_RESOURCE_TYPE_LINEAR = 0x02,
145 HIP_RESOURCE_TYPE_PITCH2D = 0x03
146 } HIPresourcetype, hipResourcetype;
150 typedef enum HIPaddress_mode_enum {
151 HIP_TR_ADDRESS_MODE_WRAP = 0,
152 HIP_TR_ADDRESS_MODE_CLAMP = 1,
153 HIP_TR_ADDRESS_MODE_MIRROR = 2,
154 HIP_TR_ADDRESS_MODE_BORDER = 3
159 typedef enum HIPfilter_mode_enum {
160 HIP_TR_FILTER_MODE_POINT = 0,
161 HIP_TR_FILTER_MODE_LINEAR = 1
181 typedef enum hipResourceViewFormat {
182 hipResViewFormatNone = 0x00,
183 hipResViewFormatUnsignedChar1 = 0x01,
184 hipResViewFormatUnsignedChar2 = 0x02,
185 hipResViewFormatUnsignedChar4 = 0x03,
186 hipResViewFormatSignedChar1 = 0x04,
187 hipResViewFormatSignedChar2 = 0x05,
188 hipResViewFormatSignedChar4 = 0x06,
189 hipResViewFormatUnsignedShort1 = 0x07,
190 hipResViewFormatUnsignedShort2 = 0x08,
191 hipResViewFormatUnsignedShort4 = 0x09,
192 hipResViewFormatSignedShort1 = 0x0a,
193 hipResViewFormatSignedShort2 = 0x0b,
194 hipResViewFormatSignedShort4 = 0x0c,
195 hipResViewFormatUnsignedInt1 = 0x0d,
196 hipResViewFormatUnsignedInt2 = 0x0e,
197 hipResViewFormatUnsignedInt4 = 0x0f,
198 hipResViewFormatSignedInt1 = 0x10,
199 hipResViewFormatSignedInt2 = 0x11,
200 hipResViewFormatSignedInt4 = 0x12,
201 hipResViewFormatHalf1 = 0x13,
202 hipResViewFormatHalf2 = 0x14,
203 hipResViewFormatHalf4 = 0x15,
204 hipResViewFormatFloat1 = 0x16,
205 hipResViewFormatFloat2 = 0x17,
206 hipResViewFormatFloat4 = 0x18,
207 hipResViewFormatUnsignedBlockCompressed1 = 0x19,
208 hipResViewFormatUnsignedBlockCompressed2 = 0x1a,
209 hipResViewFormatUnsignedBlockCompressed3 = 0x1b,
210 hipResViewFormatUnsignedBlockCompressed4 = 0x1c,
211 hipResViewFormatSignedBlockCompressed4 = 0x1d,
212 hipResViewFormatUnsignedBlockCompressed5 = 0x1e,
213 hipResViewFormatSignedBlockCompressed5 = 0x1f,
214 hipResViewFormatUnsignedBlockCompressed6H = 0x20,
215 hipResViewFormatSignedBlockCompressed6H = 0x21,
216 hipResViewFormatUnsignedBlockCompressed7 = 0x22
217 }hipResourceViewFormat;
218 typedef enum HIPresourceViewFormat_enum
220 HIP_RES_VIEW_FORMAT_NONE = 0x00,
221 HIP_RES_VIEW_FORMAT_UINT_1X8 = 0x01,
222 HIP_RES_VIEW_FORMAT_UINT_2X8 = 0x02,
223 HIP_RES_VIEW_FORMAT_UINT_4X8 = 0x03,
224 HIP_RES_VIEW_FORMAT_SINT_1X8 = 0x04,
225 HIP_RES_VIEW_FORMAT_SINT_2X8 = 0x05,
226 HIP_RES_VIEW_FORMAT_SINT_4X8 = 0x06,
227 HIP_RES_VIEW_FORMAT_UINT_1X16 = 0x07,
228 HIP_RES_VIEW_FORMAT_UINT_2X16 = 0x08,
229 HIP_RES_VIEW_FORMAT_UINT_4X16 = 0x09,
230 HIP_RES_VIEW_FORMAT_SINT_1X16 = 0x0a,
231 HIP_RES_VIEW_FORMAT_SINT_2X16 = 0x0b,
232 HIP_RES_VIEW_FORMAT_SINT_4X16 = 0x0c,
233 HIP_RES_VIEW_FORMAT_UINT_1X32 = 0x0d,
234 HIP_RES_VIEW_FORMAT_UINT_2X32 = 0x0e,
235 HIP_RES_VIEW_FORMAT_UINT_4X32 = 0x0f,
236 HIP_RES_VIEW_FORMAT_SINT_1X32 = 0x10,
237 HIP_RES_VIEW_FORMAT_SINT_2X32 = 0x11,
238 HIP_RES_VIEW_FORMAT_SINT_4X32 = 0x12,
239 HIP_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13,
240 HIP_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14,
241 HIP_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15,
242 HIP_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16,
243 HIP_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17,
244 HIP_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18,
245 HIP_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19,
246 HIP_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a,
247 HIP_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b,
248 HIP_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c,
249 HIP_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d,
250 HIP_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e,
251 HIP_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f,
252 HIP_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20,
253 HIP_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21,
254 HIP_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22
255 } HIPresourceViewFormat;
260 enum hipResourceType resType;
316 enum hipResourceViewFormat format;
320 unsigned int firstMipmapLevel;
321 unsigned int lastMipmapLevel;
322 unsigned int firstLayer;
323 unsigned int lastLayer;
338 unsigned int reserved[16];
344 #if !defined(__HIPCC_RTC__)
345 typedef enum hipMemcpyKind {
346 hipMemcpyHostToHost = 0,
347 hipMemcpyHostToDevice = 1,
348 hipMemcpyDeviceToHost = 2,
349 hipMemcpyDeviceToDevice = 3,
378 enum hipMemcpyKind kind;
381 unsigned int srcXInBytes;
387 hipDeviceptr_t srcDevice;
389 unsigned int srcPitch;
390 unsigned int srcHeight;
391 unsigned int dstXInBytes;
397 hipDeviceptr_t dstDevice;
399 unsigned int dstPitch;
400 unsigned int dstHeight;
401 unsigned int WidthInBytes;
405 static inline struct hipPitchedPtr make_hipPitchedPtr(void* d,
size_t p,
size_t xsz,
414 static inline struct hipPos make_hipPos(size_t x, size_t y, size_t z) {
421 static inline struct hipExtent make_hipExtent(size_t w, size_t h, size_t d) {
428 typedef enum hipFunction_attribute {
429 HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK,
430 HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES,
431 HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES,
432 HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES,
433 HIP_FUNC_ATTRIBUTE_NUM_REGS,
434 HIP_FUNC_ATTRIBUTE_PTX_VERSION,
435 HIP_FUNC_ATTRIBUTE_BINARY_VERSION,
436 HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA,
437 HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES,
438 HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT,
439 HIP_FUNC_ATTRIBUTE_MAX
440 } hipFunction_attribute;
442 typedef enum hipPointer_attribute {
443 HIP_POINTER_ATTRIBUTE_CONTEXT = 1,
445 HIP_POINTER_ATTRIBUTE_MEMORY_TYPE,
446 HIP_POINTER_ATTRIBUTE_DEVICE_POINTER,
447 HIP_POINTER_ATTRIBUTE_HOST_POINTER,
448 HIP_POINTER_ATTRIBUTE_P2P_TOKENS,
450 HIP_POINTER_ATTRIBUTE_SYNC_MEMOPS,
452 HIP_POINTER_ATTRIBUTE_BUFFER_ID,
453 HIP_POINTER_ATTRIBUTE_IS_MANAGED,
454 HIP_POINTER_ATTRIBUTE_DEVICE_ORDINAL,
456 HIP_POINTER_ATTRIBUTE_IS_LEGACY_HIP_IPC_CAPABLE,
459 HIP_POINTER_ATTRIBUTE_RANGE_START_ADDR,
460 HIP_POINTER_ATTRIBUTE_RANGE_SIZE,
461 HIP_POINTER_ATTRIBUTE_MAPPED,
463 HIP_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES,
465 HIP_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE,
468 HIP_POINTER_ATTRIBUTE_ACCESS_FLAGS,
470 HIP_POINTER_ATTRIBUTE_MEMPOOL_HANDLE
473 } hipPointer_attribute;
477 #error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
hipMemoryType
Definition: hip_runtime_api.h:161
Definition: driver_types.h:74
Definition: driver_types.h:68
Definition: driver_types.h:380
Definition: driver_types.h:283
hipArray_t hArray
Definition: driver_types.h:287
HIPresourcetype resType
Definition: driver_types.h:284
unsigned int numChannels
Definition: driver_types.h:295
hipMipmappedArray_t hMipmappedArray
Definition: driver_types.h:290
hipArray_Format format
Definition: driver_types.h:294
unsigned int flags
Definition: driver_types.h:310
size_t pitchInBytes
Definition: driver_types.h:304
size_t width
Definition: driver_types.h:302
size_t height
Definition: driver_types.h:303
size_t sizeInBytes
Definition: driver_types.h:296
hipDeviceptr_t devPtr
Definition: driver_types.h:293
Definition: driver_types.h:329
size_t width
Definition: driver_types.h:331
unsigned int firstLayer
Definition: driver_types.h:336
unsigned int lastMipmapLevel
Definition: driver_types.h:335
size_t depth
Definition: driver_types.h:333
unsigned int lastLayer
Definition: driver_types.h:337
unsigned int firstMipmapLevel
Definition: driver_types.h:334
size_t height
Definition: driver_types.h:332
HIPresourceViewFormat format
Definition: driver_types.h:330
Definition: driver_types.h:166
float maxMipmapLevelClamp
Definition: driver_types.h:174
unsigned int maxAnisotropy
Definition: driver_types.h:170
float mipmapLevelBias
Definition: driver_types.h:172
unsigned int flags
Definition: driver_types.h:169
float borderColor[4]
Definition: driver_types.h:175
HIPaddress_mode addressMode[3]
Definition: driver_types.h:167
HIPfilter_mode mipmapFilterMode
Definition: driver_types.h:171
float minMipmapLevelClamp
Definition: driver_types.h:173
HIPfilter_mode filterMode
Definition: driver_types.h:168
Definition: driver_types.h:82
Definition: driver_types.h:359
Definition: driver_types.h:370
Definition: driver_types.h:118
Definition: driver_types.h:353
Definition: driver_types.h:365
Definition: driver_types.h:259
Definition: driver_types.h:315
Definition: driver_types.h:96