HIP: Heterogenous-computing Interface for Portability
Classes | Macros | Typedefs | Enumerations
Global enum and defines

Classes

struct  dim3
 
struct  hipArray
 

Macros

#define hipStreamDefault   0x00
 Flags that can be used with hipStreamCreateWithFlags. More...
 
#define hipStreamNonBlocking   0x01
 Stream does not implicitly synchronize with null stream.
 
#define hipEventDefault   0x0
 Flags that can be used with hipEventCreateWithFlags: More...
 
#define hipEventBlockingSync   0x1
 Waiting will yield CPU. Power-friendly and usage-friendly but may increase latency.
 
#define hipEventDisableTiming   0x2
 Disable event's capability to record timing information. May improve performance.
 
#define hipEventInterprocess   0x4
 Event can support IPC. More...
 
#define hipEventReleaseToDevice   0x40000000
 
#define hipEventReleaseToSystem   0x80000000
 
#define hipHostMallocDefault   0x0
 Flags that can be used with hipHostMalloc.
 
#define hipHostMallocPortable   0x1
 Memory is considered allocated by all contexts.
 
#define hipHostMallocMapped   0x2
 Map the allocation into the address space for the current device. The device pointer can be obtained with hipHostGetDevicePointer.
 
#define hipHostMallocWriteCombined   0x4
 
#define hipHostMallocCoherent   0x40000000
 Allocate coherent memory. Overrides HIP_COHERENT_HOST_ALLOC for specific allocation.
 
#define hipHostMallocNonCoherent   0x80000000
 Allocate non-coherent memory. Overrides HIP_COHERENT_HOST_ALLOC for specific allocation.
 
#define hipHostRegisterDefault   0x0
 Flags that can be used with hipHostRegister. More...
 
#define hipHostRegisterPortable   0x1
 Memory is considered registered by all contexts.
 
#define hipHostRegisterMapped   0x2
 Map the allocation into the address space for the current device. The device pointer can be obtained with hipHostGetDevicePointer.
 
#define hipHostRegisterIoMemory   0x4
 Not supported.
 
#define hipDeviceScheduleAuto   0x0
 Automatically select between Spin and Yield.
 
#define hipDeviceScheduleSpin   0x1
 Dedicate a CPU core to spin-wait. Provides lowest latency, but burns a CPU core and may consume more power.
 
#define hipDeviceScheduleYield   0x2
 Yield the CPU to the operating system when waiting. May increase latency, but lowers power and is friendlier to other threads in the system.
 
#define hipDeviceScheduleBlockingSync   0x4
 
#define hipDeviceScheduleMask   0x7
 
#define hipDeviceMapHost   0x8
 
#define hipDeviceLmemResizeToMax   0x16
 

Typedefs

typedef enum hipError_t hipError_t
 
typedef enum hipDeviceAttribute_t hipDeviceAttribute_t
 
typedef enum hipJitOption hipJitOption
 
typedef enum hipFuncCache_t hipFuncCache_t
 
typedef enum hipSharedMemConfig hipSharedMemConfig
 
typedef struct dim3 dim3
 
typedef enum hipMemcpyKind hipMemcpyKind
 

Enumerations

enum  hipError_t {
  hipSuccess = 0, hipErrorOutOfMemory = 2, hipErrorNotInitialized = 3, hipErrorDeinitialized = 4,
  hipErrorProfilerDisabled = 5, hipErrorProfilerNotInitialized = 6, hipErrorProfilerAlreadyStarted = 7, hipErrorProfilerAlreadyStopped = 8,
  hipErrorInvalidImage = 200, hipErrorInvalidContext = 201, hipErrorContextAlreadyCurrent = 202, hipErrorMapFailed = 205,
  hipErrorUnmapFailed = 206, hipErrorArrayIsMapped = 207, hipErrorAlreadyMapped = 208, hipErrorNoBinaryForGpu = 209,
  hipErrorAlreadyAcquired = 210, hipErrorNotMapped = 211, hipErrorNotMappedAsArray = 212, hipErrorNotMappedAsPointer = 213,
  hipErrorECCNotCorrectable = 214, hipErrorUnsupportedLimit = 215, hipErrorContextAlreadyInUse = 216, hipErrorPeerAccessUnsupported = 217,
  hipErrorInvalidKernelFile = 218, hipErrorInvalidGraphicsContext = 219, hipErrorInvalidSource = 300, hipErrorFileNotFound = 301,
  hipErrorSharedObjectSymbolNotFound = 302, hipErrorSharedObjectInitFailed = 303, hipErrorOperatingSystem = 304, hipErrorSetOnActiveProcess = 305,
  hipErrorInvalidHandle = 400, hipErrorNotFound = 500, hipErrorIllegalAddress = 700, hipErrorInvalidSymbol = 701,
  hipErrorMissingConfiguration = 1001, hipErrorMemoryAllocation = 1002, hipErrorInitializationError = 1003, hipErrorLaunchFailure = 1004,
  hipErrorPriorLaunchFailure = 1005, hipErrorLaunchTimeOut = 1006, hipErrorLaunchOutOfResources = 1007, hipErrorInvalidDeviceFunction = 1008,
  hipErrorInvalidConfiguration = 1009, hipErrorInvalidDevice = 1010, hipErrorInvalidValue = 1011, hipErrorInvalidDevicePointer = 1017,
  hipErrorInvalidMemcpyDirection = 1021, hipErrorUnknown = 1030, hipErrorInvalidResourceHandle = 1033, hipErrorNotReady = 1034,
  hipErrorNoDevice = 1038, hipErrorPeerAccessAlreadyEnabled = 1050, hipErrorPeerAccessNotEnabled = 1051, hipErrorRuntimeMemory = 1052,
  hipErrorRuntimeOther = 1053, hipErrorHostMemoryAlreadyRegistered = 1061, hipErrorHostMemoryNotRegistered = 1062, hipErrorMapBufferObjectFailed = 1071,
  hipErrorTbd
}
 
