HIP: Heterogenous-computing Interface for Portability
|
Go to the documentation of this file.
24 #ifndef HIP_INCLUDE_HIP_AMD_DETAIL_HIP_RUNTIME_API_H
25 #define HIP_INCLUDE_HIP_AMD_DETAIL_HIP_RUNTIME_API_H
34 #ifndef GENERIC_GRID_LAUNCH
35 #define GENERIC_GRID_LAUNCH 1
39 #include <hip/amd_detail/driver_types.h>
44 #define DEPRECATED(msg) __declspec(deprecated(msg))
45 #else // !defined(_MSC_VER)
46 #define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
47 #endif // !defined(_MSC_VER)
49 #define DEPRECATED_MSG "This API is marked as deprecated and may not be supported in future releases. For more details please refer https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_deprecated_api_list.md"
51 #define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
52 #define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
53 #define HIP_LAUNCH_PARAM_END ((void*)0x03)
63 #pragma GCC visibility push (default)
68 hipError_t hip_init();
79 typedef struct ihipCtx_t* hipCtx_t;
82 typedef int hipDevice_t;
84 typedef enum hipDeviceP2PAttr {
85 hipDevP2PAttrPerformanceRank = 0,
86 hipDevP2PAttrAccessSupported,
87 hipDevP2PAttrNativeAtomicSupported,
88 hipDevP2PAttrHipArrayAccessSupported
91 typedef struct ihipStream_t* hipStream_t;
93 #define hipIpcMemLazyEnablePeerAccess 0
95 #define HIP_IPC_HANDLE_SIZE 64
98 char reserved[HIP_IPC_HANDLE_SIZE];
102 char reserved[HIP_IPC_HANDLE_SIZE];
105 typedef struct ihipModule_t* hipModule_t;
107 typedef struct ihipModuleSymbol_t* hipFunction_t;
112 size_t constSizeBytes;
113 size_t localSizeBytes;
114 int maxDynamicSharedSizeBytes;
115 int maxThreadsPerBlock;
117 int preferredShmemCarveout;
119 size_t sharedSizeBytes;
122 typedef struct ihipEvent_t* hipEvent_t;
125 hipLimitMallocHeapSize = 0x02,
132 #define hipStreamDefault \
135 #define hipStreamNonBlocking 0x01
139 #define hipEventDefault 0x0
140 #define hipEventBlockingSync \
142 #define hipEventDisableTiming \
144 #define hipEventInterprocess 0x4
145 #define hipEventReleaseToDevice \
147 #define hipEventReleaseToSystem \
156 #define hipHostMallocDefault 0x0
157 #define hipHostMallocPortable 0x1
158 #define hipHostMallocMapped \
160 #define hipHostMallocWriteCombined 0x4
162 #define hipHostMallocNumaUser \
165 #define hipHostMallocCoherent \
167 #define hipHostMallocNonCoherent \
172 #define hipMemAttachGlobal 0x01
173 #define hipMemAttachHost 0x02
174 #define hipMemAttachSingle 0x04
177 #define hipDeviceMallocDefault 0x0
178 #define hipDeviceMallocFinegrained 0x1
179 #define hipMallocSignalMemory 0x2
181 #define hipHostRegisterDefault 0x0
183 #define hipHostRegisterPortable 0x1
184 #define hipHostRegisterMapped \
186 #define hipHostRegisterIoMemory 0x4
188 #define hipExtHostRegisterCoarseGrained 0x8
190 #define hipDeviceScheduleAuto 0x0
191 #define hipDeviceScheduleSpin \
193 #define hipDeviceScheduleYield \
196 #define hipDeviceScheduleBlockingSync 0x4
198 #define hipDeviceScheduleMask 0x7
200 #define hipDeviceMapHost 0x8
201 #define hipDeviceLmemResizeToMax 0x16
203 #define hipArrayDefault 0x00
204 #define hipArrayLayered 0x01
205 #define hipArraySurfaceLoadStore 0x02
206 #define hipArrayCubemap 0x04
207 #define hipArrayTextureGather 0x08
209 #define hipOccupancyDefault 0x00
211 #define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
212 #define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
214 #define hipCpuDeviceId ((int)-1)
215 #define hipInvalidDeviceId ((int)-2)
218 #define hipExtAnyOrderLaunch 0x01
221 #define hipStreamWaitValueGte 0x0
222 #define hipStreamWaitValueEq 0x1
223 #define hipStreamWaitValueAnd 0x2
224 #define hipStreamWaitValueNor 0x3
263 typedef enum hipJitOption {
264 hipJitOptionMaxRegisters = 0,
265 hipJitOptionThreadsPerBlock,
266 hipJitOptionWallTime,
267 hipJitOptionInfoLogBuffer,
268 hipJitOptionInfoLogBufferSizeBytes,
269 hipJitOptionErrorLogBuffer,
270 hipJitOptionErrorLogBufferSizeBytes,
271 hipJitOptionOptimizationLevel,
272 hipJitOptionTargetFromContext,
274 hipJitOptionFallbackStrategy,
275 hipJitOptionGenerateDebugInfo,
276 hipJitOptionLogVerbose,
277 hipJitOptionGenerateLineInfo,
278 hipJitOptionCacheMode,
280 hipJitOptionFastCompile,
281 hipJitOptionNumOptions
288 hipFuncAttributeMaxDynamicSharedMemorySize = 8,
289 hipFuncAttributePreferredSharedMemoryCarveout = 9,
323 constexpr
__host__ __device__
dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) :
x(_x),
y(_y),
z(_z){};
337 typedef enum hipExternalMemoryHandleType_enum {
338 hipExternalMemoryHandleTypeOpaqueFd = 1,
339 hipExternalMemoryHandleTypeOpaqueWin32 = 2,
340 hipExternalMemoryHandleTypeOpaqueWin32Kmt = 3,
341 hipExternalMemoryHandleTypeD3D12Heap = 4,
342 hipExternalMemoryHandleTypeD3D12Resource = 5,
343 hipExternalMemoryHandleTypeD3D11Resource = 6,
344 hipExternalMemoryHandleTypeD3D11ResourceKmt = 7,
345 } hipExternalMemoryHandleType;
348 hipExternalMemoryHandleType type;
356 unsigned long long size;
361 unsigned long long offset;
362 unsigned long long size;
366 typedef void* hipExternalMemory_t;
368 #if __HIP_HAS_GET_PCH
374 void __hipGetPCH(
const char** pch,
unsigned int*size);
495 int srcDevice,
int dstDevice);
1254 unsigned int flags);
1303 uint32_t mask __dparm(0xFFFFFFFF));
1336 uint64_t mask __dparm(0xFFFFFFFFFFFFFFFF));
1458 hipError_t
hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1670 DEPRECATED(
"use hipHostMalloc instead")
1740 hipStream_t stream __dparm(0));
1772 const
void* dev_ptr,
1792 size_t num_attributes,
1793 const
void* dev_ptr,
1809 hipDeviceptr_t* dev_ptr,
1810 size_t length __dparm(0),
1832 hipError_t
hipHostAlloc(
void** ptr,
size_t size,
unsigned int flags);
1949 hipError_t
hipMemAllocPitch(hipDeviceptr_t* dptr,
size_t* pitch,
size_t widthInBytes,
size_t height,
unsigned int elementSizeBytes);
2023 hipError_t
hipMemcpy(
void* dst, const
void* src,
size_t sizeBytes, hipMemcpyKind kind);
2026 hipError_t hipMemcpyWithStream(
void* dst, const
void* src,
size_t sizeBytes,
2027 hipMemcpyKind kind, hipStream_t stream);
2083 hipError_t
hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src,
size_t sizeBytes);
2141 hipStream_t stream);
2143 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr,
size_t* bytes,
2144 hipModule_t hmod, const
char* name);
2146 hipError_t hipGetSymbolAddress(
void** devPtr, const
void* symbol);
2147 hipError_t hipGetSymbolSize(
size_t* size, const
void* symbol);
2148 hipError_t hipMemcpyToSymbol(const
void* symbol, const
void* src,
2149 size_t sizeBytes,
size_t offset __dparm(0),
2150 hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
2151 hipError_t hipMemcpyToSymbolAsync(const
void* symbol, const
void* src,
2152 size_t sizeBytes,
size_t offset,
2153 hipMemcpyKind kind, hipStream_t stream __dparm(0));
2154 hipError_t hipMemcpyFromSymbol(
void* dst, const
void* symbol,
2155 size_t sizeBytes,
size_t offset __dparm(0),
2156 hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
2157 hipError_t hipMemcpyFromSymbolAsync(
void* dst, const
void* symbol,
2158 size_t sizeBytes,
size_t offset,
2160 hipStream_t stream __dparm(0));
2190 hipError_t
hipMemcpyAsync(
void* dst, const
void* src,
size_t sizeBytes, hipMemcpyKind kind,
2191 hipStream_t stream __dparm(0));
2202 hipError_t
hipMemset(
void* dst,
int value,
size_t sizeBytes);
2213 hipError_t
hipMemsetD8(hipDeviceptr_t dest,
unsigned char value,
size_t count);
2230 hipError_t
hipMemsetD8Async(hipDeviceptr_t dest,
unsigned char value,
size_t count, hipStream_t stream __dparm(0));
2241 hipError_t
hipMemsetD16(hipDeviceptr_t dest,
unsigned short value,
size_t count);
2258 hipError_t
hipMemsetD16Async(hipDeviceptr_t dest,
unsigned short value,
size_t count, hipStream_t stream __dparm(0));
2286 hipError_t
hipMemsetAsync(
void* dst,
int value,
size_t sizeBytes, hipStream_t stream __dparm(0));
2304 hipStream_t stream __dparm(0));
2317 hipError_t
hipMemset2D(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height);
2331 hipError_t
hipMemset2DAsync(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height,hipStream_t stream __dparm(0));
2366 hipError_t hipMemPtrGetInfo(
void* ptr,
size_t* size);
2382 size_t height __dparm(0),
unsigned int flags __dparm(
hipArrayDefault));
2385 hipError_t hipArrayDestroy(
hipArray* array);
2423 struct
hipExtent extent,
unsigned int flags);
2440 unsigned int numLevels,
2441 unsigned int flags __dparm(0));
2455 unsigned int level);
2473 hipError_t
hipMemcpy2D(
void* dst,
size_t dpitch, const
void* src,
size_t spitch,
size_t width,
2474 size_t height, hipMemcpyKind kind);
2516 hipError_t
hipMemcpy2DAsync(
void* dst,
size_t dpitch, const
void* src,
size_t spitch,
size_t width,
2517 size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2537 size_t spitch,
size_t width,
size_t height, hipMemcpyKind kind);
2558 size_t spitch,
size_t width,
size_t height, hipMemcpyKind kind,
2559 hipStream_t stream __dparm(0));
2576 DEPRECATED(DEPRECATED_MSG)
2578 size_t count, hipMemcpyKind kind);
2595 DEPRECATED(DEPRECATED_MSG)
2597 size_t count, hipMemcpyKind kind);
2798 #ifndef USE_PEER_NON_UNIFIED
2799 #define USE_PEER_NON_UNIFIED 1
2802 #if USE_PEER_NON_UNIFIED == 1
2814 hipError_t
hipMemcpyPeer(
void* dst,
int dstDeviceId,
const void* src,
int srcDeviceId,
2830 size_t sizeBytes, hipStream_t stream __dparm(0));
2868 DEPRECATED(DEPRECATED_MSG)
2869 hipError_t
hipCtxCreate(hipCtx_t* ctx,
unsigned int flags, hipDevice_t device);
2881 DEPRECATED(DEPRECATED_MSG)
2894 DEPRECATED(DEPRECATED_MSG)
2907 DEPRECATED(DEPRECATED_MSG)
2920 DEPRECATED(DEPRECATED_MSG)
2933 DEPRECATED(DEPRECATED_MSG)
2947 DEPRECATED(DEPRECATED_MSG)
2967 DEPRECATED(DEPRECATED_MSG)
2983 DEPRECATED(DEPRECATED_MSG)
2999 DEPRECATED(DEPRECATED_MSG)
3015 DEPRECATED(DEPRECATED_MSG)
3031 DEPRECATED(DEPRECATED_MSG)
3045 DEPRECATED(DEPRECATED_MSG)
3058 DEPRECATED(DEPRECATED_MSG)
3080 DEPRECATED(DEPRECATED_MSG)
3099 DEPRECATED(DEPRECATED_MSG)
3280 hipJitOption* options,
void** optionValues);
3307 unsigned int gridDimZ,
unsigned int blockDimX,
3308 unsigned int blockDimY,
unsigned int blockDimZ,
3309 unsigned int sharedMemBytes, hipStream_t stream,
3310 void** kernelParams,
void** extra);
3328 void** kernelParams,
unsigned int sharedMemBytes,
3329 hipStream_t stream);
3342 int numDevices,
unsigned int flags);
3357 int numDevices,
unsigned int flags);
3387 hipFunction_t f,
size_t dynSharedMemPerBlk,
3388 int blockSizeLimit);
3404 hipFunction_t f,
size_t dynSharedMemPerBlk,
3405 int blockSizeLimit,
unsigned int flags);
3416 int* numBlocks, hipFunction_t f,
int blockSize,
size_t dynSharedMemPerBlk);
3428 int* numBlocks, hipFunction_t f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags);
3439 int* numBlocks, const
void* f,
int blockSize,
size_t dynSharedMemPerBlk);
3451 int* numBlocks, const
void* f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags __dparm(hipOccupancyDefault));
3465 const
void* f,
size_t dynSharedMemPerBlk,
3466 int blockSizeLimit);
3492 DEPRECATED("use roctracer/rocTX instead")
3501 DEPRECATED("use roctracer/rocTX instead")
3573 size_t sharedMem __dparm(0),
3574 hipStream_t stream __dparm(0));
3592 hipStream_t *stream);
3613 size_t sharedMemBytes __dparm(0),
3614 hipStream_t stream __dparm(0));
3625 hipError_t hipExtLaunchKernel(const
void* function_address,
dim3 numBlocks,
dim3 dimBlocks,
3626 void** args,
size_t sharedMemBytes, hipStream_t stream,
3627 hipEvent_t startEvent, hipEvent_t stopEvent,
int flags);
3649 DEPRECATED(DEPRECATED_MSG)
3650 hipError_t hipBindTexture(
3655 size_t size __dparm(UINT_MAX));
3657 DEPRECATED(DEPRECATED_MSG)
3658 hipError_t hipBindTexture2D(
3667 DEPRECATED(DEPRECATED_MSG)
3668 hipError_t hipBindTextureToArray(
3673 DEPRECATED(DEPRECATED_MSG)
3674 hipError_t hipGetTextureAlignmentOffset(
3678 DEPRECATED(DEPRECATED_MSG)
3686 hipError_t hipBindTextureToMipmappedArray(
3691 hipError_t hipGetTextureReference(
3693 const
void* symbol);
3695 hipError_t hipCreateTextureObject(
3696 hipTextureObject_t* pTexObject,
3701 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3703 hipError_t hipGetChannelDesc(
3707 hipError_t hipGetTextureObjectResourceDesc(
3709 hipTextureObject_t textureObject);
3711 hipError_t hipGetTextureObjectResourceViewDesc(
3713 hipTextureObject_t textureObject);
3715 hipError_t hipGetTextureObjectTextureDesc(
3717 hipTextureObject_t textureObject);
3719 DEPRECATED(DEPRECATED_MSG)
3720 hipError_t hipTexRefGetAddress(
3721 hipDeviceptr_t* dev_ptr,
3724 DEPRECATED(DEPRECATED_MSG)
3725 hipError_t hipTexRefGetAddressMode(
3726 enum hipTextureAddressMode* pam,
3730 DEPRECATED(DEPRECATED_MSG)
3731 hipError_t hipTexRefGetFilterMode(
3732 enum hipTextureFilterMode* pfm,
3735 DEPRECATED(DEPRECATED_MSG)
3736 hipError_t hipTexRefGetFlags(
3737 unsigned int* pFlags,
3740 DEPRECATED(DEPRECATED_MSG)
3741 hipError_t hipTexRefGetFormat(
3742 hipArray_Format* pFormat,
3746 DEPRECATED(DEPRECATED_MSG)
3747 hipError_t hipTexRefGetMaxAnisotropy(
3751 DEPRECATED(DEPRECATED_MSG)
3752 hipError_t hipTexRefGetMipmapFilterMode(
3753 enum hipTextureFilterMode* pfm,
3756 DEPRECATED(DEPRECATED_MSG)
3757 hipError_t hipTexRefGetMipmapLevelBias(
3761 DEPRECATED(DEPRECATED_MSG)
3762 hipError_t hipTexRefGetMipmapLevelClamp(
3763 float* pminMipmapLevelClamp,
3764 float* pmaxMipmapLevelClamp,
3767 DEPRECATED(DEPRECATED_MSG)
3768 hipError_t hipTexRefGetMipMappedArray(
3772 DEPRECATED(DEPRECATED_MSG)
3773 hipError_t hipTexRefSetAddress(
3776 hipDeviceptr_t dptr,
3779 DEPRECATED(DEPRECATED_MSG)
3780 hipError_t hipTexRefSetAddress2D(
3783 hipDeviceptr_t dptr,
3786 hipError_t hipTexRefSetAddressMode(
3789 enum hipTextureAddressMode am);
3791 hipError_t hipTexRefSetArray(
3794 unsigned int flags);
3796 hipError_t hipTexRefSetFilterMode(
3798 enum hipTextureFilterMode fm);
3800 hipError_t hipTexRefSetFlags(
3802 unsigned int Flags);
3804 hipError_t hipTexRefSetFormat(
3806 hipArray_Format fmt,
3807 int NumPackedComponents);
3809 DEPRECATED(DEPRECATED_MSG)
3810 hipError_t hipTexRefSetMaxAnisotropy(
3812 unsigned int maxAniso);
3814 hipError_t hipTexObjectCreate(
3815 hipTextureObject_t* pTexObject,
3820 hipError_t hipTexObjectDestroy(
3821 hipTextureObject_t texObject);
3823 hipError_t hipTexObjectGetResourceDesc(
3825 hipTextureObject_t texObject);
3827 hipError_t hipTexObjectGetResourceViewDesc(
3829 hipTextureObject_t texObject);
3831 hipError_t hipTexObjectGetTextureDesc(
3833 hipTextureObject_t texObject);
3841 DEPRECATED(DEPRECATED_MSG)
3842 hipError_t hipTexRefSetBorderColor(
3844 float* pBorderColor);
3846 hipError_t hipTexRefSetMipmapFilterMode(
3848 enum hipTextureFilterMode fm);
3850 hipError_t hipTexRefSetMipmapLevelBias(
3854 hipError_t hipTexRefSetMipmapLevelClamp(
3856 float minMipMapLevelClamp,
3857 float maxMipMapLevelClamp);
3859 hipError_t hipTexRefSetMipmappedArray(
3862 unsigned int Flags);
3864 hipError_t hipMipmappedArrayCreate(
3867 unsigned int numMipmapLevels);
3869 hipError_t hipMipmappedArrayDestroy(
3872 hipError_t hipMipmappedArrayGetLevel(
3875 unsigned int level);
3881 hipError_t hipRemoveApiCallback(uint32_t
id);
3882 hipError_t hipRegisterActivityCallback(uint32_t
id,
void* fun,
void* arg);
3883 hipError_t hipRemoveActivityCallback(uint32_t
id);
3884 const
char* hipApiName(uint32_t
id);
3885 const
char* hipKernelNameRef(const hipFunction_t f);
3886 const
char* hipKernelNameRefByPtr(const
void* hostFunction, hipStream_t stream);
3887 int hipGetStreamDeviceId(hipStream_t stream);
3894 typedef hipGraph* hipGraph_t;
3900 typedef hipGraphNode* hipGraphNode_t;
3906 typedef hipGraphExec* hipGraphExec_t;
3907 typedef enum hipGraphNodeType {
3908 hipGraphNodeTypeKernel = 1,
3909 hipGraphNodeTypeMemcpy = 2,
3910 hipGraphNodeTypeMemset = 3,
3911 hipGraphNodeTypeHost = 4,
3912 hipGraphNodeTypeGraph = 5,
3913 hipGraphNodeTypeEmpty = 6,
3914 hipGraphNodeTypeWaitEvent = 7,
3915 hipGraphNodeTypeEventRecord = 8,
3916 hipGraphNodeTypeMemcpy1D = 9,
3917 hipGraphNodeTypeMemcpyFromSymbol = 10,
3918 hipGraphNodeTypeMemcpyToSymbol = 11,
3919 hipGraphNodeTypeCount
3922 typedef void (*hipHostFn_t)(
void* userData);
3923 typedef struct hipHostNodeParams {
3926 } hipHostNodeParams;
3928 typedef struct hipKernelNodeParams {
3933 void** kernelParams;
3934 unsigned int sharedMemBytes;
3935 } hipKernelNodeParams;
3937 typedef struct hipMemsetParams {
3939 unsigned int elementSize;
3946 enum hipGraphExecUpdateResult {
3947 hipGraphExecUpdateSuccess = 0x0,
3948 hipGraphExecUpdateError = 0x1,
3949 hipGraphExecUpdateErrorTopologyChanged = 0x2,
3951 hipGraphExecUpdateErrorNodeTypeChanged = 0x3,
3952 hipGraphExecUpdateErrorFunctionChanged =
3954 hipGraphExecUpdateErrorParametersChanged =
3956 hipGraphExecUpdateErrorNotSupported =
3958 hipGraphExecUpdateErrorUnsupportedFunctionChange = 0x7
3961 enum hipStreamCaptureMode {
3962 hipStreamCaptureModeGlobal = 0,
3963 hipStreamCaptureModeThreadLocal,
3964 hipStreamCaptureModeRelaxed
3967 enum hipStreamCaptureStatus {
3968 hipStreamCaptureStatusNone = 0,
3969 hipStreamCaptureStatusActive,
3970 hipStreamCaptureStatusInvalidated
3974 hipError_t hipStreamBeginCapture(hipStream_t stream, hipStreamCaptureMode mode);
3976 hipError_t hipStreamEndCapture(hipStream_t stream, hipGraph_t* pGraph);
3979 hipError_t hipGraphCreate(hipGraph_t* pGraph,
unsigned int flags);
3982 hipError_t hipGraphDestroy(hipGraph_t graph);
3985 hipError_t hipGraphExecDestroy(hipGraphExec_t pGraphExec);
3988 hipError_t hipGraphInstantiate(hipGraphExec_t* pGraphExec, hipGraph_t graph,
3989 hipGraphNode_t* pErrorNode,
char* pLogBuffer,
size_t bufferSize);
3992 hipError_t hipGraphLaunch(hipGraphExec_t graphExec, hipStream_t stream);
3995 hipError_t hipGraphAddKernelNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
3996 const hipGraphNode_t* pDependencies,
size_t numDependencies,
3997 const hipKernelNodeParams* pNodeParams);
4000 hipError_t hipGraphAddMemcpyNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
4001 const hipGraphNode_t* pDependencies,
size_t numDependencies,
4005 hipError_t hipGraphAddMemsetNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
4006 const hipGraphNode_t* pDependencies,
size_t numDependencies,
4007 const hipMemsetParams* pMemsetParams);
4019 #include <hip/amd_detail/hip_prof_str.h>
4024 #if defined(__clang__) && defined(__HIP__)
4025 template <
typename T>
4027 T f,
size_t dynSharedMemPerBlk = 0,
int blockSizeLimit = 0) {
4031 template <
typename T>
4032 static hipError_t
__host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(
int* gridSize,
int* blockSize,
4033 T f,
size_t dynSharedMemPerBlk = 0,
int blockSizeLimit = 0,
unsigned int flags = 0 ) {
4036 #endif // defined(__clang__) && defined(__HIP__)
4038 template <
typename T>
4039 hipError_t hipGetSymbolAddress(
void** devPtr,
const T &symbol) {
4040 return ::hipGetSymbolAddress(devPtr, (
const void *)&symbol);
4043 template <
typename T>
4044 hipError_t hipGetSymbolSize(
size_t* size,
const T &symbol) {
4045 return ::hipGetSymbolSize(size, (
const void *)&symbol);
4048 template <
typename T>
4049 hipError_t hipMemcpyToSymbol(
const T& symbol,
const void* src,
size_t sizeBytes,
4050 size_t offset __dparm(0),
4051 hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
4052 return ::hipMemcpyToSymbol((
const void*)&symbol, src, sizeBytes, offset, kind);
4055 template <
typename T>
4056 hipError_t hipMemcpyToSymbolAsync(
const T& symbol,
const void* src,
size_t sizeBytes,
size_t offset,
4057 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
4058 return ::hipMemcpyToSymbolAsync((
const void*)&symbol, src, sizeBytes, offset, kind, stream);
4061 template <
typename T>
4062 hipError_t hipMemcpyFromSymbol(
void* dst,
const T &symbol,
4063 size_t sizeBytes,
size_t offset __dparm(0),
4064 hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
4065 return ::hipMemcpyFromSymbol(dst, (
const void*)&symbol, sizeBytes, offset, kind);
4068 template <
typename T>
4069 hipError_t hipMemcpyFromSymbolAsync(
void* dst,
const T& symbol,
size_t sizeBytes,
size_t offset,
4070 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
4071 return ::hipMemcpyFromSymbolAsync(dst, (
const void*)&symbol, sizeBytes, offset, kind, stream);
4076 int* numBlocks, T f,
int blockSize,
size_t dynSharedMemPerBlk) {
4078 numBlocks,
reinterpret_cast<const void*
>(f), blockSize, dynSharedMemPerBlk);
4083 int* numBlocks, T f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags) {
4085 numBlocks,
reinterpret_cast<const void*
>(f), blockSize, dynSharedMemPerBlk, flags);
4088 template <
typename F>
4090 F kernel,
size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
4096 void** kernelParams,
unsigned int sharedMemBytes, hipStream_t stream) {
4098 blockDim, kernelParams, sharedMemBytes, stream);
4103 unsigned int numDevices,
unsigned int flags = 0) {
4109 unsigned int numDevices,
unsigned int flags = 0) {
4117 template <
class T,
int dim, enum hipTextureReadMode readMode>
4118 DEPRECATED(DEPRECATED_MSG)
4119 static inline hipError_t hipBindTexture(
size_t* offset,
const struct texture<T, dim, readMode>& tex,
4120 const void* devPtr,
size_t size = UINT_MAX) {
4121 return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
4124 template <
class T,
int dim, enum hipTextureReadMode readMode>
4125 DEPRECATED(DEPRECATED_MSG)
4126 static inline hipError_t
4127 hipBindTexture(
size_t* offset,
const struct texture<T, dim, readMode>& tex,
const void* devPtr,
4129 return hipBindTexture(offset, &tex, devPtr, &desc, size);
4132 template<
class T,
int dim, enum hipTextureReadMode readMode>
4133 DEPRECATED(DEPRECATED_MSG)
4134 static inline hipError_t hipBindTexture2D(
4136 const struct texture<T, dim, readMode> &tex,
4142 return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
4145 template<
class T,
int dim, enum hipTextureReadMode readMode>
4146 DEPRECATED(DEPRECATED_MSG)
4147 static inline hipError_t hipBindTexture2D(
4149 const struct texture<T, dim, readMode> &tex,
4156 return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
4159 template<
class T,
int dim, enum hipTextureReadMode readMode>
4160 DEPRECATED(DEPRECATED_MSG)
4161 static inline hipError_t hipBindTextureToArray(
4162 const struct texture<T, dim, readMode> &tex,
4166 hipError_t err = hipGetChannelDesc(&desc, array);
4167 return (err ==
hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
4170 template<
class T,
int dim, enum hipTextureReadMode readMode>
4171 DEPRECATED(DEPRECATED_MSG)
4172 static inline hipError_t hipBindTextureToArray(
4173 const struct texture<T, dim, readMode> &tex,
4177 return hipBindTextureToArray(&tex, array, &desc);
4180 template<
class T,
int dim, enum hipTextureReadMode readMode>
4181 static inline hipError_t hipBindTextureToMipmappedArray(
4182 const struct texture<T, dim, readMode> &tex,
4191 err = hipGetChannelDesc(&desc, levelArray);
4192 return (err ==
hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
4195 template<
class T,
int dim, enum hipTextureReadMode readMode>
4196 static inline hipError_t hipBindTextureToMipmappedArray(
4197 const struct texture<T, dim, readMode> &tex,
4201 return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
4204 template<
class T,
int dim, enum hipTextureReadMode readMode>
4205 DEPRECATED(DEPRECATED_MSG)
4206 static inline hipError_t hipUnbindTexture(
4207 const struct texture<T, dim, readMode> &tex)
4209 return hipUnbindTexture(&tex);
4217 #endif // __cplusplus
4220 #pragma GCC visibility pop
4228 #endif // HIP_INCLUDE_HIP_AMD_DETAIL_HIP_RUNTIME_API_H
Definition: hip_runtime_api.h:109
Definition: hip_runtime_api.h:360
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent, hipStream_t stream __dparm(0))
Fills asynchronously the memory area pointed to by pitchedDevPtr with the constant value.
@ hipMemAdviseUnsetAccessedBy
Definition: hip_runtime_api.h:240
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
hipError_t hipIpcOpenMemHandle(void **devPtr, hipIpcMemHandle_t handle, unsigned int flags)
Opens an interprocess memory handle exported from another process and returns a device pointer usable...
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
hipError_t hipSetDevice(int deviceId)
Set default device to be used for subsequent hip API calls from this thread.
hipError_t hipDeviceGetP2PAttribute(int *value, hipDeviceP2PAttr attr, int srcDevice, int dstDevice)
Returns a value for attr of link between two devices.
hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant short value v...
hipError_t hipMemcpy2DFromArrayAsync(void *dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipError_t hipDestroyExternalMemory(hipExternalMemory_t extMem)
Destroys an external memory object.
const char * hipGetErrorString(hipError_t hipError)
Return handy text string message to explain the error which occurred.
hipError_t hipMemRangeGetAttributes(void **data, size_t *data_sizes, hipMemRangeAttribute *attributes, size_t num_attributes, const void *dev_ptr, size_t count)
Query attributes of a given memory range in AMD HMM.
hipError_t hipGetDeviceFlags(unsigned int *flags)
Gets the flags set for current device.
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
hipError_t hipMalloc3DArray(hipArray **array, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int flags)
Allocate an array on the device.
hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop)
Device which matches hipDeviceProp_t is returned.
hipError_t hipMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device.
hipError_t hipLaunchKernel(const void *function_address, dim3 numBlocks, dim3 dimBlocks, void **args, size_t sharedMemBytes __dparm(0), hipStream_t stream __dparm(0))
C compliant kernel launch API.
hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count)
Fills the memory area pointed to by dest with the constant integer value for specified number of time...
hipError_t hipStreamWriteValue64(hipStream_t stream, void *ptr, int64_t value, unsigned int flags)
Enqueues a write command to the stream.
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priority.
Definition: hip_runtime_api.h:101
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
@ hipMemAdviseUnsetReadMostly
Undo the effect of hipMemAdviseSetReadMostly.
Definition: hip_runtime_api.h:234
hipFuncCache_t
Definition: hip_runtime_api.h:296
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault))
Returns occupancy for a device function.
hipError_t hipModuleGetTexRef(textureReference **texRef, hipModule_t hmod, const char *name)
returns the handle of the texture reference with the name from the module.
hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms *p, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipError_t hipDeviceGetPCIBusId(char *pciBusId, int len, int device)
Returns a PCI Bus Id string for the device, overloaded to take int device ID.
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
unsigned long long hipSurfaceObject_t
Definition: hip_surface_types.h:36
hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags)
Make the specified compute stream wait for an event.
@ hipFuncCachePreferEqual
prefer equal size L1 cache and shared memory
Definition: hip_runtime_api.h:300
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
hipError_t hipMallocArray(hipArray **array, const hipChannelFormatDesc *desc, size_t width, size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault))
Allocate an array on the device.
hipError_t hipCtxSetCurrent(hipCtx_t ctx)
Set the passed context as current/default.
hipError_t hipMemcpyToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t count, hipMemcpyKind kind)
Copies data between host and device.
Definition: driver_types.h:406
hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Device asynchronously.
hipError_t hipMemcpy2DFromArray(void *dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int *gridSize, int *blockSize, hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit, unsigned int flags)
determine the grid and block sizes to achieves maximum occupancy for a kernel
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
uint32_t y
y
Definition: hip_runtime_api.h:320
hipError_t hipMemRangeGetAttribute(void *data, size_t data_size, hipMemRangeAttribute attribute, const void *dev_ptr, size_t count)
Query an attribute of a given memory range in AMD HMM.
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D *pCopy, hipStream_t stream __dparm(0))
Copies memory for 2D arrays.
hipError_t hipMemAdvise(const void *dev_ptr, size_t count, hipMemoryAdvise advice, int device)
Advise about the usage of a given memory range to AMD HMM.
hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags)
Enable direct access from current device's virtual address space to memory allocations physically loc...
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipError_t hipExternalMemoryGetMappedBuffer(void **devPtr, hipExternalMemory_t extMem, const hipExternalMemoryBufferDesc *bufferDesc)
Maps a buffer onto an imported memory object.
hipError_t hipStreamWaitValue32(hipStream_t stream, void *ptr, int32_t value, unsigned int flags, uint32_t mask __dparm(0xFFFFFFFF))
Enqueues a wait command to the stream.
hipError_t hipMallocMipmappedArray(hipMipmappedArray_t *mipmappedArray, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int numLevels, unsigned int flags __dparm(0))
Allocate a mipmapped array on the device.
hipError_t hipCtxPushCurrent(hipCtx_t ctx)
Push the context to be set as current/ default context.
hipSharedMemConfig
Definition: hip_runtime_api.h:306
hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D *pCopy)
Copies data between host and device.
uint32_t x
x
Definition: hip_runtime_api.h:319
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:1236
hipMemoryAdvise
Definition: hip_runtime_api.h:231
Definition: driver_types.h:98
hipError_t hipGetMipmappedArrayLevel(hipArray_t *levelArray, hipMipmappedArray_const_t mipmappedArray, unsigned int level)
Gets a mipmap level of a HIP mipmapped array.
hipError_t hipModuleOccupancyMaxPotentialBlockSize(int *gridSize, int *blockSize, hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit)
determine the grid and block sizes to achieves maximum occupancy for a kernel
hipError_t __hipPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Push configuration of a kernel launch.
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams *launchParamsList, int numDevices, unsigned int flags)
Launches kernels on multiple devices where thread blocks can cooperate and synchronize as they execut...
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
hipSuccess
Successful completion.
Definition: hip_runtime_api.h:204
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipError_t hipExtStreamCreateWithCUMask(hipStream_t *stream, uint32_t cuMaskSize, const uint32_t *cuMask)
Create an asynchronous stream with the specified CU mask.
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
Defines the different newt vector types for HIP runtime.
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
hipError_t hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
#define __host__
Definition: host_defines.h:59
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
Definition: driver_types.h:395
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
hipError_t hipCtxGetFlags(unsigned int *flags)
Return flags used for creating default context.
hipError_t hipMemcpy2DToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes)
Definition: hip_runtime_api.h:84
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:947
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:941
Defines surface types for HIP runtime.
hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count, hipStream_t stream __dparm(0))
Fills the memory area pointed to by dev with the constant integer value for specified number of times...
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Configure a kernel launch.
hipError_t hipLaunchCooperativeKernel(const void *f, dim3 gridDim, dim3 blockDimX, void **kernelParams, unsigned int sharedMemBytes, hipStream_t stream)
launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelp...
hipError_t hipEventQuery(hipEvent_t event)
Query event status.
hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams *launchParamsList, int numDevices, unsigned int flags)
Launches kernels on multiple devices and guarantees all specified kernels are dispatched on respectiv...
hipError_t hipStreamGetPriority(hipStream_t stream, int *priority)
Query the priority of a stream.
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion)
Returns the approximate HIP api version.
@ hipSharedMemBankSizeFourByte
Definition: hip_runtime_api.h:308
hipError_t hipEventSynchronize(hipEvent_t event)
Wait for an event to complete.
@ hipFuncCachePreferNone
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:297
hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device)
Create a context and set it as current/ default context.
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant short value v...
Definition: driver_types.h:122
@ hipMemRangeAttributeAccessedBy
Definition: hip_runtime_api.h:253
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
void ** args
Arguments.
Definition: hip_runtime_api.h:331
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
Definition: hip_runtime_api.h:97
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
hipError_t hipGetLastError(void)
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess...
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
Definition: driver_types.h:177
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
hipError_t hipCtxPopCurrent(hipCtx_t *ctx)
Pop the current/default context and return the popped context.
Definition: driver_types.h:84
hipError_t hipHostGetDevicePointer(void **devPtr, void *hstPtr, unsigned int flags)
Get Device pointer from Host Pointer allocated through hipHostMalloc.
hipError_t hipMemGetInfo(size_t *free, size_t *total)
Query memory info. Return snapshot of free memory, and total allocatable memory on the device.
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
hipError_t hipDeviceReset(void)
The state of current device is discarded and updated to a fresh state.
hipError_t hipSetDeviceFlags(unsigned flags)
The current device behavior is changed according the flags passed.
hipError_t hipCtxGetCurrent(hipCtx_t *ctx)
Get the handle of the current/ default context.
hipError_t hipFuncGetAttributes(struct hipFuncAttributes *attr, const void *func)
Find out attributes for a given function.
Definition: driver_types.h:75
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
Definition: hip_runtime_api.h:318
hipError_t hipStreamQuery(hipStream_t stream)
Return hipSuccess if all of the operations in the specified stream have completed,...
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32_t *cuMask)
Get CU mask associated with an asynchronous stream.
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
hipError_t hipStreamAttachMemAsync(hipStream_t stream, hipDeviceptr_t *dev_ptr, size_t length __dparm(0), unsigned int flags __dparm(hipMemAttachSingle))
Attach memory to a stream asynchronously in AMD HMM.
hipError_t hipMemcpy2DToArrayAsync(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device.
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
Definition: hip_runtime_api.h:169
hipError_t hipFree(void *ptr)
Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSy...
void * func
Device function symbol.
Definition: hip_runtime_api.h:328
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:203
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
hipError_t hipCtxSynchronize(void)
Blocks until the default context has completed all preceding requested tasks.
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_runtime_api.h:1030
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void *userData, unsigned int flags)
Adds a callback to be called on the host after all currently enqueued items in the stream have comple...
hipStream_t stream
Stream identifier.
Definition: hip_runtime_api.h:333
hipError_t hipMemcpyDtoHAsync(void *dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Host asynchronously.
@ hipMemRangeAttributeReadMostly
Definition: hip_runtime_api.h:250
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:255
hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D *pCopy, hipStream_t stream)
Copies data between host and device asynchronously.
hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
Record an event in the specified stream.
Definition: hip_runtime_api.h:347
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:329
hipError_t hipMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
Definition: driver_types.h:382
Definition: driver_types.h:375
@ hipMemAdviseSetReadMostly
Definition: hip_runtime_api.h:232
@ hipSharedMemBankSizeDefault
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:307
hipError_t hipMemset2D(void *dst, size_t pitch, int value, size_t width, size_t height)
Fills the memory area pointed to by dst with the constant value.
hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent)
Fills synchronously the memory area pointed to by pitchedDevPtr with the constant value.
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
hipError_t hipMemcpyFromArray(void *dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset, size_t count, hipMemcpyKind kind)
Copies data between host and device.
hipError_t hipMemcpyPeerAsync(void *dst, int dstDeviceId, const void *src, int srcDevice, size_t sizeBytes, hipStream_t stream __dparm(0))
Copies memory from one device to memory on another device.
hipError_t hipDrvMemcpy2DUnaligned(const hip_Memcpy2D *pCopy)
hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void *src, size_t sizeBytes, hipStream_t stream)
Copy data from Host to Device asynchronously.
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
hipError_t hipMemcpyPeer(void *dst, int dstDeviceId, const void *src, int srcDeviceId, size_t sizeBytes)
Copies memory from one device to memory on another device.
hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned int numOptions, hipJitOption *options, void **optionValues)
builds module from code object which resides in host memory. Image is pointer to that location....
hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray)
Frees a mipmapped array on the device.
hipError_t hipRegisterApiCallback(uint32_t id, void *fun, void *arg)
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
hipError_t hipStreamWaitValue64(hipStream_t stream, void *ptr, int64_t value, unsigned int flags, uint64_t mask __dparm(0xFFFFFFFFFFFFFFFF))
Enqueues a wait command to the stream.
hipError_t hipFreeArray(hipArray *array)
Frees an array on the device.
hipError_t hipMallocManaged(void **dev_ptr, size_t size, unsigned int flags __dparm(hipMemAttachGlobal))
Allocates memory that will be automatically managed by AMD HMM.
Definition: texture_types.h:74
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer's memory.
hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname)
Function with kname will be extracted if present in module.
@ hipMemAdviseUnsetPreferredLocation
Clear the preferred location for the data.
Definition: hip_runtime_api.h:237
hipError_t hipMemPrefetchAsync(const void *dev_ptr, size_t count, int device, hipStream_t stream __dparm(0))
Prefetches memory to the specified destination device using AMD HMM.
hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx)
Disable direct access from current context's virtual address space to memory allocations physically l...
@ hipMemAdviseSetPreferredLocation
Definition: hip_runtime_api.h:235
Definition: driver_types.h:299
Definition: texture_types.h:95
Definition: driver_types.h:334
uint32_t z
z
Definition: hip_runtime_api.h:321
hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config)
Set Shared memory bank configuration.
hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipError_t hipMemset2DAsync(void *dst, size_t pitch, int value, size_t width, size_t height, hipStream_t stream __dparm(0))
Fills asynchronously the memory area pointed to by dst with the constant value.
Definition: driver_types.h:68
hipError_t hipCtxGetDevice(hipDevice_t *device)
Get the handle of the device associated with current/default context.
dim3 blockDim
Block dimentions.
Definition: hip_runtime_api.h:330
#define hipMemAttachGlobal
Memory can be accessed by any stream on any device.
Definition: hip_runtime_api.h:172
Definition: hip_runtime_api.h:327
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:298
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:252
hipFuncAttribute
Definition: hip_runtime_api.h:287
hipError_t hipStreamWriteValue32(hipStream_t stream, void *ptr, int32_t value, unsigned int flags)
Enqueues a write command to the stream.
@ hipSharedMemBankSizeEightByte
Definition: hip_runtime_api.h:310
hipDeviceAttribute_t
Definition: hip_runtime_api.h:321
hipError_t hipFuncSetSharedMemConfig(const void *func, hipSharedMemConfig config)
Set shared memory configuation for a specific function.
hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t *linktype, uint32_t *hopcount)
Returns the link type and hop count between two devices.
Definition: driver_types.h:273
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
size_t sharedMem
Shared memory.
Definition: hip_runtime_api.h:332
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, hipStream_t stream, void **kernelParams, void **extra)
launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelp...
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current device.
hipError_t hipMemcpyAsync(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copy data from src to dst asynchronously.
hipError_t hipOccupancyMaxPotentialBlockSize(int *gridSize, int *blockSize, const void *f, size_t dynSharedMemPerBlk, int blockSizeLimit)
determine the grid and block sizes to achieves maximum occupancy for a kernel
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
Register host memory so it can be accessed from the current device.
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
hipError_t hipEventCreate(hipEvent_t *event)
Definition: driver_types.h:349
hipError_t hipMemsetAsync(void *dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value val...
hipError_t hipModuleLoadData(hipModule_t *module, const void *image)
builds module from code object which resides in host memory. Image is pointer to that location.
@ hipFuncCachePreferL1
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:299
#define hipMemAttachSingle
the associated device
Definition: hip_runtime_api.h:174
hipError_t hipMemcpyParam2D(const hip_Memcpy2D *pCopy)
Copies memory for 2D arrays.
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory [Deprecated].
Definition: hip_runtime_api.h:953
hipError_t hipMemset(void *dst, int value, size_t sizeBytes)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipError_t hipDeviceDisablePeerAccess(int peerDeviceId)
Disable direct access from current device's virtual address space to memory allocations physically lo...
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
hipError_t hipFuncSetAttribute(const void *func, hipFuncAttribute attr, int value)
Set attribute for a specific function.
hipError_t __hipPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, hipStream_t *stream)
Pop configuration of a kernel launch.
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
@ hipMemAdviseSetAccessedBy
Definition: hip_runtime_api.h:238
hipMemRangeAttribute
Definition: hip_runtime_api.h:249
hipError_t hipImportExternalMemory(hipExternalMemory_t *extMem_out, const hipExternalMemoryHandleDesc *memHandleDesc)
Imports an external memory object.