30 #ifndef HIP_INCLUDE_HIP_HIP_RUNTIME_API_H 31 #define HIP_INCLUDE_HIP_HIP_RUNTIME_API_H 35 #include <hip/hip_common.h> 39 HIP_ERROR_INVALID_VALUE,
40 HIP_ERROR_NOT_INITIALIZED,
41 HIP_ERROR_LAUNCH_OUT_OF_RESOURCES
46 unsigned hasGlobalInt32Atomics : 1;
47 unsigned hasGlobalFloatAtomicExch : 1;
48 unsigned hasSharedInt32Atomics : 1;
49 unsigned hasSharedFloatAtomicExch : 1;
50 unsigned hasFloatAtomicAdd : 1;
53 unsigned hasGlobalInt64Atomics : 1;
54 unsigned hasSharedInt64Atomics : 1;
57 unsigned hasDoubles : 1;
60 unsigned hasWarpVote : 1;
61 unsigned hasWarpBallot : 1;
62 unsigned hasWarpShuffle : 1;
63 unsigned hasFunnelShift : 1;
66 unsigned hasThreadFenceSystem : 1;
67 unsigned hasSyncThreadsExt : 1;
70 unsigned hasSurfaceFuncs : 1;
71 unsigned has3dGrid : 1;
72 unsigned hasDynamicParallelism : 1;
100 int multiProcessorCount;
117 char gcnArchName[256];
133 int cooperativeMultiDeviceUnmatchedGridDim;
135 int cooperativeMultiDeviceUnmatchedBlockDim;
137 int cooperativeMultiDeviceUnmatchedSharedMem;
148 typedef enum hipMemoryType {
162 enum hipMemoryType memoryType;
167 unsigned allocationFlags;
181 #if __cplusplus >= 201703L 182 #define __HIP_NODISCARD [[nodiscard]] 184 #define __HIP_NODISCARD 195 typedef enum __HIP_NODISCARD hipError_t {
197 hipErrorInvalidValue = 1,
198 hipErrorOutOfMemory = 2,
201 hipErrorMemoryAllocation = 2,
202 hipErrorNotInitialized = 3,
204 hipErrorInitializationError = 3,
205 hipErrorDeinitialized = 4,
206 hipErrorProfilerDisabled = 5,
207 hipErrorProfilerNotInitialized = 6,
208 hipErrorProfilerAlreadyStarted = 7,
209 hipErrorProfilerAlreadyStopped = 8,
210 hipErrorInvalidConfiguration = 9,
211 hipErrorInvalidSymbol = 13,
212 hipErrorInvalidDevicePointer = 17,
213 hipErrorInvalidMemcpyDirection = 21,
214 hipErrorInsufficientDriver = 35,
215 hipErrorMissingConfiguration = 52,
216 hipErrorPriorLaunchFailure = 53,
217 hipErrorInvalidDeviceFunction = 98,
218 hipErrorNoDevice = 100,
219 hipErrorInvalidDevice = 101,
220 hipErrorInvalidImage = 200,
221 hipErrorInvalidContext = 201,
222 hipErrorContextAlreadyCurrent = 202,
223 hipErrorMapFailed = 205,
225 hipErrorMapBufferObjectFailed = 205,
226 hipErrorUnmapFailed = 206,
227 hipErrorArrayIsMapped = 207,
228 hipErrorAlreadyMapped = 208,
229 hipErrorNoBinaryForGpu = 209,
230 hipErrorAlreadyAcquired = 210,
231 hipErrorNotMapped = 211,
232 hipErrorNotMappedAsArray = 212,
233 hipErrorNotMappedAsPointer = 213,
234 hipErrorECCNotCorrectable = 214,
235 hipErrorUnsupportedLimit = 215,
236 hipErrorContextAlreadyInUse = 216,
237 hipErrorPeerAccessUnsupported = 217,
238 hipErrorInvalidKernelFile = 218,
239 hipErrorInvalidGraphicsContext = 219,
240 hipErrorInvalidSource = 300,
241 hipErrorFileNotFound = 301,
242 hipErrorSharedObjectSymbolNotFound = 302,
243 hipErrorSharedObjectInitFailed = 303,
244 hipErrorOperatingSystem = 304,
245 hipErrorInvalidHandle = 400,
247 hipErrorInvalidResourceHandle = 400,
248 hipErrorNotFound = 500,
249 hipErrorNotReady = 600,
250 hipErrorIllegalAddress = 700,
254 hipErrorLaunchOutOfResources = 701,
255 hipErrorLaunchTimeOut = 702,
256 hipErrorPeerAccessAlreadyEnabled =
258 hipErrorPeerAccessNotEnabled =
260 hipErrorSetOnActiveProcess = 708,
261 hipErrorAssert = 710,
262 hipErrorHostMemoryAlreadyRegistered =
264 hipErrorHostMemoryNotRegistered =
266 hipErrorLaunchFailure =
268 hipErrorCooperativeLaunchTooLarge =
270 hipErrorNotSupported = 801,
273 hipErrorUnknown = 999,
275 hipErrorRuntimeMemory = 1052,
276 hipErrorRuntimeOther = 1053,
282 #undef __HIP_NODISCARD 354 enum hipComputeMode {
355 hipComputeModeDefault = 0,
356 hipComputeModeExclusive = 1,
357 hipComputeModeProhibited = 2,
358 hipComputeModeExclusiveProcess = 3
365 #if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_PLATFORM_NVCC__) 367 #elif defined(__HIP_PLATFORM_NVCC__) && !defined(__HIP_PLATFORM_HCC__) 368 #include "hip/nvcc_detail/hip_runtime_api.h" 370 #error("Must define exactly one of __HIP_PLATFORM_HCC__ or __HIP_PLATFORM_NVCC__"); 385 #if defined(__cplusplus) && !defined(__HIP_DISABLE_CPP_FUNCTIONS__) 387 static inline hipError_t
hipMalloc(T** devPtr,
size_t size) {
Definition: hip_runtime_api.h:343
size_t totalConstMem
Size of shared memory region (in bytes).
Definition: hip_runtime_api.h:95
Definition: hip_runtime_api.h:320
int asicRevision
Revision of the GPU in this device.
Definition: hip_runtime_api.h:141
Maximum x-dimension of a block.
Definition: hip_runtime_api.h:291
Maximum x-dimension of a grid.
Definition: hip_runtime_api.h:294
Maximum pitch in bytes allowed by memory copies.
Definition: hip_runtime_api.h:336
Global memory bus width in bits.
Definition: hip_runtime_api.h:307
unsigned int * hdpRegFlushCntl
Addres of HDP_REG_COHERENCY_FLUSH_CNTL register.
Definition: hip_runtime_api.h:125
size_t texturePitchAlignment
Pitch alignment requirement for texture references bound to pitched memory.
Definition: hip_runtime_api.h:128
int canMapHostMemory
Check whether HIP can map host memory.
Definition: hip_runtime_api.h:115
Definition: hip_runtime_api.h:301
#define hipMemAttachGlobal
Memory can be accessed by any stream on any device.
Definition: hip_runtime_api.h:191
Revision of the GPU in this device.
Definition: hip_runtime_api.h:351
int regsPerBlock
Registers per block.
Definition: hip_runtime_api.h:87
Definition: hip_runtime_api.h:310
Run time limit for kernels executed on the device.
Definition: hip_runtime_api.h:339
#define hipHostMallocDefault
Flags that can be used with hipHostMalloc.
Definition: hip_runtime_api.h:175
Maximum dimension width of 3D images in image elements.
Definition: hip_runtime_api.h:329
iGPU
Definition: hip_runtime_api.h:323
int isMultiGpuBoard
1 if device is on a multi-GPU board, 0 if not.
Definition: hip_runtime_api.h:114
Peak clock frequency in kilohertz.
Definition: hip_runtime_api.h:305
int maxTexture1D
Maximum number of elements in 1D images.
Definition: hip_runtime_api.h:121
Definition: hip_runtime_api.h:161
int clockRate
Max clock frequency of the multiProcessors in khz.
Definition: hip_runtime_api.h:92
Maximum z-dimension of a grid.
Definition: hip_runtime_api.h:296
Minor compute capability version number.
Definition: hip_runtime_api.h:315
Definition: hip_runtime_api.h:297
int pciBusID
PCI Bus ID.
Definition: hip_runtime_api.h:111
Definition: hip_runtime_api.h:345
Maximum y-dimension of a grid.
Definition: hip_runtime_api.h:295
Multiple GPU devices.
Definition: hip_runtime_api.h:322
int tccDriver
1:If device is Tesla device using TCC driver, else 0
Definition: hip_runtime_api.h:131
int maxThreadsPerBlock
Max work items per work group or workgroup max size.
Definition: hip_runtime_api.h:89
Maximum y-dimension of a block.
Definition: hip_runtime_api.h:292
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
Definition: hip_memory.cpp:762
Definition: hip_runtime_api.h:347
size_t sharedMemPerBlock
Size of shared memory region (in bytes).
Definition: hip_runtime_api.h:86
Support cooperative launch on multiple devices.
Definition: hip_runtime_api.h:325
int maxThreadsPerMultiProcessor
Maximum resident threads per multi-processor.
Definition: hip_runtime_api.h:104
size_t memPitch
Maximum pitch in bytes allowed by memory copies.
Definition: hip_runtime_api.h:126
int l2CacheSize
L2 cache size.
Definition: hip_runtime_api.h:103
hipDeviceAttribute_t
Definition: hip_runtime_api.h:289
size_t textureAlignment
Alignment requirement for textures.
Definition: hip_runtime_api.h:127
Major compute capability version number.
Definition: hip_runtime_api.h:314
Maximum number of threads per block.
Definition: hip_runtime_api.h:290
int gcnArch
AMD GCN Arch Value. Eg: 803, 701.
Definition: hip_runtime_api.h:116
Maximum dimensions depth of 3D images in image elements.
Definition: hip_runtime_api.h:331
int kernelExecTimeoutEnabled
Run time limit for kernels executed on the device.
Definition: hip_runtime_api.h:129
int computeMode
Compute mode.
Definition: hip_runtime_api.h:105
Maximum z-dimension of a block.
Definition: hip_runtime_api.h:293
PCI Bus ID.
Definition: hip_runtime_api.h:318
unsigned int * hdpMemFlushCntl
Addres of HDP_MEM_COHERENCY_FLUSH_CNTL register.
Definition: hip_runtime_api.h:124
Maximum dimension height of 2D images in image elements.
Definition: hip_runtime_api.h:328
Warp size in threads.
Definition: hip_runtime_api.h:300
int major
Definition: hip_runtime_api.h:96
Maximum dimensions height of 3D images in image elements.
Definition: hip_runtime_api.h:330
Peak memory clock frequency in kilohertz.
Definition: hip_runtime_api.h:306
Definition: hip_runtime_api.h:312
Address of the HDP_REG_COHERENCY_FLUSH_CNTL register.
Definition: hip_runtime_api.h:334
int clockInstructionRate
Definition: hip_runtime_api.h:106
int cooperativeMultiDeviceLaunch
HIP device supports cooperative launch on multiple devices.
Definition: hip_runtime_api.h:120
Constant memory size in bytes.
Definition: hip_runtime_api.h:299
Pitch alignment requirement for 2D texture references bound to pitched memory;.
Definition: hip_runtime_api.h:338
int warpSize
Warp size.
Definition: hip_runtime_api.h:88
int concurrentKernels
Device can possibly execute multiple kernels concurrently.
Definition: hip_runtime_api.h:109
Alignment requirement for textures.
Definition: hip_runtime_api.h:337
size_t totalGlobalMem
Size of global memory region (in bytes).
Definition: hip_runtime_api.h:85
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:695
Compute mode that device is currently in.
Definition: hip_runtime_api.h:309
PCI Device ID.
Definition: hip_runtime_api.h:319
Device can map host memory into device address space.
Definition: hip_runtime_api.h:340
Number of multiprocessors on the device.
Definition: hip_runtime_api.h:308
int integrated
APU vs dGPU.
Definition: hip_runtime_api.h:118
int memoryBusWidth
Global memory bus width in bits.
Definition: hip_runtime_api.h:94
Definition: hip_runtime_api.h:83
size_t maxSharedMemoryPerMultiProcessor
Maximum Shared Memory Per Multiprocessor.
Definition: hip_runtime_api.h:113
int cooperativeLaunch
HIP device supports cooperative launch.
Definition: hip_runtime_api.h:119
Support cooperative launch.
Definition: hip_runtime_api.h:324
Maximum number of elements in 1D images.
Definition: hip_runtime_api.h:326
int pciDeviceID
PCI Device ID.
Definition: hip_runtime_api.h:112
int pciDomainID
PCI Domain ID.
Definition: hip_runtime_api.h:110
int ECCEnabled
Device has ECC support enabled.
Definition: hip_runtime_api.h:130
Definition: hip_runtime_api.h:44
Contains C function APIs for HIP runtime. This file does not use any HCC builtin or special language ...
Definition: hip_runtime_api.h:349
int memoryClockRate
Max global memory clock frequency in khz.
Definition: hip_runtime_api.h:93
Maximum dimension width of 2D images in image elements.
Definition: hip_runtime_api.h:327
hipError_t hipMallocManaged(void **dev_ptr, size_t size, unsigned int flags __dparm(hipMemAttachGlobal))
Allocates memory that will be automatically managed by AMD HMM.
Address of the HDP_MEM_COHERENCY_FLUSH_CNTL register.
Definition: hip_runtime_api.h:333
Device has ECC support enabled.
Definition: hip_runtime_api.h:341
int cooperativeMultiDeviceUnmatchedFunc
Definition: hip_runtime_api.h:132
Definition: hip_runtime_api.h:316