enum  hipDeviceAttribute_t {
  hipDeviceAttributeMaxThreadsPerBlock, hipDeviceAttributeMaxBlockDimX, hipDeviceAttributeMaxBlockDimY, hipDeviceAttributeMaxBlockDimZ,
  hipDeviceAttributeMaxGridDimX, hipDeviceAttributeMaxGridDimY, hipDeviceAttributeMaxGridDimZ, hipDeviceAttributeMaxSharedMemoryPerBlock,
  hipDeviceAttributeTotalConstantMemory, hipDeviceAttributeWarpSize, hipDeviceAttributeMaxRegistersPerBlock, hipDeviceAttributeClockRate,
  hipDeviceAttributeMemoryClockRate, hipDeviceAttributeMemoryBusWidth, hipDeviceAttributeMultiprocessorCount, hipDeviceAttributeComputeMode,
  hipDeviceAttributeL2CacheSize, hipDeviceAttributeMaxThreadsPerMultiProcessor, hipDeviceAttributeComputeCapabilityMajor, hipDeviceAttributeComputeCapabilityMinor,
  hipDeviceAttributeConcurrentKernels, hipDeviceAttributePciBusId, hipDeviceAttributePciDeviceId, hipDeviceAttributeMaxSharedMemoryPerMultiprocessor,
  hipDeviceAttributeIsMultiGpuBoard
}
 
enum  hipJitOption {
  hipJitOptionMaxRegisters = 0, hipJitOptionThreadsPerBlock, hipJitOptionWallTime, hipJitOptionInfoLogBuffer,
  hipJitOptionInfoLogBufferSizeBytes, hipJitOptionErrorLogBuffer, hipJitOptionErrorLogBufferSizeBytes, hipJitOptionOptimizationLevel,
  hipJitOptionTargetFromContext, hipJitOptionTarget, hipJitOptionFallbackStrategy, hipJitOptionGenerateDebugInfo,
  hipJitOptionLogVerbose, hipJitOptionGenerateLineInfo, hipJitOptionCacheMode, hipJitOptionSm3xOpt,
  hipJitOptionFastCompile, hipJitOptionNumOptions
}
 
enum  hipFuncCache_t { hipFuncCachePreferNone, hipFuncCachePreferShared, hipFuncCachePreferL1, hipFuncCachePreferEqual }
 
enum  hipSharedMemConfig { hipSharedMemBankSizeDefault, hipSharedMemBankSizeFourByte, hipSharedMemBankSizeEightByte }
 
enum  hipMemcpyKind {
  hipMemcpyHostToHost = 0, hipMemcpyHostToDevice = 1, hipMemcpyDeviceToHost = 2, hipMemcpyDeviceToDevice =3,
  hipMemcpyDefault = 4
}
 

Detailed Description

Macro Definition Documentation

#define hipEventDefault   0x0

Flags that can be used with hipEventCreateWithFlags:

Default flags

#define hipEventInterprocess   0x4

Event can support IPC.

Warning
- not supported in HIP.
#define hipHostRegisterDefault   0x0

Flags that can be used with hipHostRegister.

Memory is Mapped and Portable

#define hipStreamDefault   0x00

Flags that can be used with hipStreamCreateWithFlags.

Default stream creation flags. These are used with hipStreamCreate().

Typedef Documentation

typedef struct dim3 dim3

Struct for data in 3D

Warning
On AMD devices and recent Nvidia devices, these hints and controls are ignored.

Memory copy types

Warning
On AMD devices and recent Nvidia devices, these hints and controls are ignored.

Enumeration Type Documentation

Enumerator
hipDeviceAttributeMaxThreadsPerBlock 

Maximum number of threads per block.

hipDeviceAttributeMaxBlockDimX 

Maximum x-dimension of a block.

hipDeviceAttributeMaxBlockDimY 

Maximum y-dimension of a block.

hipDeviceAttributeMaxBlockDimZ 

Maximum z-dimension of a block.

hipDeviceAttributeMaxGridDimX 

Maximum x-dimension of a grid.

hipDeviceAttributeMaxGridDimY 

Maximum y-dimension of a grid.

hipDeviceAttributeMaxGridDimZ 

Maximum z-dimension of a grid.

