HIP: Heterogenous-computing Interface for Portability
|
Go to the documentation of this file.
24 #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_RUNTIME_API_H
25 #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_RUNTIME_API_H
34 #ifndef GENERIC_GRID_LAUNCH
35 #define GENERIC_GRID_LAUNCH 1
38 #ifndef __HIP_ROCclr__
39 #define __HIP_ROCclr__ 0
43 #include <hip/hcc_detail/driver_types.h>
47 #if !__HIP_ROCclr__ && defined(__cplusplus)
49 #include <hip/hcc_detail/program_state.hpp>
53 #define DEPRECATED(msg) __declspec(deprecated(msg))
54 #else // !defined(_MSC_VER)
55 #define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
56 #endif // !defined(_MSC_VER)
58 #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"
60 #if defined(__HCC__) && (__hcc_workweek__ < 16155)
61 #error("This version of HIP requires a newer version of HCC.");
64 #define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
65 #define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
66 #define HIP_LAUNCH_PARAM_END ((void*)0x03)
76 #pragma GCC visibility push (default)
82 hipError_t hip_init();
93 typedef struct ihipCtx_t* hipCtx_t;
96 typedef int hipDevice_t;
98 typedef enum hipDeviceP2PAttr {
99 hipDevP2PAttrPerformanceRank = 0,
100 hipDevP2PAttrAccessSupported,
101 hipDevP2PAttrNativeAtomicSupported,
102 hipDevP2PAttrHipArrayAccessSupported
105 typedef struct ihipStream_t* hipStream_t;
107 #define hipIpcMemLazyEnablePeerAccess 0
109 #define HIP_IPC_HANDLE_SIZE 64
112 char reserved[HIP_IPC_HANDLE_SIZE];
117 struct ihipIpcEventHandle_t;
121 char reserved[HIP_IPC_HANDLE_SIZE];
124 typedef struct ihipModule_t* hipModule_t;
126 typedef struct ihipModuleSymbol_t* hipFunction_t;
131 size_t constSizeBytes;
132 size_t localSizeBytes;
133 int maxDynamicSharedSizeBytes;
134 int maxThreadsPerBlock;
136 int preferredShmemCarveout;
138 size_t sharedSizeBytes;
141 typedef struct ihipEvent_t* hipEvent_t;
144 hipLimitMallocHeapSize = 0x02,
151 #define hipStreamDefault \
154 #define hipStreamNonBlocking 0x01
158 #define hipEventDefault 0x0
159 #define hipEventBlockingSync \
161 #define hipEventDisableTiming \
163 #define hipEventInterprocess 0x4
164 #define hipEventReleaseToDevice \
166 #define hipEventReleaseToSystem \
175 #define hipHostMallocDefault 0x0
176 #define hipHostMallocPortable 0x1
177 #define hipHostMallocMapped \
179 #define hipHostMallocWriteCombined 0x4
181 #define hipHostMallocNumaUser \
184 #define hipHostMallocCoherent \
186 #define hipHostMallocNonCoherent \
191 #define hipMemAttachGlobal 0x01
192 #define hipMemAttachHost 0x02
193 #define hipMemAttachSingle 0x04
196 #define hipDeviceMallocDefault 0x0
197 #define hipDeviceMallocFinegrained 0x1
199 #define hipHostRegisterDefault 0x0
201 #define hipHostRegisterPortable 0x1
202 #define hipHostRegisterMapped \
204 #define hipHostRegisterIoMemory 0x4
206 #define hipExtHostRegisterCoarseGrained 0x8
208 #define hipDeviceScheduleAuto 0x0
209 #define hipDeviceScheduleSpin \
211 #define hipDeviceScheduleYield \
214 #define hipDeviceScheduleBlockingSync 0x4
216 #define hipDeviceScheduleMask 0x7
218 #define hipDeviceMapHost 0x8
219 #define hipDeviceLmemResizeToMax 0x16
221 #define hipArrayDefault 0x00
222 #define hipArrayLayered 0x01
223 #define hipArraySurfaceLoadStore 0x02
224 #define hipArrayCubemap 0x04
225 #define hipArrayTextureGather 0x08
227 #define hipOccupancyDefault 0x00
229 #define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
230 #define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
232 #define hipCpuDeviceId ((int)-1)
233 #define hipInvalidDeviceId ((int)-2)
236 #define hipExtAnyOrderLaunch 0x01
275 typedef enum hipJitOption {
276 hipJitOptionMaxRegisters = 0,
277 hipJitOptionThreadsPerBlock,
278 hipJitOptionWallTime,
279 hipJitOptionInfoLogBuffer,
280 hipJitOptionInfoLogBufferSizeBytes,
281 hipJitOptionErrorLogBuffer,
282 hipJitOptionErrorLogBufferSizeBytes,
283 hipJitOptionOptimizationLevel,
284 hipJitOptionTargetFromContext,
286 hipJitOptionFallbackStrategy,
287 hipJitOptionGenerateDebugInfo,
288 hipJitOptionLogVerbose,
289 hipJitOptionGenerateLineInfo,
290 hipJitOptionCacheMode,
292 hipJitOptionFastCompile,
293 hipJitOptionNumOptions
300 hipFuncAttributeMaxDynamicSharedMemorySize = 8,
301 hipFuncAttributePreferredSharedMemoryCarveout = 9,
335 __host__ __device__
dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) :
x(_x),
y(_y),
z(_z){};
348 #if __HIP_HAS_GET_PCH
354 void __hipGetPCH(
const char** pch,
unsigned int*size);
475 int srcDevice,
int dstDevice);
1234 unsigned int flags);
1319 hipError_t
hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1487 DEPRECATED(
"use hipHostMalloc instead")
1557 hipStream_t stream __dparm(0));
1589 const
void* dev_ptr,
1609 size_t num_attributes,
1610 const
void* dev_ptr,
1626 hipDeviceptr_t* dev_ptr,
1627 size_t length __dparm(0),
1649 hipError_t
hipHostAlloc(
void** ptr,
size_t size,
unsigned int flags);
1766 hipError_t
hipMemAllocPitch(hipDeviceptr_t* dptr,
size_t* pitch,
size_t widthInBytes,
size_t height,
unsigned int elementSizeBytes);
1840 hipError_t
hipMemcpy(
void* dst, const
void* src,
size_t sizeBytes, hipMemcpyKind kind);
1843 hipError_t hipMemcpyWithStream(
void* dst, const
void* src,
size_t sizeBytes,
1844 hipMemcpyKind kind, hipStream_t stream);
1900 hipError_t
hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src,
size_t sizeBytes);
1958 hipStream_t stream);
1962 hipModule_t hmod,
const char* name);
1964 hipError_t hipGetSymbolAddress(
void** devPtr,
const void* symbol);
1965 hipError_t hipGetSymbolSize(
size_t* size,
const void* symbol);
1966 hipError_t hipMemcpyToSymbol(
const void* symbol,
const void* src,
1967 size_t sizeBytes,
size_t offset __dparm(0),
1968 hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1969 hipError_t hipMemcpyToSymbolAsync(
const void* symbol,
const void* src,
1970 size_t sizeBytes,
size_t offset,
1971 hipMemcpyKind kind, hipStream_t stream __dparm(0));
1972 hipError_t hipMemcpyFromSymbol(
void* dst,
const void* symbol,
1973 size_t sizeBytes,
size_t offset __dparm(0),
1974 hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1975 hipError_t hipMemcpyFromSymbolAsync(
void* dst,
const void* symbol,
1976 size_t sizeBytes,
size_t offset,
1978 hipStream_t stream __dparm(0));
1982 #ifdef __cplusplus //Start : Not supported in gcc
1983 namespace hip_impl {
1985 __attribute__((visibility(
"hidden")))
1986 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr,
size_t* bytes,
2002 __attribute__((visibility("hidden")))
2003 hipError_t hipGetSymbolAddress(
void** devPtr, const
void* symbolName) {
2005 hip_impl::hip_init();
2007 return hip_impl::read_agent_global_from_process(devPtr, &size, (
const char*)symbolName);
2022 __attribute__((visibility(
"hidden")))
2023 hipError_t hipGetSymbolSize(
size_t* size, const
void* symbolName) {
2025 hip_impl::hip_init();
2026 void* devPtr =
nullptr;
2027 return hip_impl::read_agent_global_from_process(&devPtr, size, (
const char*)symbolName);
2029 #endif // End : Not supported in gcc
2031 #if defined(__cplusplus)
2036 namespace hip_impl {
2037 hipError_t hipMemcpyToSymbol(
void*,
const void*,
size_t,
size_t, hipMemcpyKind,
2042 #if defined(__cplusplus)
2071 __attribute__((visibility(
"hidden")))
2072 hipError_t hipMemcpyToSymbol(const
void* symbolName, const
void* src,
2073 size_t sizeBytes,
size_t offset __dparm(0),
2074 hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
2075 if (!symbolName)
return hipErrorInvalidSymbol;
2077 hipDeviceptr_t dst = NULL;
2078 hipGetSymbolAddress(&dst, (
const char*)symbolName);
2080 return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
2081 (
const char*)symbolName);
2085 #if defined(__cplusplus)
2090 namespace hip_impl {
2091 hipError_t hipMemcpyToSymbolAsync(
void*,
const void*,
size_t,
size_t,
2092 hipMemcpyKind, hipStream_t,
const char*);
2093 hipError_t hipMemcpyFromSymbol(
void*,
const void*,
size_t,
size_t,
2094 hipMemcpyKind,
const char*);
2095 hipError_t hipMemcpyFromSymbolAsync(
void*,
const void*,
size_t,
size_t,
2096 hipMemcpyKind, hipStream_t,
const char*);
2100 #if defined(__cplusplus)
2130 #ifdef __cplusplus //Start : Not supported in gcc
2132 __attribute__((visibility(
"hidden")))
2133 hipError_t hipMemcpyToSymbolAsync(const
void* symbolName, const
void* src,
2134 size_t sizeBytes,
size_t offset,
2135 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
2136 if (!symbolName)
return hipErrorInvalidSymbol;
2138 hipDeviceptr_t dst = NULL;
2139 hipGetSymbolAddress(&dst, symbolName);
2141 return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
2143 (
const char*)symbolName);
2147 __attribute__((visibility(
"hidden")))
2148 hipError_t hipMemcpyFromSymbol(
void* dst, const
void* symbolName,
2149 size_t sizeBytes,
size_t offset __dparm(0),
2150 hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
2151 if (!symbolName)
return hipErrorInvalidSymbol;
2153 hipDeviceptr_t src = NULL;
2154 hipGetSymbolAddress(&src, symbolName);
2156 return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
2157 (
const char*)symbolName);
2161 __attribute__((visibility(
"hidden")))
2162 hipError_t hipMemcpyFromSymbolAsync(
void* dst, const
void* symbolName,
2163 size_t sizeBytes,
size_t offset,
2165 hipStream_t stream __dparm(0)) {
2166 if (!symbolName)
return hipErrorInvalidSymbol;
2168 hipDeviceptr_t src = NULL;
2169 hipGetSymbolAddress(&src, symbolName);
2171 return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
2173 (
const char*)symbolName);
2175 #endif // End : Not supported in gcc
2177 #endif // __HIP_ROCclr__
2206 hipError_t
hipMemcpyAsync(
void* dst,
const void* src,
size_t sizeBytes, hipMemcpyKind kind,
2207 hipStream_t stream __dparm(0));
2218 hipError_t
hipMemset(
void* dst,
int value,
size_t sizeBytes);
2229 hipError_t
hipMemsetD8(hipDeviceptr_t dest,
unsigned char value,
size_t count);
2246 hipError_t
hipMemsetD8Async(hipDeviceptr_t dest,
unsigned char value,
size_t count, hipStream_t stream __dparm(0));
2257 hipError_t
hipMemsetD16(hipDeviceptr_t dest,
unsigned short value,
size_t count);
2274 hipError_t
hipMemsetD16Async(hipDeviceptr_t dest,
unsigned short value,
size_t count, hipStream_t stream __dparm(0));
2302 hipError_t
hipMemsetAsync(
void* dst,
int value,
size_t sizeBytes, hipStream_t stream __dparm(0));
2320 hipStream_t stream __dparm(0));
2333 hipError_t
hipMemset2D(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height);
2347 hipError_t
hipMemset2DAsync(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height,hipStream_t stream __dparm(0));
2382 hipError_t hipMemPtrGetInfo(
void* ptr,
size_t* size);
2398 size_t height __dparm(0),
unsigned int flags __dparm(
hipArrayDefault));
2437 struct hipExtent extent,
unsigned int flags);
2454 unsigned int numLevels,
2455 unsigned int flags __dparm(0));
2469 unsigned int level);
2487 hipError_t
hipMemcpy2D(
void* dst,
size_t dpitch,
const void* src,
size_t spitch,
size_t width,
2488 size_t height, hipMemcpyKind kind);
2530 hipError_t
hipMemcpy2DAsync(
void* dst,
size_t dpitch,
const void* src,
size_t spitch,
size_t width,
2531 size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2551 size_t spitch,
size_t width,
size_t height, hipMemcpyKind kind);
2568 DEPRECATED(DEPRECATED_MSG)
2570 size_t count, hipMemcpyKind kind);
2587 DEPRECATED(DEPRECATED_MSG)
2589 size_t count, hipMemcpyKind kind);
2790 #ifndef USE_PEER_NON_UNIFIED
2791 #define USE_PEER_NON_UNIFIED 1
2794 #if USE_PEER_NON_UNIFIED == 1
2806 hipError_t
hipMemcpyPeer(
void* dst,
int dstDeviceId,
const void* src,
int srcDeviceId,
2822 size_t sizeBytes, hipStream_t stream __dparm(0));
2860 DEPRECATED(DEPRECATED_MSG)
2861 hipError_t
hipCtxCreate(hipCtx_t* ctx,
unsigned int flags, hipDevice_t device);
2873 DEPRECATED(DEPRECATED_MSG)
2886 DEPRECATED(DEPRECATED_MSG)
2899 DEPRECATED(DEPRECATED_MSG)
2912 DEPRECATED(DEPRECATED_MSG)
2925 DEPRECATED(DEPRECATED_MSG)
2939 DEPRECATED(DEPRECATED_MSG)
2959 DEPRECATED(DEPRECATED_MSG)
2975 DEPRECATED(DEPRECATED_MSG)
2991 DEPRECATED(DEPRECATED_MSG)
3007 DEPRECATED(DEPRECATED_MSG)
3023 DEPRECATED(DEPRECATED_MSG)
3037 DEPRECATED(DEPRECATED_MSG)
3050 DEPRECATED(DEPRECATED_MSG)
3072 DEPRECATED(DEPRECATED_MSG)
3091 DEPRECATED(DEPRECATED_MSG)
3238 #if defined(__cplusplus)
3243 namespace hip_impl {
3244 class agent_globals_impl;
3245 class agent_globals {
3249 agent_globals(
const agent_globals&) =
delete;
3251 hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr,
size_t* bytes,
3252 hipModule_t hmod,
const char* name);
3253 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr,
size_t* bytes,
3256 agent_globals_impl* impl;
3260 __attribute__((visibility(
"hidden")))
3261 agent_globals& get_agent_globals() {
3262 static agent_globals ag;
3268 __attribute__((visibility(
"hidden")))
3269 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr,
size_t* bytes,
3271 return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
3276 #if defined(__cplusplus)
3291 hipModule_t hmod,
const char* name);
3292 #endif // __HIP_ROCclr__
3329 hipJitOption* options,
void** optionValues);
3356 unsigned int gridDimZ,
unsigned int blockDimX,
3357 unsigned int blockDimY,
unsigned int blockDimZ,
3358 unsigned int sharedMemBytes, hipStream_t stream,
3359 void** kernelParams,
void** extra);
3362 #if __HIP_ROCclr__ && !defined(__HCC__)
3378 hipError_t hipLaunchCooperativeKernel(
const void* f,
dim3 gridDim,
dim3 blockDimX,
3379 void** kernelParams,
unsigned int sharedMemBytes,
3380 hipStream_t stream);
3392 hipError_t hipLaunchCooperativeKernelMultiDevice(
hipLaunchParams* launchParamsList,
3393 int numDevices,
unsigned int flags);
3409 int numDevices,
unsigned int flags);
3439 hipFunction_t f,
size_t dynSharedMemPerBlk,
3440 int blockSizeLimit);
3456 hipFunction_t f,
size_t dynSharedMemPerBlk,
3457 int blockSizeLimit,
unsigned int flags);
3468 int* numBlocks, hipFunction_t f,
int blockSize,
size_t dynSharedMemPerBlk);
3480 int* numBlocks, hipFunction_t f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags);
3491 int* numBlocks,
const void* f,
int blockSize,
size_t dynSharedMemPerBlk);
3503 int* numBlocks,
const void* f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags __dparm(hipOccupancyDefault));
3517 const void* f,
size_t dynSharedMemPerBlk,
3518 int blockSizeLimit);
3544 DEPRECATED(
"use roctracer/rocTX instead")
3553 DEPRECATED("use roctracer/rocTX instead")
3625 size_t sharedMem __dparm(0),
3626 hipStream_t stream __dparm(0));
3644 hipStream_t *stream);
3665 size_t sharedMemBytes __dparm(0),
3666 hipStream_t stream __dparm(0));
3668 #if __HIP_ROCclr__ || !defined(__HCC__)
3670 hipError_t hipExtLaunchKernel(
const void* function_address,
dim3 numBlocks,
dim3 dimBlocks,
3671 void** args,
size_t sharedMemBytes, hipStream_t stream,
3672 hipEvent_t startEvent, hipEvent_t stopEvent,
int flags);
3678 DEPRECATED(DEPRECATED_MSG)
3679 hipError_t hipBindTexture(
3684 size_t size __dparm(UINT_MAX));
3686 DEPRECATED(DEPRECATED_MSG)
3687 hipError_t hipBindTexture2D(
3696 DEPRECATED(DEPRECATED_MSG)
3697 hipError_t hipBindTextureToArray(
3702 hipError_t hipBindTextureToMipmappedArray(
3707 DEPRECATED(DEPRECATED_MSG)
3708 hipError_t hipGetTextureAlignmentOffset(
3712 hipError_t hipGetTextureReference(
3714 const void* symbol);
3716 DEPRECATED(DEPRECATED_MSG)
3719 hipError_t hipCreateTextureObject(
3720 hipTextureObject_t* pTexObject,
3725 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3727 hipError_t hipGetChannelDesc(
3731 hipError_t hipGetTextureObjectResourceDesc(
3733 hipTextureObject_t textureObject);
3735 hipError_t hipGetTextureObjectResourceViewDesc(
3737 hipTextureObject_t textureObject);
3739 hipError_t hipGetTextureObjectTextureDesc(
3741 hipTextureObject_t textureObject);
3743 hipError_t hipTexRefGetAddress(
3744 hipDeviceptr_t* dev_ptr,
3747 hipError_t hipTexRefGetAddressMode(
3748 enum hipTextureAddressMode* pam,
3752 hipError_t hipTexRefGetFilterMode(
3753 enum hipTextureFilterMode* pfm,
3756 hipError_t hipTexRefGetFlags(
3757 unsigned int* pFlags,
3760 hipError_t hipTexRefGetFormat(
3761 hipArray_Format* pFormat,
3765 hipError_t hipTexRefGetMaxAnisotropy(
3769 hipError_t hipTexRefGetMipmapFilterMode(
3770 enum hipTextureFilterMode* pfm,
3773 hipError_t hipTexRefGetMipmapLevelBias(
3777 hipError_t hipTexRefGetMipmapLevelClamp(
3778 float* pminMipmapLevelClamp,
3779 float* pmaxMipmapLevelClamp,
3782 hipError_t hipTexRefGetMipMappedArray(
3786 hipError_t hipTexRefSetAddress(
3789 hipDeviceptr_t dptr,
3792 hipError_t hipTexRefSetAddress2D(
3795 hipDeviceptr_t dptr,
3798 hipError_t hipTexRefSetAddressMode(
3801 enum hipTextureAddressMode am);
3803 hipError_t hipTexRefSetArray(
3806 unsigned int flags);
3808 hipError_t hipTexRefSetBorderColor(
3810 float* pBorderColor);
3812 hipError_t hipTexRefSetFilterMode(
3814 enum hipTextureFilterMode fm);
3816 hipError_t hipTexRefSetFlags(
3818 unsigned int Flags);
3820 hipError_t hipTexRefSetFormat(
3822 hipArray_Format fmt,
3823 int NumPackedComponents);
3825 hipError_t hipTexRefSetMaxAnisotropy(
3827 unsigned int maxAniso);
3829 hipError_t hipTexRefSetMipmapFilterMode(
3831 enum hipTextureFilterMode fm);
3833 hipError_t hipTexRefSetMipmapLevelBias(
3837 hipError_t hipTexRefSetMipmapLevelClamp(
3839 float minMipMapLevelClamp,
3840 float maxMipMapLevelClamp);
3842 hipError_t hipTexRefSetMipmappedArray(
3845 unsigned int Flags);
3847 hipError_t hipMipmappedArrayCreate(
3850 unsigned int numMipmapLevels);
3852 hipError_t hipMipmappedArrayDestroy(
3855 hipError_t hipMipmappedArrayGetLevel(
3858 unsigned int level);
3860 hipError_t hipTexObjectCreate(
3861 hipTextureObject_t* pTexObject,
3866 hipError_t hipTexObjectDestroy(
3867 hipTextureObject_t texObject);
3869 hipError_t hipTexObjectGetResourceDesc(
3871 hipTextureObject_t texObject);
3873 hipError_t hipTexObjectGetResourceViewDesc(
3875 hipTextureObject_t texObject);
3877 hipError_t hipTexObjectGetTextureDesc(
3879 hipTextureObject_t texObject);
3891 #if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3892 template <
typename T>
3894 T f,
size_t dynSharedMemPerBlk = 0,
int blockSizeLimit = 0) {
3898 template <
typename T>
3899 static hipError_t
__host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(
int* gridSize,
int* blockSize,
3900 T f,
size_t dynSharedMemPerBlk = 0,
int blockSizeLimit = 0,
unsigned int flags = 0 ) {
3903 #endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3905 #if defined(__cplusplus) && !defined(__HCC__)
3907 template <
typename T>
3908 hipError_t hipGetSymbolAddress(
void** devPtr,
const T &symbol) {
3909 return ::hipGetSymbolAddress(devPtr, (
const void *)&symbol);
3912 template <
typename T>
3913 hipError_t hipGetSymbolSize(
size_t* size,
const T &symbol) {
3914 return ::hipGetSymbolSize(size, (
const void *)&symbol);
3917 template <
typename T>
3918 hipError_t hipMemcpyToSymbol(
const T& symbol,
const void* src,
size_t sizeBytes,
3919 size_t offset __dparm(0),
3920 hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
3921 return ::hipMemcpyToSymbol((
const void*)&symbol, src, sizeBytes, offset, kind);
3924 template <
typename T>
3925 hipError_t hipMemcpyToSymbolAsync(
const T& symbol,
const void* src,
size_t sizeBytes,
size_t offset,
3926 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3927 return ::hipMemcpyToSymbolAsync((
const void*)&symbol, src, sizeBytes, offset, kind, stream);
3930 template <
typename T>
3931 hipError_t hipMemcpyFromSymbol(
void* dst,
const T &symbol,
3932 size_t sizeBytes,
size_t offset __dparm(0),
3933 hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
3934 return ::hipMemcpyFromSymbol(dst, (
const void*)&symbol, sizeBytes, offset, kind);
3937 template <
typename T>
3938 hipError_t hipMemcpyFromSymbolAsync(
void* dst,
const T& symbol,
size_t sizeBytes,
size_t offset,
3939 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3940 return ::hipMemcpyFromSymbolAsync(dst, (
const void*)&symbol, sizeBytes, offset, kind, stream);
3946 #include <hip/hcc_detail/hip_prof_str.h>
3956 hipError_t hipRemoveApiCallback(uint32_t
id);
3957 hipError_t hipRegisterActivityCallback(uint32_t
id,
void* fun,
void* arg);
3958 hipError_t hipRemoveActivityCallback(uint32_t
id);
3959 const char* hipApiName(uint32_t
id);
3960 const char* hipKernelNameRef(
const hipFunction_t f);
3961 const char* hipKernelNameRefByPtr(
const void* hostFunction, hipStream_t stream);
3962 int hipGetStreamDeviceId(hipStream_t stream);
3971 int* numBlocks, T f,
int blockSize,
size_t dynSharedMemPerBlk) {
3973 numBlocks,
reinterpret_cast<const void*
>(f), blockSize, dynSharedMemPerBlk);
3978 int* numBlocks, T f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags) {
3980 numBlocks,
reinterpret_cast<const void*
>(f), blockSize, dynSharedMemPerBlk, flags);
3986 DEPRECATED(DEPRECATED_MSG)
3987 hipError_t hipBindTexture(
size_t* offset,
textureReference* tex,
const void* devPtr,
3992 hipError_t ihipBindTextureImpl(TlsData *tls,
int dim,
enum hipTextureReadMode readMode,
size_t* offset,
4013 template <
class T,
int dim, enum hipTextureReadMode readMode>
4014 DEPRECATED(DEPRECATED_MSG)
4015 hipError_t hipBindTexture(
size_t* offset,
struct texture<T, dim, readMode>& tex,
const void* devPtr,
4017 return ihipBindTextureImpl(
nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
4036 template <
class T,
int dim, enum hipTextureReadMode readMode>
4037 DEPRECATED(DEPRECATED_MSG)
4038 hipError_t hipBindTexture(
size_t* offset,
struct texture<T, dim, readMode>& tex,
const void* devPtr,
4039 size_t size = UINT_MAX) {
4040 return ihipBindTextureImpl(
nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
4046 DEPRECATED(DEPRECATED_MSG)
4047 hipError_t hipBindTexture2D(
size_t* offset,
textureReference* tex,
const void* devPtr,
4053 hipError_t ihipBindTexture2DImpl(
int dim,
enum hipTextureReadMode readMode,
size_t* offset,
4059 template <
class T,
int dim, enum hipTextureReadMode readMode>
4060 DEPRECATED(DEPRECATED_MSG)
4061 hipError_t hipBindTexture2D(
size_t* offset,
struct texture<T, dim, readMode>& tex,
4062 const void* devPtr,
size_t width,
size_t height,
size_t pitch) {
4063 return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
4069 template <
class T,
int dim, enum hipTextureReadMode readMode>
4070 DEPRECATED(DEPRECATED_MSG)
4071 hipError_t hipBindTexture2D(
size_t* offset,
struct texture<T, dim, readMode>& tex,
4073 size_t width,
size_t height,
size_t pitch) {
4074 return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
4080 DEPRECATED(DEPRECATED_MSG)
4086 hipError_t ihipBindTextureToArrayImpl(TlsData *tls,
int dim,
enum hipTextureReadMode readMode,
4093 template <
class T,
int dim, enum hipTextureReadMode readMode>
4094 DEPRECATED(DEPRECATED_MSG)
4095 hipError_t hipBindTextureToArray(
struct texture<T, dim, readMode>& tex,
hipArray_const_t array) {
4096 return ihipBindTextureToArrayImpl(
nullptr, dim, readMode, array, tex.channelDesc, &tex);
4101 template <
class T,
int dim, enum hipTextureReadMode readMode>
4102 DEPRECATED(DEPRECATED_MSG)
4103 hipError_t hipBindTextureToArray(
struct texture<T, dim, readMode>& tex,
hipArray_const_t array,
4105 return ihipBindTextureToArrayImpl(
nullptr, dim, readMode, array, desc, &tex);
4110 template <
class T,
int dim, enum hipTextureReadMode readMode>
4111 DEPRECATED(DEPRECATED_MSG)
4112 inline static hipError_t hipBindTextureToArray(
struct texture<T, dim, readMode> *tex,
4115 return ihipBindTextureToArrayImpl(
nullptr, dim, readMode, array, *desc, tex);
4127 template <
class T,
int dim, enum hipTextureReadMode readMode>
4128 hipError_t hipBindTextureToMipmappedArray(
const texture<T, dim, readMode>& tex,
4135 template <
class T,
int dim, enum hipTextureReadMode readMode>
4136 hipError_t hipBindTextureToMipmappedArray(
const texture<T, dim, readMode>& tex,
4143 #if __HIP_ROCclr__ && !defined(__HCC__)
4145 template <
typename F>
4147 F kernel,
size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
4152 inline hipError_t hipLaunchCooperativeKernel(T f,
dim3 gridDim,
dim3 blockDim,
4153 void** kernelParams,
unsigned int sharedMemBytes, hipStream_t stream) {
4154 return hipLaunchCooperativeKernel(
reinterpret_cast<const void*
>(f), gridDim,
4155 blockDim, kernelParams, sharedMemBytes, stream);
4159 inline hipError_t hipLaunchCooperativeKernelMultiDevice(
hipLaunchParams* launchParamsList,
4160 unsigned int numDevices,
unsigned int flags = 0) {
4161 return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
4167 unsigned int numDevices,
unsigned int flags = 0) {
4181 DEPRECATED(DEPRECATED_MSG)
4186 extern hipError_t ihipUnbindTextureImpl(
const hipTextureObject_t& textureObject);
4190 template <
class T,
int dim, enum hipTextureReadMode readMode>
4191 DEPRECATED(DEPRECATED_MSG)
4192 hipError_t hipUnbindTexture(
struct texture<T, dim, readMode>& tex) {
4193 return ihipUnbindTextureImpl(tex.textureObject);
4200 DEPRECATED(DEPRECATED_MSG)
4201 hipError_t hipGetTextureAlignmentOffset(
size_t* offset,
const textureReference* texref);
4203 hipError_t hipGetTextureReference(
const textureReference** texref,
const void* symbol);
4205 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject,
const hipResourceDesc* pResDesc,
4209 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
4212 hipTextureObject_t textureObject);
4214 hipTextureObject_t textureObject);
4215 hipError_t hipGetTextureObjectTextureDesc(
hipTextureDesc* pTexDesc,
4216 hipTextureObject_t textureObject);
4221 hipError_t hipTexRefSetAddressMode(
textureReference* tex,
int dim, hipTextureAddressMode am);
4223 hipError_t hipTexRefGetAddressMode(hipTextureAddressMode* am,
textureReference tex,
int dim);
4225 hipError_t hipTexRefSetFilterMode(
textureReference* tex, hipTextureFilterMode fm);
4229 hipError_t hipTexRefSetFormat(
textureReference* tex, hipArray_Format fmt,
int NumPackedComponents);
4231 hipError_t hipTexRefSetAddress(
size_t* offset,
textureReference* tex, hipDeviceptr_t devPtr,
4234 hipError_t hipTexRefGetAddress(hipDeviceptr_t* dev_ptr,
textureReference tex);
4237 hipDeviceptr_t devPtr,
size_t pitch);
4245 template <
class T,
int dim, enum hipTextureReadMode readMode>
4246 DEPRECATED(DEPRECATED_MSG)
4247 static inline hipError_t hipBindTexture(
size_t* offset,
const struct texture<T, dim, readMode>& tex,
4248 const void* devPtr,
size_t size = UINT_MAX) {
4249 return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
4252 template <
class T,
int dim, enum hipTextureReadMode readMode>
4253 DEPRECATED(DEPRECATED_MSG)
4254 static inline hipError_t
4255 hipBindTexture(
size_t* offset,
const struct texture<T, dim, readMode>& tex,
const void* devPtr,
4257 return hipBindTexture(offset, &tex, devPtr, &desc, size);
4260 template<
class T,
int dim, enum hipTextureReadMode readMode>
4261 DEPRECATED(DEPRECATED_MSG)
4262 static inline hipError_t hipBindTexture2D(
4264 const struct texture<T, dim, readMode> &tex,
4270 return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
4273 template<
class T,
int dim, enum hipTextureReadMode readMode>
4274 DEPRECATED(DEPRECATED_MSG)
4275 static inline hipError_t hipBindTexture2D(
4277 const struct texture<T, dim, readMode> &tex,
4284 return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
4287 template<
class T,
int dim, enum hipTextureReadMode readMode>
4288 DEPRECATED(DEPRECATED_MSG)
4289 static inline hipError_t hipBindTextureToArray(
4290 const struct texture<T, dim, readMode> &tex,
4294 hipError_t err = hipGetChannelDesc(&desc, array);
4295 return (err ==
hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
4298 template<
class T,
int dim, enum hipTextureReadMode readMode>
4299 DEPRECATED(DEPRECATED_MSG)
4300 static inline hipError_t hipBindTextureToArray(
4301 const struct texture<T, dim, readMode> &tex,
4305 return hipBindTextureToArray(&tex, array, &desc);
4308 template<
class T,
int dim, enum hipTextureReadMode readMode>
4309 static inline hipError_t hipBindTextureToMipmappedArray(
4310 const struct texture<T, dim, readMode> &tex,
4319 err = hipGetChannelDesc(&desc, levelArray);
4320 return (err ==
hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
4323 template<
class T,
int dim, enum hipTextureReadMode readMode>
4324 static inline hipError_t hipBindTextureToMipmappedArray(
4325 const struct texture<T, dim, readMode> &tex,
4329 return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
4332 template<
class T,
int dim, enum hipTextureReadMode readMode>
4333 DEPRECATED(DEPRECATED_MSG)
4334 static inline hipError_t hipUnbindTexture(
4335 const struct texture<T, dim, readMode> &tex)
4337 return hipUnbindTexture(&tex);
4350 #pragma GCC visibility pop
Definition: hip_runtime_api.h:128
hipError_t hipModuleGetGlobal(void **, size_t *, hipModule_t, const char *)
returns device memory pointer and size of the kernel present in the module with symbol name
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.
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.
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 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:120
@ hipMemAdviseSetPreferredLocation
Definition: hip_runtime_api.h:247
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
hipFuncCache_t
Definition: hip_runtime_api.h:308
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:312
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:394
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:332
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 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:318
hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D *pCopy)
Copies data between host and device.
uint32_t x
x
Definition: hip_runtime_api.h:331
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:1216
hipMemoryAdvise
Definition: hip_runtime_api.h:243
Definition: driver_types.h:91
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 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.
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:41
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
Definition: driver_types.h:383
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:883
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:877
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 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:320
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:309
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:116
@ hipMemRangeAttributeAccessedBy
Definition: hip_runtime_api.h:265
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
void ** args
Arguments.
Definition: hip_runtime_api.h:343
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
Definition: hip_runtime_api.h:111
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:166
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:78
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:69
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
@ hipMemAdviseUnsetReadMostly
Undo the effect of hipMemAdviseSetReadMostly.
Definition: hip_runtime_api.h:246
Definition: hip_runtime_api.h:330
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 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:340
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:221
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:934
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:345
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:262
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:267
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.
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:341
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:370
Definition: driver_types.h:363
@ hipSharedMemBankSizeDefault
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:319
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 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.
@ hipMemAdviseUnsetAccessedBy
Definition: hip_runtime_api.h:252
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
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.
Defines the different newt vector types for HIP runtime.
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.
@ hipMemAdviseUnsetPreferredLocation
Clear the preferred location for the data.
Definition: hip_runtime_api.h:249
hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname)
Function with kname will be extracted if present in module.
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...
Definition: driver_types.h:288
Definition: texture_types.h:95
Definition: driver_types.h:323
uint32_t z
z
Definition: hip_runtime_api.h:333
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:62
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:342
#define hipMemAttachGlobal
Memory can be accessed by any stream on any device.
Definition: hip_runtime_api.h:191
Definition: hip_runtime_api.h:339
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:310
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:264
@ hipMemAdviseSetReadMostly
Definition: hip_runtime_api.h:244
hipFuncAttribute
Definition: hip_runtime_api.h:299
@ hipSharedMemBankSizeEightByte
Definition: hip_runtime_api.h:322
hipDeviceAttribute_t
Definition: hip_runtime_api.h:297
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.
@ hipMemAdviseSetAccessedBy
Definition: hip_runtime_api.h:250
Definition: driver_types.h:262
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:344
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))
Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset...
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:338
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:311
#define hipMemAttachSingle
the associated device
Definition: hip_runtime_api.h:193
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:889
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.
hipMemRangeAttribute
Definition: hip_runtime_api.h:261