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){};
336 #if __HIP_HAS_GET_PCH
342 void __hipGetPCH(
const char** pch,
unsigned int*size);
463 int srcDevice,
int dstDevice);
1222 unsigned int flags);
1271 uint32_t mask __dparm(0xFFFFFFFF));
1304 uint64_t mask __dparm(0xFFFFFFFFFFFFFFFF));
1426 hipError_t
hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1601 DEPRECATED(
"use hipHostMalloc instead")
1671 hipStream_t stream __dparm(0));
1703 const
void* dev_ptr,
1723 size_t num_attributes,
1724 const
void* dev_ptr,
1740 hipDeviceptr_t* dev_ptr,
1741 size_t length __dparm(0),
1763 hipError_t
hipHostAlloc(
void** ptr,
size_t size,
unsigned int flags);
1880 hipError_t
hipMemAllocPitch(hipDeviceptr_t* dptr,
size_t* pitch,
size_t widthInBytes,
size_t height,
unsigned int elementSizeBytes);
1954 hipError_t
hipMemcpy(
void* dst, const
void* src,
size_t sizeBytes, hipMemcpyKind kind);
1957 hipError_t hipMemcpyWithStream(
void* dst, const
void* src,
size_t sizeBytes,
1958 hipMemcpyKind kind, hipStream_t stream);
2014 hipError_t
hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src,
size_t sizeBytes);
2072 hipStream_t stream);
2074 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr,
size_t* bytes,
2075 hipModule_t hmod, const
char* name);
2077 hipError_t hipGetSymbolAddress(
void** devPtr, const
void* symbol);
2078 hipError_t hipGetSymbolSize(
size_t* size, const
void* symbol);
2079 hipError_t hipMemcpyToSymbol(const
void* symbol, const
void* src,
2080 size_t sizeBytes,
size_t offset __dparm(0),
2081 hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
2082 hipError_t hipMemcpyToSymbolAsync(const
void* symbol, const
void* src,
2083 size_t sizeBytes,
size_t offset,
2084 hipMemcpyKind kind, hipStream_t stream __dparm(0));
2085 hipError_t hipMemcpyFromSymbol(
void* dst, const
void* symbol,
2086 size_t sizeBytes,
size_t offset __dparm(0),
2087 hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
2088 hipError_t hipMemcpyFromSymbolAsync(
void* dst, const
void* symbol,
2089 size_t sizeBytes,
size_t offset,
2091 hipStream_t stream __dparm(0));
2121 hipError_t
hipMemcpyAsync(
void* dst, const
void* src,
size_t sizeBytes, hipMemcpyKind kind,
2122 hipStream_t stream __dparm(0));
2133 hipError_t
hipMemset(
void* dst,
int value,
size_t sizeBytes);
2144 hipError_t
hipMemsetD8(hipDeviceptr_t dest,
unsigned char value,
size_t count);
2161 hipError_t
hipMemsetD8Async(hipDeviceptr_t dest,
unsigned char value,
size_t count, hipStream_t stream __dparm(0));
2172 hipError_t
hipMemsetD16(hipDeviceptr_t dest,
unsigned short value,
size_t count);
2189 hipError_t
hipMemsetD16Async(hipDeviceptr_t dest,
unsigned short value,
size_t count, hipStream_t stream __dparm(0));
2217 hipError_t
hipMemsetAsync(
void* dst,
int value,
size_t sizeBytes, hipStream_t stream __dparm(0));
2235 hipStream_t stream __dparm(0));
2248 hipError_t
hipMemset2D(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height);
2262 hipError_t
hipMemset2DAsync(
void* dst,
size_t pitch,
int value,
size_t width,
size_t height,hipStream_t stream __dparm(0));
2297 hipError_t hipMemPtrGetInfo(
void* ptr,
size_t* size);
2313 size_t height __dparm(0),
unsigned int flags __dparm(
hipArrayDefault));
2316 hipError_t hipArrayDestroy(
hipArray* array);
2354 struct
hipExtent extent,
unsigned int flags);
2371 unsigned int numLevels,
2372 unsigned int flags __dparm(0));
2386 unsigned int level);
2404 hipError_t
hipMemcpy2D(
void* dst,
size_t dpitch, const
void* src,
size_t spitch,
size_t width,
2405 size_t height, hipMemcpyKind kind);
2447 hipError_t
hipMemcpy2DAsync(
void* dst,
size_t dpitch, const
void* src,
size_t spitch,
size_t width,
2448 size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2468 size_t spitch,
size_t width,
size_t height, hipMemcpyKind kind);
2485 DEPRECATED(DEPRECATED_MSG)
2487 size_t count, hipMemcpyKind kind);
2504 DEPRECATED(DEPRECATED_MSG)
2506 size_t count, hipMemcpyKind kind);
2707 #ifndef USE_PEER_NON_UNIFIED
2708 #define USE_PEER_NON_UNIFIED 1
2711 #if USE_PEER_NON_UNIFIED == 1
2723 hipError_t
hipMemcpyPeer(
void* dst,
int dstDeviceId,
const void* src,
int srcDeviceId,
2739 size_t sizeBytes, hipStream_t stream __dparm(0));
2777 DEPRECATED(DEPRECATED_MSG)
2778 hipError_t
hipCtxCreate(hipCtx_t* ctx,
unsigned int flags, hipDevice_t device);
2790 DEPRECATED(DEPRECATED_MSG)
2803 DEPRECATED(DEPRECATED_MSG)
2816 DEPRECATED(DEPRECATED_MSG)
2829 DEPRECATED(DEPRECATED_MSG)
2842 DEPRECATED(DEPRECATED_MSG)
2856 DEPRECATED(DEPRECATED_MSG)
2876 DEPRECATED(DEPRECATED_MSG)
2892 DEPRECATED(DEPRECATED_MSG)
2908 DEPRECATED(DEPRECATED_MSG)
2924 DEPRECATED(DEPRECATED_MSG)
2940 DEPRECATED(DEPRECATED_MSG)
2954 DEPRECATED(DEPRECATED_MSG)
2967 DEPRECATED(DEPRECATED_MSG)
2989 DEPRECATED(DEPRECATED_MSG)
3008 DEPRECATED(DEPRECATED_MSG)
3189 hipJitOption* options,
void** optionValues);
3216 unsigned int gridDimZ,
unsigned int blockDimX,
3217 unsigned int blockDimY,
unsigned int blockDimZ,
3218 unsigned int sharedMemBytes, hipStream_t stream,
3219 void** kernelParams,
void** extra);
3237 void** kernelParams,
unsigned int sharedMemBytes,
3238 hipStream_t stream);
3251 int numDevices,
unsigned int flags);
3266 int numDevices,
unsigned int flags);
3296 hipFunction_t f,
size_t dynSharedMemPerBlk,
3297 int blockSizeLimit);
3313 hipFunction_t f,
size_t dynSharedMemPerBlk,
3314 int blockSizeLimit,
unsigned int flags);
3325 int* numBlocks, hipFunction_t f,
int blockSize,
size_t dynSharedMemPerBlk);
3337 int* numBlocks, hipFunction_t f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags);
3348 int* numBlocks, const
void* f,
int blockSize,
size_t dynSharedMemPerBlk);
3360 int* numBlocks, const
void* f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags __dparm(hipOccupancyDefault));
3374 const
void* f,
size_t dynSharedMemPerBlk,
3375 int blockSizeLimit);
3401 DEPRECATED("use roctracer/rocTX instead")
3410 DEPRECATED("use roctracer/rocTX instead")
3482 size_t sharedMem __dparm(0),
3483 hipStream_t stream __dparm(0));
3501 hipStream_t *stream);
3522 size_t sharedMemBytes __dparm(0),
3523 hipStream_t stream __dparm(0));
3534 hipError_t hipExtLaunchKernel(const
void* function_address,
dim3 numBlocks,
dim3 dimBlocks,
3535 void** args,
size_t sharedMemBytes, hipStream_t stream,
3536 hipEvent_t startEvent, hipEvent_t stopEvent,
int flags);
3558 DEPRECATED(DEPRECATED_MSG)
3559 hipError_t hipBindTexture(
3564 size_t size __dparm(UINT_MAX));
3566 DEPRECATED(DEPRECATED_MSG)
3567 hipError_t hipBindTexture2D(
3576 DEPRECATED(DEPRECATED_MSG)
3577 hipError_t hipBindTextureToArray(
3582 DEPRECATED(DEPRECATED_MSG)
3583 hipError_t hipGetTextureAlignmentOffset(
3587 DEPRECATED(DEPRECATED_MSG)
3595 hipError_t hipBindTextureToMipmappedArray(
3600 hipError_t hipGetTextureReference(
3602 const
void* symbol);
3604 hipError_t hipCreateTextureObject(
3605 hipTextureObject_t* pTexObject,
3610 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3612 hipError_t hipGetChannelDesc(
3616 hipError_t hipGetTextureObjectResourceDesc(
3618 hipTextureObject_t textureObject);
3620 hipError_t hipGetTextureObjectResourceViewDesc(
3622 hipTextureObject_t textureObject);
3624 hipError_t hipGetTextureObjectTextureDesc(
3626 hipTextureObject_t textureObject);
3628 hipError_t hipTexRefGetAddress(
3629 hipDeviceptr_t* dev_ptr,
3632 hipError_t hipTexRefGetAddressMode(
3633 enum hipTextureAddressMode* pam,
3637 hipError_t hipTexRefGetFilterMode(
3638 enum hipTextureFilterMode* pfm,
3641 hipError_t hipTexRefGetFlags(
3642 unsigned int* pFlags,
3645 hipError_t hipTexRefGetFormat(
3646 hipArray_Format* pFormat,
3650 hipError_t hipTexRefGetMaxAnisotropy(
3654 hipError_t hipTexRefGetMipmapFilterMode(
3655 enum hipTextureFilterMode* pfm,
3658 hipError_t hipTexRefGetMipmapLevelBias(
3662 hipError_t hipTexRefGetMipmapLevelClamp(
3663 float* pminMipmapLevelClamp,
3664 float* pmaxMipmapLevelClamp,
3667 hipError_t hipTexRefGetMipMappedArray(
3671 hipError_t hipTexRefSetAddress(
3674 hipDeviceptr_t dptr,
3677 hipError_t hipTexRefSetAddress2D(
3680 hipDeviceptr_t dptr,
3683 hipError_t hipTexRefSetAddressMode(
3686 enum hipTextureAddressMode am);
3688 hipError_t hipTexRefSetArray(
3691 unsigned int flags);
3693 hipError_t hipTexRefSetFilterMode(
3695 enum hipTextureFilterMode fm);
3697 hipError_t hipTexRefSetFlags(
3699 unsigned int Flags);
3701 hipError_t hipTexRefSetFormat(
3703 hipArray_Format fmt,
3704 int NumPackedComponents);
3706 hipError_t hipTexRefSetMaxAnisotropy(
3708 unsigned int maxAniso);
3710 hipError_t hipTexObjectCreate(
3711 hipTextureObject_t* pTexObject,
3716 hipError_t hipTexObjectDestroy(
3717 hipTextureObject_t texObject);
3719 hipError_t hipTexObjectGetResourceDesc(
3721 hipTextureObject_t texObject);
3723 hipError_t hipTexObjectGetResourceViewDesc(
3725 hipTextureObject_t texObject);
3727 hipError_t hipTexObjectGetTextureDesc(
3729 hipTextureObject_t texObject);
3737 hipError_t hipTexRefSetBorderColor(
3739 float* pBorderColor);
3741 hipError_t hipTexRefSetMipmapFilterMode(
3743 enum hipTextureFilterMode fm);
3745 hipError_t hipTexRefSetMipmapLevelBias(
3749 hipError_t hipTexRefSetMipmapLevelClamp(
3751 float minMipMapLevelClamp,
3752 float maxMipMapLevelClamp);
3754 hipError_t hipTexRefSetMipmappedArray(
3757 unsigned int Flags);
3759 hipError_t hipMipmappedArrayCreate(
3762 unsigned int numMipmapLevels);
3764 hipError_t hipMipmappedArrayDestroy(
3767 hipError_t hipMipmappedArrayGetLevel(
3770 unsigned int level);
3776 hipError_t hipRemoveApiCallback(uint32_t
id);
3777 hipError_t hipRegisterActivityCallback(uint32_t
id,
void* fun,
void* arg);
3778 hipError_t hipRemoveActivityCallback(uint32_t
id);
3779 const
char* hipApiName(uint32_t
id);
3780 const
char* hipKernelNameRef(const hipFunction_t f);
3781 const
char* hipKernelNameRefByPtr(const
void* hostFunction, hipStream_t stream);
3782 int hipGetStreamDeviceId(hipStream_t stream);
3790 #include <hip/amd_detail/hip_prof_str.h>
3795 #if defined(__clang__) && defined(__HIP__)
3796 template <
typename T>
3798 T f,
size_t dynSharedMemPerBlk = 0,
int blockSizeLimit = 0) {
3802 template <
typename T>
3803 static hipError_t
__host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(
int* gridSize,
int* blockSize,
3804 T f,
size_t dynSharedMemPerBlk = 0,
int blockSizeLimit = 0,
unsigned int flags = 0 ) {
3807 #endif // defined(__clang__) && defined(__HIP__)
3809 template <
typename T>
3810 hipError_t hipGetSymbolAddress(
void** devPtr,
const T &symbol) {
3811 return ::hipGetSymbolAddress(devPtr, (
const void *)&symbol);
3814 template <
typename T>
3815 hipError_t hipGetSymbolSize(
size_t* size,
const T &symbol) {
3816 return ::hipGetSymbolSize(size, (
const void *)&symbol);
3819 template <
typename T>
3820 hipError_t hipMemcpyToSymbol(
const T& symbol,
const void* src,
size_t sizeBytes,
3821 size_t offset __dparm(0),
3822 hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
3823 return ::hipMemcpyToSymbol((
const void*)&symbol, src, sizeBytes, offset, kind);
3826 template <
typename T>
3827 hipError_t hipMemcpyToSymbolAsync(
const T& symbol,
const void* src,
size_t sizeBytes,
size_t offset,
3828 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3829 return ::hipMemcpyToSymbolAsync((
const void*)&symbol, src, sizeBytes, offset, kind, stream);
3832 template <
typename T>
3833 hipError_t hipMemcpyFromSymbol(
void* dst,
const T &symbol,
3834 size_t sizeBytes,
size_t offset __dparm(0),
3835 hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
3836 return ::hipMemcpyFromSymbol(dst, (
const void*)&symbol, sizeBytes, offset, kind);
3839 template <
typename T>
3840 hipError_t hipMemcpyFromSymbolAsync(
void* dst,
const T& symbol,
size_t sizeBytes,
size_t offset,
3841 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3842 return ::hipMemcpyFromSymbolAsync(dst, (
const void*)&symbol, sizeBytes, offset, kind, stream);
3847 int* numBlocks, T f,
int blockSize,
size_t dynSharedMemPerBlk) {
3849 numBlocks,
reinterpret_cast<const void*
>(f), blockSize, dynSharedMemPerBlk);
3854 int* numBlocks, T f,
int blockSize,
size_t dynSharedMemPerBlk,
unsigned int flags) {
3856 numBlocks,
reinterpret_cast<const void*
>(f), blockSize, dynSharedMemPerBlk, flags);
3859 template <
typename F>
3861 F kernel,
size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
3867 void** kernelParams,
unsigned int sharedMemBytes, hipStream_t stream) {
3869 blockDim, kernelParams, sharedMemBytes, stream);
3874 unsigned int numDevices,
unsigned int flags = 0) {
3880 unsigned int numDevices,
unsigned int flags = 0) {
3888 template <
class T,
int dim, enum hipTextureReadMode readMode>
3889 DEPRECATED(DEPRECATED_MSG)
3890 static inline hipError_t hipBindTexture(
size_t* offset,
const struct texture<T, dim, readMode>& tex,
3891 const void* devPtr,
size_t size = UINT_MAX) {
3892 return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
3895 template <
class T,
int dim, enum hipTextureReadMode readMode>
3896 DEPRECATED(DEPRECATED_MSG)
3897 static inline hipError_t
3898 hipBindTexture(
size_t* offset,
const struct texture<T, dim, readMode>& tex,
const void* devPtr,
3900 return hipBindTexture(offset, &tex, devPtr, &desc, size);
3903 template<
class T,
int dim, enum hipTextureReadMode readMode>
3904 DEPRECATED(DEPRECATED_MSG)
3905 static inline hipError_t hipBindTexture2D(
3907 const struct texture<T, dim, readMode> &tex,
3913 return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
3916 template<
class T,
int dim, enum hipTextureReadMode readMode>
3917 DEPRECATED(DEPRECATED_MSG)
3918 static inline hipError_t hipBindTexture2D(
3920 const struct texture<T, dim, readMode> &tex,
3927 return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
3930 template<
class T,
int dim, enum hipTextureReadMode readMode>
3931 DEPRECATED(DEPRECATED_MSG)
3932 static inline hipError_t hipBindTextureToArray(
3933 const struct texture<T, dim, readMode> &tex,
3937 hipError_t err = hipGetChannelDesc(&desc, array);
3938 return (err ==
hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
3941 template<
class T,
int dim, enum hipTextureReadMode readMode>
3942 DEPRECATED(DEPRECATED_MSG)
3943 static inline hipError_t hipBindTextureToArray(
3944 const struct texture<T, dim, readMode> &tex,
3948 return hipBindTextureToArray(&tex, array, &desc);
3951 template<
class T,
int dim, enum hipTextureReadMode readMode>
3952 static inline hipError_t hipBindTextureToMipmappedArray(
3953 const struct texture<T, dim, readMode> &tex,
3962 err = hipGetChannelDesc(&desc, levelArray);
3963 return (err ==
hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
3966 template<
class T,
int dim, enum hipTextureReadMode readMode>
3967 static inline hipError_t hipBindTextureToMipmappedArray(
3968 const struct texture<T, dim, readMode> &tex,
3972 return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
3975 template<
class T,
int dim, enum hipTextureReadMode readMode>
3976 DEPRECATED(DEPRECATED_MSG)
3977 static inline hipError_t hipUnbindTexture(
3978 const struct texture<T, dim, readMode> &tex)
3980 return hipUnbindTexture(&tex);
3983 #endif // __cplusplus
3986 #pragma GCC visibility pop
3994 #endif // HIP_INCLUDE_HIP_AMD_DETAIL_HIP_RUNTIME_API_H
Definition: hip_runtime_api.h:109
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.
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.
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:252
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:398
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 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:1204
hipMemoryAdvise
Definition: hip_runtime_api.h:231
Definition: driver_types.h:95
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.
@ hipMemRangeAttributeReadMostly
Definition: hip_runtime_api.h:250
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:387
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...
@ hipMemRangeAttributeAccessedBy
Definition: hip_runtime_api.h:253
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:120
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:170
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:82
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:73
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 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.
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:255
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:1031
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.
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: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:374
Definition: driver_types.h:367
@ 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:292
Definition: texture_types.h:95
Definition: driver_types.h:327
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:66
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
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:298
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:266
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:342
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