hipDeviceAttributeMaxSharedMemoryPerBlock 

Maximum shared memory available per block in bytes.

hipDeviceAttributeTotalConstantMemory 

Constant memory size in bytes.

hipDeviceAttributeWarpSize 

Warp size in threads.

hipDeviceAttributeMaxRegistersPerBlock 

Maximum number of 32-bit registers available to a thread block. This number is shared by all thread blocks simultaneously resident on a multiprocessor.

hipDeviceAttributeClockRate 

Peak clock frequency in kilohertz.

hipDeviceAttributeMemoryClockRate 

Peak memory clock frequency in kilohertz.

hipDeviceAttributeMemoryBusWidth 

Global memory bus width in bits.

hipDeviceAttributeMultiprocessorCount 

Number of multiprocessors on the device.

hipDeviceAttributeComputeMode 

Compute mode that device is currently in.

hipDeviceAttributeL2CacheSize 

Size of L2 cache in bytes. 0 if the device doesn't have L2 cache.

hipDeviceAttributeMaxThreadsPerMultiProcessor 

Maximum resident threads per multiprocessor.

hipDeviceAttributeComputeCapabilityMajor 

Major compute capability version number.

hipDeviceAttributeComputeCapabilityMinor 

Minor compute capability version number.

hipDeviceAttributeConcurrentKernels 

Device can possibly execute multiple kernels concurrently.

hipDeviceAttributePciBusId 

PCI Bus ID.

hipDeviceAttributePciDeviceId 

PCI Device ID.

hipDeviceAttributeMaxSharedMemoryPerMultiprocessor 

Maximum Shared Memory Per Multiprocessor.

hipDeviceAttributeIsMultiGpuBoard 

Multiple GPU devices.

enum hipError_t
Enumerator
hipSuccess 

Successful completion.

hipErrorInvalidContext 

Produced when input context is invalid.

hipErrorInvalidKernelFile 

In CUDA DRV, it is CUDA_ERROR_INVALID_PTX.

hipErrorMemoryAllocation 

Memory allocation error.

hipErrorInitializationError 

TODO comment from hipErrorInitializationError.

hipErrorLaunchFailure 

An exception occurred on the device while executing a kernel.

hipErrorLaunchOutOfResources 

Out of resources error.

hipErrorInvalidDevice 

DeviceID must be in range 0...#compute-devices.

hipErrorInvalidValue 

One or more of the parameters passed to the API call is NULL or not in an acceptable range.

hipErrorInvalidDevicePointer 

Invalid Device Pointer.

hipErrorInvalidMemcpyDirection 

Invalid memory copy direction.

hipErrorUnknown 

Unknown error.

hipErrorInvalidResourceHandle 

Resource handle (hipEvent_t or hipStream_t) invalid.

hipErrorNotReady 

Indicates that asynchronous operations enqueued earlier are not ready. This is not actually an error, but is used to distinguish from hipSuccess (which indicates completion). APIs that return this error include hipEventQuery and hipStreamQuery.

hipErrorNoDevice 

Call to hipGetDeviceCount returned 0 devices.

hipErrorPeerAccessAlreadyEnabled 

Peer access was already enabled from the current device.

hipErrorPeerAccessNotEnabled 

Peer access was never enabled from the current device.

hipErrorRuntimeMemory 

HSA runtime memory call returned error. Typically not seen in production systems.

hipErrorRuntimeOther 

HSA runtime call other than memory returned error. Typically not seen in production systems.

hipErrorHostMemoryAlreadyRegistered 

Produced when trying to lock a page-locked memory.

hipErrorHostMemoryNotRegistered 

Produced when trying to unlock a non-page-locked memory.

hipErrorMapBufferObjectFailed 

Produced when the IPC memory attach failed from ROCr.

hipErrorTbd 

Marker that more error codes are needed.

Warning
On AMD devices and recent Nvidia devices, these hints and controls are ignored.
Enumerator
hipFuncCachePreferNone 

no preference for shared memory or L1 (default)

hipFuncCachePreferShared 

prefer larger shared memory and smaller L1 cache

hipFuncCachePreferL1 

prefer larger L1 cache and smaller shared memory

hipFuncCachePreferEqual 

prefer equal size L1 cache and shared memory

Memory copy types

Enumerator
hipMemcpyHostToHost 

Host-to-Host Copy.

hipMemcpyHostToDevice 

Host-to-Device Copy.

hipMemcpyDeviceToHost 

Device-to-Host Copy.

hipMemcpyDeviceToDevice 

Device-to-Device Copy.

hipMemcpyDefault 

Runtime will automatically determine copy-kind based on virtual addresses.

Warning
On AMD devices and recent Nvidia devices, these hints and controls are ignored.
Enumerator
hipSharedMemBankSizeDefault 

The compiler selects a device-specific value for the banking.

hipSharedMemBankSizeFourByte 

Shared mem is banked at 4-bytes intervals and performs best when adjacent threads access data 4 bytes apart.

hipSharedMemBankSizeEightByte 

Shared mem is banked at 8-byte intervals and performs best when adjacent threads access data 4 bytes apart.