/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-5.0.2/include/hip/hip_runtime_api.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-5.0.2/include/hip/hip_runtime_api.h Source File#

HIP Runtime API Reference: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-5.0.2/include/hip/hip_runtime_api.h Source File
hip_runtime_api.h
Go to the documentation of this file.
1/*
2Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20THE SOFTWARE.
21*/
22
30#ifndef HIP_INCLUDE_HIP_HIP_RUNTIME_API_H
31#define HIP_INCLUDE_HIP_HIP_RUNTIME_API_H
32
33
34#include <string.h> // for getDeviceProp
35#include <hip/hip_version.h>
36#include <hip/hip_common.h>
37
38enum {
43};
44
45typedef struct {
46 // 32-bit Atomics
47 unsigned hasGlobalInt32Atomics : 1;
49 unsigned hasSharedInt32Atomics : 1;
51 unsigned hasFloatAtomicAdd : 1;
52
53 // 64-bit Atomics
54 unsigned hasGlobalInt64Atomics : 1;
55 unsigned hasSharedInt64Atomics : 1;
56
57 // Doubles
58 unsigned hasDoubles : 1;
59
60 // Warp cross-lane operations
61 unsigned hasWarpVote : 1;
62 unsigned hasWarpBallot : 1;
63 unsigned hasWarpShuffle : 1;
64 unsigned hasFunnelShift : 1;
65
66 // Sync
67 unsigned hasThreadFenceSystem : 1;
68 unsigned hasSyncThreadsExt : 1;
69
70 // Misc
71 unsigned hasSurfaceFuncs : 1;
72 unsigned has3dGrid : 1;
73 unsigned hasDynamicParallelism : 1;
75
76
77//---
78// Common headers for both NVCC and HCC paths:
79
84typedef struct hipDeviceProp_t {
85 char name[256];
92 int maxGridSize[3];
97 int major;
100 int minor;
118 char gcnArchName[256];
126 unsigned int* hdpMemFlushCntl;
127 unsigned int* hdpRegFlushCntl;
128 size_t memPitch;
151
152
164
165
169typedef struct hipPointerAttribute_t {
175 unsigned allocationFlags; /* flags specified when memory was allocated*/
176 /* peers? */
178
179
180// hack to get these to show up in Doxygen:
187// Ignoring error-code return values from hip APIs is discouraged. On C++17,
188// we can make that yield a warning
189#if __cplusplus >= 201703L
190#define __HIP_NODISCARD [[nodiscard]]
191#else
192#define __HIP_NODISCARD
193#endif
194
195/*
196 * @brief hipError_t
197 * @enum
198 * @ingroup Enumerations
199 */
200// Developer note - when updating these, update the hipErrorName and hipErrorString functions in
201// NVCC and HCC paths Also update the hipCUDAErrorTohipError function in NVCC path.
202
208 // Deprecated
211 // Deprecated
233 // Deprecated
255 // Deprecated
267 704,
269 705,
274 712,
276 713,
278 719,
280 720,
310 hipErrorUnknown = 999, //< Unknown error.
311 // HSA Runtime Error Codes start here.
316 hipErrorTbd
317} hipError_t;
318
319#undef __HIP_NODISCARD
320
321/*
322 * @brief hipDeviceAttribute_t
323 * @enum
324 * @ingroup Enumerations
325 */
328
423
426
447
450 // Extended attributes for vendors
452
459
464#if (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
465
466#include <stdint.h>
467#include <stddef.h>
468#ifndef GENERIC_GRID_LAUNCH
469#define GENERIC_GRID_LAUNCH 1
470#endif
471#include <hip/amd_detail/host_defines.h>
472#include <hip/driver_types.h>
473#include <hip/texture_types.h>
474#include <hip/surface_types.h>
475#if defined(_MSC_VER)
476#define DEPRECATED(msg) __declspec(deprecated(msg))
477#else // !defined(_MSC_VER)
478#define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
479#endif // !defined(_MSC_VER)
480#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"
481#define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
482#define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
483#define HIP_LAUNCH_PARAM_END ((void*)0x03)
484#ifdef __cplusplus
485 #define __dparm(x) \
486 = x
487#else
488 #define __dparm(x)
489#endif
490#ifdef __GNUC__
491#pragma GCC visibility push (default)
492#endif
493#ifdef __cplusplus
494namespace hip_impl {
495hipError_t hip_init();
496} // namespace hip_impl
497#endif
498// Structure definitions:
499#ifdef __cplusplus
500extern "C" {
501#endif
502//---
503// API-visible structures
504typedef struct ihipCtx_t* hipCtx_t;
505// Note many APIs also use integer deviceIds as an alternative to the device pointer:
506typedef int hipDevice_t;
513typedef struct ihipStream_t* hipStream_t;
514#define hipIpcMemLazyEnablePeerAccess 0
515#define HIP_IPC_HANDLE_SIZE 64
516typedef struct hipIpcMemHandle_st {
517 char reserved[HIP_IPC_HANDLE_SIZE];
519typedef struct hipIpcEventHandle_st {
520 char reserved[HIP_IPC_HANDLE_SIZE];
522typedef struct ihipModule_t* hipModule_t;
523typedef struct ihipModuleSymbol_t* hipFunction_t;
536typedef struct ihipEvent_t* hipEvent_t;
545//Flags that can be used with hipStreamCreateWithFlags.
547#define hipStreamDefault 0x00
548
550#define hipStreamNonBlocking 0x01
551
552//Flags that can be used with hipEventCreateWithFlags.
554#define hipEventDefault 0x0
555
557#define hipEventBlockingSync 0x1
558
560#define hipEventDisableTiming 0x2
561
563#define hipEventInterprocess 0x4
564
567#define hipEventReleaseToDevice 0x40000000
568
571#define hipEventReleaseToSystem 0x80000000
572
573//Flags that can be used with hipHostMalloc.
575#define hipHostMallocDefault 0x0
576
578#define hipHostMallocPortable 0x1
579
582#define hipHostMallocMapped 0x2
583
587#define hipHostMallocWriteCombined 0x4
588
590#define hipHostMallocNumaUser 0x20000000
591
593#define hipHostMallocCoherent 0x40000000
594
596#define hipHostMallocNonCoherent 0x80000000
597
599#define hipMemAttachGlobal 0x01
600
602#define hipMemAttachHost 0x02
603
605#define hipMemAttachSingle 0x04
606
607#define hipDeviceMallocDefault 0x0
608
610#define hipDeviceMallocFinegrained 0x1
611
613#define hipMallocSignalMemory 0x2
614
615//Flags that can be used with hipHostRegister.
617#define hipHostRegisterDefault 0x0
618
620#define hipHostRegisterPortable 0x1
621
624#define hipHostRegisterMapped 0x2
625
627#define hipHostRegisterIoMemory 0x4
628
630#define hipExtHostRegisterCoarseGrained 0x8
631
633#define hipDeviceScheduleAuto 0x0
634
637#define hipDeviceScheduleSpin 0x1
638
641#define hipDeviceScheduleYield 0x2
642#define hipDeviceScheduleBlockingSync 0x4
643#define hipDeviceScheduleMask 0x7
644#define hipDeviceMapHost 0x8
645#define hipDeviceLmemResizeToMax 0x16
647#define hipArrayDefault 0x00
648#define hipArrayLayered 0x01
649#define hipArraySurfaceLoadStore 0x02
650#define hipArrayCubemap 0x04
651#define hipArrayTextureGather 0x08
652#define hipOccupancyDefault 0x00
653#define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
654#define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
655#define hipCpuDeviceId ((int)-1)
656#define hipInvalidDeviceId ((int)-2)
657//Flags that can be used with hipExtLaunch Set of APIs.
659#define hipExtAnyOrderLaunch 0x01
660// Flags to be used with hipStreamWaitValue32 and hipStreamWaitValue64.
661#define hipStreamWaitValueGte 0x0
662#define hipStreamWaitValueEq 0x1
663#define hipStreamWaitValueAnd 0x2
664#define hipStreamWaitValueNor 0x3
665// Stream per thread
667#define hipStreamPerThread ((hipStream_t)2)
668/*
669 * @brief HIP Memory Advise values
670 * @enum
671 * @ingroup Enumerations
672 */
691/*
692 * @brief HIP Coherency Mode
693 * @enum
694 * @ingroup Enumerations
695 */
705/*
706 * @brief HIP range attributes
707 * @enum
708 * @ingroup Enumerations
709 */
721/*
722 * @brief hipJitOption
723 * @enum
724 * @ingroup Enumerations
725 */
777typedef struct dim3 {
778 uint32_t x;
779 uint32_t y;
780 uint32_t z;
781#ifdef __cplusplus
782 constexpr __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
783#endif
784} dim3;
785typedef struct hipLaunchParams_t {
786 void* func;
789 void **args;
790 size_t sharedMem;
802typedef struct hipExternalMemoryHandleDesc_st {
804 union {
805 int fd;
806 struct {
807 void *handle;
808 const void *name;
809 } win32;
810 } handle;
811 unsigned long long size;
812 unsigned int flags;
814typedef struct hipExternalMemoryBufferDesc_st {
815 unsigned long long offset;
816 unsigned long long size;
817 unsigned int flags;
826typedef struct hipExternalSemaphoreHandleDesc_st {
828 union {
829 int fd;
830 struct {
831 void* handle;
832 const void* name;
833 } win32;
834 } handle;
835 unsigned int flags;
838typedef struct hipExternalSemaphoreSignalParams_st {
839 struct {
840 struct {
841 unsigned long long value;
842 } fence;
843 struct {
844 unsigned long long key;
845 } keyedMutex;
846 unsigned int reserved[12];
847 } params;
848 unsigned int flags;
849 unsigned int reserved[16];
854typedef struct hipExternalSemaphoreWaitParams_st {
855 struct {
856 struct {
857 unsigned long long value;
858 } fence;
859 struct {
860 unsigned long long key;
861 unsigned int timeoutMs;
862 } keyedMutex;
863 unsigned int reserved[10];
864 } params;
865 unsigned int flags;
866 unsigned int reserved[16];
868
869#if __HIP_HAS_GET_PCH
875 void __hipGetPCH(const char** pch, unsigned int*size);
876#endif
877
878/*
879 * @brief HIP Devices used by current OpenGL Context.
880 * @enum
881 * @ingroup Enumerations
882 */
890
891/*
892 * @brief HIP Access falgs for Interop resources.
893 * @enum
894 * @ingroup Enumerations
895 */
905
906typedef struct _hipGraphicsResource hipGraphicsResource;
907
909
910// Doxygen end group GlobalDefs
912//-------------------------------------------------------------------------------------------------
913// The handle allows the async commands to use the stream even if the parent hipStream_t goes
914// out-of-scope.
915// typedef class ihipStream_t * hipStream_t;
916/*
917 * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
918 * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
919 * out-of-scope but the true event is being written by some async queue or device */
920// typedef struct hipEvent_t {
921// struct ihipEvent_t *_handle;
922//} hipEvent_t;
941// TODO-ctx - more description on error codes.
942hipError_t hipInit(unsigned int flags);
958hipError_t hipDriverGetVersion(int* driverVersion);
973hipError_t hipRuntimeGetVersion(int* runtimeVersion);
981hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
990hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
999hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
1010 int srcDevice, int dstDevice);
1019hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
1027hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
1036// doxygen end initialization
1183hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
1203hipError_t hipGetDeviceFlags(unsigned int* flags);
1262hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
1263// TODO: implement IPC apis
1326hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
1346
1362
1379
1380// end doxygen Device
1404hipError_t hipFuncSetAttribute(const void* func, hipFuncAttribute attr, int value);
1429//doxygen end execution
1471const char* hipGetErrorName(hipError_t hip_error);
1482const char* hipGetErrorString(hipError_t hipError);
1483// end doxygen Error
1548hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
1562hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
1637hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
1651hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
1685hipError_t hipExtStreamCreateWithCUMask(hipStream_t* stream, uint32_t cuMaskSize, const uint32_t* cuMask);
1698hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32_t* cuMask);
1702typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
1719 unsigned int flags);
1720// end doxygen Stream
1763hipError_t hipStreamWaitValue32(hipStream_t stream, void* ptr, uint32_t value, unsigned int flags,
1764 uint32_t mask __dparm(0xFFFFFFFF));
1797hipError_t hipStreamWaitValue64(hipStream_t stream, void* ptr, uint64_t value, unsigned int flags,
1798 uint64_t mask __dparm(0xFFFFFFFFFFFFFFFF));
1818hipError_t hipStreamWriteValue32(hipStream_t stream, void* ptr, uint32_t value, unsigned int flags);
1838hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, uint64_t value, unsigned int flags);
1839// end doxygen Stream Memory Operations
1912#ifdef __cplusplus
1913hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1914#else
1916#endif
2004// end doxygen Events
2047 hipDeviceptr_t ptr);
2064hipError_t hipDrvPointerGetAttributes(unsigned int numAttributes, hipPointer_attribute* attributes,
2065 void** data, hipDeviceptr_t ptr);
2077 const hipExternalSemaphoreHandleDesc* semHandleDesc);
2091 const hipExternalSemaphoreSignalParams* paramsArray,
2092 unsigned int numExtSems, hipStream_t stream);
2106 const hipExternalSemaphoreWaitParams* paramsArray,
2107 unsigned int numExtSems, hipStream_t stream);
2118
2165hipError_t hipMalloc(void** ptr, size_t size);
2180hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
2193DEPRECATED("use hipHostMalloc instead")
2194hipError_t hipMallocHost(void** ptr, size_t size);
2207DEPRECATED("use hipHostMalloc instead")
2208hipError_t hipMemAllocHost(void** ptr, size_t size);
2222hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
2243 size_t size,
2244 unsigned int flags __dparm(hipMemAttachGlobal));
2256 size_t count,
2257 int device,
2258 hipStream_t stream __dparm(0));
2269hipError_t hipMemAdvise(const void* dev_ptr,
2270 size_t count,
2271 hipMemoryAdvise advice,
2272 int device);
2286 size_t data_size,
2287 hipMemRangeAttribute attribute,
2288 const void* dev_ptr,
2289 size_t count);
2305 size_t* data_sizes,
2306 hipMemRangeAttribute* attributes,
2307 size_t num_attributes,
2308 const void* dev_ptr,
2309 size_t count);
2323 void* dev_ptr,
2324 size_t length __dparm(0),
2325 unsigned int flags __dparm(hipMemAttachSingle));
2326// end doxygen Managed Memory
2343DEPRECATED("use hipHostMalloc instead")
2344hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
2356hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
2366hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
2403hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
2431hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
2453hipError_t hipMemAllocPitch(hipDeviceptr_t* dptr, size_t* pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes);
2477DEPRECATED("use hipHostFree instead")
2522hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
2523// TODO: Add description
2524hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
2525 hipMemcpyKind kind, hipStream_t stream);
2543hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
2561hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
2597hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
2615hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
2634 hipStream_t stream);
2635
2651 hipModule_t hmod, const char* name);
2652hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol);
2653hipError_t hipGetSymbolSize(size_t* size, const void* symbol);
2654hipError_t hipMemcpyToSymbol(const void* symbol, const void* src,
2655 size_t sizeBytes, size_t offset __dparm(0),
2657hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src,
2658 size_t sizeBytes, size_t offset,
2659 hipMemcpyKind kind, hipStream_t stream __dparm(0));
2660hipError_t hipMemcpyFromSymbol(void* dst, const void* symbol,
2661 size_t sizeBytes, size_t offset __dparm(0),
2663hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbol,
2664 size_t sizeBytes, size_t offset,
2665 hipMemcpyKind kind,
2666 hipStream_t stream __dparm(0));
2695hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
2696 hipStream_t stream __dparm(0));
2706hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
2716hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count);
2732hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0));
2742hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count);
2758hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0));
2768hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
2784hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
2800hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
2801 hipStream_t stream __dparm(0));
2812hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
2824hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
2833hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
2843hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
2853hipError_t hipMemGetInfo(size_t* free, size_t* total);
2854hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
2867hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
2868 size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
2869hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
2889hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray);
2902 struct hipExtent extent, unsigned int flags);
2915 hipMipmappedArray_t *mipmappedArray,
2916 const struct hipChannelFormatDesc* desc,
2917 struct hipExtent extent,
2918 unsigned int numLevels,
2919 unsigned int flags __dparm(0));
2930 hipArray_t *levelArray,
2931 hipMipmappedArray_const_t mipmappedArray,
2932 unsigned int level);
2949hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2950 size_t height, hipMemcpyKind kind);
2989hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2990 size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
3008hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
3009 size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
3028hipError_t hipMemcpy2DToArrayAsync(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
3029 size_t spitch, size_t width, size_t height, hipMemcpyKind kind,
3030 hipStream_t stream __dparm(0));
3047hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
3048 size_t count, hipMemcpyKind kind);
3065hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
3066 size_t count, hipMemcpyKind kind);
3084hipError_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);
3103hipError_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));
3117hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
3131hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
3178// doxygen end Memory
3206hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
3223hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
3249#ifndef USE_PEER_NON_UNIFIED
3250#define USE_PEER_NON_UNIFIED 1
3251#endif
3252#if USE_PEER_NON_UNIFIED == 1
3264hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
3265 size_t sizeBytes);
3278hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
3279 size_t sizeBytes, hipStream_t stream __dparm(0));
3280#endif
3281// doxygen end PeerToPeer
3312hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
3488hipError_t hipCtxGetFlags(unsigned int* flags);
3509hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
3528// doxygen end Context deprecated
3544hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
3593// doxygen end Context Management
3615hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
3636hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
3645hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
3675hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
3688hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
3689 hipJitOption* options, void** optionValues);
3714hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
3715 unsigned int gridDimZ, unsigned int blockDimX,
3716 unsigned int blockDimY, unsigned int blockDimZ,
3717 unsigned int sharedMemBytes, hipStream_t stream,
3718 void** kernelParams, void** extra);
3734hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
3735 void** kernelParams, unsigned int sharedMemBytes,
3736 hipStream_t stream);
3748 int numDevices, unsigned int flags);
3761 int numDevices, unsigned int flags);
3762// doxygen end Module
3784//TODO - Match CUoccupancyB2DSize
3786 hipFunction_t f, size_t dynSharedMemPerBlk,
3787 int blockSizeLimit);
3800//TODO - Match CUoccupancyB2DSize
3802 hipFunction_t f, size_t dynSharedMemPerBlk,
3803 int blockSizeLimit, unsigned int flags);
3813 int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk);
3824 int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
3834 int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk);
3845 int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
3857hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3858 const void* f, size_t dynSharedMemPerBlk,
3859 int blockSizeLimit);
3860// doxygen end Occupancy
3874// TODO - expand descriptions:
3880DEPRECATED("use roctracer/rocTX instead")
3887DEPRECATED("use roctracer/rocTX instead")
3889// doxygen end profiler
3913hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3924hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3933hipError_t hipLaunchByPtr(const void* func);
3948 dim3 blockDim,
3949 size_t sharedMem __dparm(0),
3950 hipStream_t stream __dparm(0));
3965 dim3 *blockDim,
3966 size_t *sharedMem,
3967 hipStream_t *stream);
3983hipError_t hipLaunchKernel(const void* function_address,
3984 dim3 numBlocks,
3985 dim3 dimBlocks,
3986 void** args,
3987 size_t sharedMemBytes __dparm(0),
3988 hipStream_t stream __dparm(0));
3997//TODO: Move this to hip_ext.h
4018hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks, dim3 dimBlocks,
4019 void** args, size_t sharedMemBytes, hipStream_t stream,
4020 hipEvent_t startEvent, hipEvent_t stopEvent, int flags);
4021// doxygen end Clang launch
4041 size_t* offset,
4042 const textureReference* tex,
4043 const void* devPtr,
4044 const hipChannelFormatDesc* desc,
4045 size_t size __dparm(UINT_MAX));
4048 size_t* offset,
4049 const textureReference* tex,
4050 const void* devPtr,
4051 const hipChannelFormatDesc* desc,
4052 size_t width,
4053 size_t height,
4054 size_t pitch);
4057 const textureReference* tex,
4058 hipArray_const_t array,
4059 const hipChannelFormatDesc* desc);
4062 size_t* offset,
4063 const textureReference* texref);
4068 hipDeviceptr_t* dev_ptr,
4069 const textureReference* texRef);
4072 enum hipTextureAddressMode* pam,
4073 const textureReference* texRef,
4074 int dim);
4077 enum hipTextureFilterMode* pfm,
4078 const textureReference* texRef);
4081 unsigned int* pFlags,
4082 const textureReference* texRef);
4085 hipArray_Format* pFormat,
4086 int* pNumChannels,
4087 const textureReference* texRef);
4090 int* pmaxAnsio,
4091 const textureReference* texRef);
4094 enum hipTextureFilterMode* pfm,
4095 const textureReference* texRef);
4098 float* pbias,
4099 const textureReference* texRef);
4102 float* pminMipmapLevelClamp,
4103 float* pmaxMipmapLevelClamp,
4104 const textureReference* texRef);
4107 hipMipmappedArray_t* pArray,
4108 const textureReference* texRef);
4111 size_t* ByteOffset,
4112 textureReference* texRef,
4113 hipDeviceptr_t dptr,
4114 size_t bytes);
4117 textureReference* texRef,
4118 const HIP_ARRAY_DESCRIPTOR* desc,
4119 hipDeviceptr_t dptr,
4120 size_t Pitch);
4123 textureReference* texRef,
4124 unsigned int maxAniso);
4125// doxygen end deprecated texture management
4130 const textureReference* tex,
4131 hipMipmappedArray_const_t mipmappedArray,
4132 const hipChannelFormatDesc* desc);
4134 const textureReference** texref,
4135 const void* symbol);
4137 hipTextureObject_t* pTexObject,
4138 const hipResourceDesc* pResDesc,
4139 const hipTextureDesc* pTexDesc,
4140 const struct hipResourceViewDesc* pResViewDesc);
4144 hipArray_const_t array);
4146 hipResourceDesc* pResDesc,
4147 hipTextureObject_t textureObject);
4149 struct hipResourceViewDesc* pResViewDesc,
4150 hipTextureObject_t textureObject);
4152 hipTextureDesc* pTexDesc,
4153 hipTextureObject_t textureObject);
4154
4156 textureReference* texRef,
4157 int dim,
4158 enum hipTextureAddressMode am);
4160 textureReference* tex,
4161 hipArray_const_t array,
4162 unsigned int flags);
4164 textureReference* texRef,
4165 enum hipTextureFilterMode fm);
4167 textureReference* texRef,
4168 unsigned int Flags);
4170 textureReference* texRef,
4171 hipArray_Format fmt,
4172 int NumPackedComponents);
4174 hipTextureObject_t* pTexObject,
4175 const HIP_RESOURCE_DESC* pResDesc,
4176 const HIP_TEXTURE_DESC* pTexDesc,
4177 const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
4179 hipTextureObject_t texObject);
4181 HIP_RESOURCE_DESC* pResDesc,
4182 hipTextureObject_t texObject);
4184 HIP_RESOURCE_VIEW_DESC* pResViewDesc,
4185 hipTextureObject_t texObject);
4187 HIP_TEXTURE_DESC* pTexDesc,
4188 hipTextureObject_t texObject);
4189// doxygen end Texture management
4197// The following are not supported.
4207 textureReference* texRef,
4208 float* pBorderColor);
4210 textureReference* texRef,
4211 enum hipTextureFilterMode fm);
4213 textureReference* texRef,
4214 float bias);
4216 textureReference* texRef,
4217 float minMipMapLevelClamp,
4218 float maxMipMapLevelClamp);
4220 textureReference* texRef,
4221 struct hipMipmappedArray* mipmappedArray,
4222 unsigned int Flags);
4224 hipMipmappedArray_t* pHandle,
4225 HIP_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc,
4226 unsigned int numMipmapLevels);
4228 hipMipmappedArray_t hMipmappedArray);
4230 hipArray_t* pLevelArray,
4231 hipMipmappedArray_t hMipMappedArray,
4232 unsigned int level);
4233// doxygen end unsuppported texture management
4237// doxygen end Texture management
4249// This group is for HIPrtc
4250
4251// doxygen end Runtime
4262hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
4264hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
4266const char* hipApiName(uint32_t id);
4267const char* hipKernelNameRef(const hipFunction_t f);
4268const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream);
4270
4271// doxygen end Callback
4286typedef struct ihipGraph* hipGraph_t;
4290typedef struct hipGraphNode* hipGraphNode_t;
4294typedef struct hipGraphExec* hipGraphExec_t;
4295
4315
4316typedef void (*hipHostFn_t)(void* userData);
4329typedef struct hipMemsetParams {
4330 void* dst;
4331 unsigned int elementSize;
4332 size_t height;
4333 size_t pitch;
4334 unsigned int value;
4335 size_t width;
4337
4357
4369
4374
4389
4403
4418 unsigned long long* pId);
4419
4437 unsigned long long* id_out __dparm(0),
4438 hipGraph_t* graph_out __dparm(0),
4439 const hipGraphNode_t** dependencies_out __dparm(0),
4440 size_t* numDependencies_out __dparm(0));
4441
4455
4469 size_t numDependencies,
4470 unsigned int flags __dparm(0));
4471
4484hipError_t hipGraphCreate(hipGraph_t* pGraph, unsigned int flags);
4485
4498
4513 const hipGraphNode_t* to, size_t numDependencies);
4514
4529 const hipGraphNode_t* to, size_t numDependencies);
4530
4549 size_t* numEdges);
4550
4567hipError_t hipGraphGetNodes(hipGraph_t graph, hipGraphNode_t* nodes, size_t* numNodes);
4568
4586 size_t* pNumRootNodes);
4587
4605 size_t* pNumDependencies);
4606
4625 size_t* pNumDependentNodes);
4626
4639
4651
4663hipError_t hipGraphClone(hipGraph_t* pGraphClone, hipGraph_t originalGraph);
4664
4678 hipGraph_t clonedGraph);
4679
4697 hipGraphNode_t* pErrorNode, char* pLogBuffer, size_t bufferSize);
4698
4712 unsigned long long flags);
4713
4725
4737
4738// Check whether an executable graph can be updated with a graph and perform the update if possible.
4753 hipGraphNode_t* hErrorNode_out,
4754 hipGraphExecUpdateResult* updateResult_out);
4755
4769 const hipGraphNode_t* pDependencies, size_t numDependencies,
4770 const hipKernelNodeParams* pNodeParams);
4771
4782
4793
4805 const hipKernelNodeParams* pNodeParams);
4806
4820 const hipGraphNode_t* pDependencies, size_t numDependencies,
4821 const hipMemcpy3DParms* pCopyParams);
4832
4843
4855 hipMemcpy3DParms* pNodeParams);
4856
4873 const hipGraphNode_t* pDependencies, size_t numDependencies,
4874 void* dst, const void* src, size_t count, hipMemcpyKind kind);
4875
4889 size_t count, hipMemcpyKind kind);
4890
4906 void* dst, const void* src, size_t count,
4907 hipMemcpyKind kind);
4908
4926 const hipGraphNode_t* pDependencies,
4927 size_t numDependencies, void* dst, const void* symbol,
4928 size_t count, size_t offset, hipMemcpyKind kind);
4929
4944 size_t count, size_t offset, hipMemcpyKind kind);
4945
4962 void* dst, const void* symbol, size_t count,
4963 size_t offset, hipMemcpyKind kind);
4964
4982 const hipGraphNode_t* pDependencies,
4983 size_t numDependencies, const void* symbol,
4984 const void* src, size_t count, size_t offset,
4985 hipMemcpyKind kind);
4986
5001 const void* src, size_t count, size_t offset,
5002 hipMemcpyKind kind);
5003
5004
5020 const void* symbol, const void* src,
5021 size_t count, size_t offset, hipMemcpyKind kind);
5022
5036 const hipGraphNode_t* pDependencies, size_t numDependencies,
5037 const hipMemsetParams* pMemsetParams);
5038
5049
5060
5072 const hipMemsetParams* pNodeParams);
5073
5087 const hipGraphNode_t* pDependencies, size_t numDependencies,
5088 const hipHostNodeParams* pNodeParams);
5089
5100
5111
5123 const hipHostNodeParams* pNodeParams);
5124
5138 const hipGraphNode_t* pDependencies, size_t numDependencies,
5139 hipGraph_t childGraph);
5140
5151
5163 hipGraph_t childGraph);
5164
5177 const hipGraphNode_t* pDependencies, size_t numDependencies);
5178
5179
5193 const hipGraphNode_t* pDependencies, size_t numDependencies,
5194 hipEvent_t event);
5195
5206
5217
5229 hipEvent_t event);
5230
5244 const hipGraphNode_t* pDependencies, size_t numDependencies,
5245 hipEvent_t event);
5246
5247
5258
5269
5281 hipEvent_t event);
5282
5283// doxygen end graph API
5288#ifdef __cplusplus
5289} /* extern "c" */
5290#endif
5291#ifdef __cplusplus
5292#if defined(__clang__) && defined(__HIP__)
5293template <typename T>
5294static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
5295 T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0) {
5296 return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
5297}
5298template <typename T>
5299static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
5300 T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0, unsigned int flags = 0 ) {
5301 return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
5302}
5303#endif // defined(__clang__) && defined(__HIP__)
5304template <typename T>
5305hipError_t hipGetSymbolAddress(void** devPtr, const T &symbol) {
5306 return ::hipGetSymbolAddress(devPtr, (const void *)&symbol);
5307}
5308template <typename T>
5309hipError_t hipGetSymbolSize(size_t* size, const T &symbol) {
5310 return ::hipGetSymbolSize(size, (const void *)&symbol);
5311}
5312template <typename T>
5313hipError_t hipMemcpyToSymbol(const T& symbol, const void* src, size_t sizeBytes,
5314 size_t offset __dparm(0),
5316 return ::hipMemcpyToSymbol((const void*)&symbol, src, sizeBytes, offset, kind);
5317}
5318template <typename T>
5319hipError_t hipMemcpyToSymbolAsync(const T& symbol, const void* src, size_t sizeBytes, size_t offset,
5320 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
5321 return ::hipMemcpyToSymbolAsync((const void*)&symbol, src, sizeBytes, offset, kind, stream);
5322}
5323template <typename T>
5324hipError_t hipMemcpyFromSymbol(void* dst, const T &symbol,
5325 size_t sizeBytes, size_t offset __dparm(0),
5327 return ::hipMemcpyFromSymbol(dst, (const void*)&symbol, sizeBytes, offset, kind);
5328}
5329template <typename T>
5330hipError_t hipMemcpyFromSymbolAsync(void* dst, const T& symbol, size_t sizeBytes, size_t offset,
5331 hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
5332 return ::hipMemcpyFromSymbolAsync(dst, (const void*)&symbol, sizeBytes, offset, kind, stream);
5333}
5334template <class T>
5336 int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk) {
5338 numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk);
5339}
5340template <class T>
5342 int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
5344 numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk, flags);
5345}
5346template <typename F>
5347inline hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
5348 F kernel, size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
5349return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize,(hipFunction_t)kernel, dynSharedMemPerBlk, blockSizeLimit);
5350}
5351template <class T>
5352inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
5353 void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
5354 return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
5355 blockDim, kernelParams, sharedMemBytes, stream);
5356}
5357template <class T>
5359 unsigned int numDevices, unsigned int flags = 0) {
5360 return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
5361}
5362template <class T>
5364 unsigned int numDevices, unsigned int flags = 0) {
5365 return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
5366}
5367hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
5368hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
5369template <class T, int dim, enum hipTextureReadMode readMode>
5371static inline hipError_t hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex,
5372 const void* devPtr, size_t size = UINT_MAX) {
5373 return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
5374}
5375template <class T, int dim, enum hipTextureReadMode readMode>
5377static inline hipError_t
5378 hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex, const void* devPtr,
5379 const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
5380 return hipBindTexture(offset, &tex, devPtr, &desc, size);
5381}
5382template<class T, int dim, enum hipTextureReadMode readMode>
5384static inline hipError_t hipBindTexture2D(
5385 size_t *offset,
5386 const struct texture<T, dim, readMode> &tex,
5387 const void *devPtr,
5388 size_t width,
5389 size_t height,
5390 size_t pitch)
5391{
5392 return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
5393}
5394template<class T, int dim, enum hipTextureReadMode readMode>
5396static inline hipError_t hipBindTexture2D(
5397 size_t *offset,
5398 const struct texture<T, dim, readMode> &tex,
5399 const void *devPtr,
5400 const struct hipChannelFormatDesc &desc,
5401 size_t width,
5402 size_t height,
5403 size_t pitch)
5404{
5405 return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
5406}
5407template<class T, int dim, enum hipTextureReadMode readMode>
5409static inline hipError_t hipBindTextureToArray(
5410 const struct texture<T, dim, readMode> &tex,
5411 hipArray_const_t array)
5412{
5413 struct hipChannelFormatDesc desc;
5414 hipError_t err = hipGetChannelDesc(&desc, array);
5415 return (err == hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
5416}
5417template<class T, int dim, enum hipTextureReadMode readMode>
5419static inline hipError_t hipBindTextureToArray(
5420 const struct texture<T, dim, readMode> &tex,
5421 hipArray_const_t array,
5422 const struct hipChannelFormatDesc &desc)
5423{
5424 return hipBindTextureToArray(&tex, array, &desc);
5425}
5426template<class T, int dim, enum hipTextureReadMode readMode>
5428 const struct texture<T, dim, readMode> &tex,
5429 hipMipmappedArray_const_t mipmappedArray)
5430{
5431 struct hipChannelFormatDesc desc;
5432 hipArray_t levelArray;
5433 hipError_t err = hipGetMipmappedArrayLevel(&levelArray, mipmappedArray, 0);
5434 if (err != hipSuccess) {
5435 return err;
5436 }
5437 err = hipGetChannelDesc(&desc, levelArray);
5438 return (err == hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
5439}
5440template<class T, int dim, enum hipTextureReadMode readMode>
5442 const struct texture<T, dim, readMode> &tex,
5443 hipMipmappedArray_const_t mipmappedArray,
5444 const struct hipChannelFormatDesc &desc)
5445{
5446 return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
5447}
5448template<class T, int dim, enum hipTextureReadMode readMode>
5450static inline hipError_t hipUnbindTexture(
5451 const struct texture<T, dim, readMode> &tex)
5452{
5453 return hipUnbindTexture(&tex);
5454}
5455
5456
5457#endif // __cplusplus
5458
5466typedef unsigned int GLuint;
5467
5468// Queries devices associated with GL Context.
5469hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices,
5470 unsigned int hipDeviceCount, hipGLDeviceList deviceList);
5471// Registers a GL Buffer for interop and returns corresponding graphics resource.
5473 unsigned int flags);
5474// Maps a graphics resource for hip access.
5476 hipStream_t stream __dparm(0) );
5477// Gets device accessible address of a graphics resource.
5479 hipGraphicsResource_t resource);
5480// Unmaps a graphics resource for hip access.
5482 hipStream_t stream __dparm(0));
5483// Unregisters a graphics resource.
5485// doxygen end GL Interop
5490#ifdef __GNUC__
5491#pragma GCC visibility pop
5492#endif
5493// doxygen end HIP API
5498#elif !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
5499#include "hip/nvidia_detail/nvidia_hip_runtime_api.h"
5500#else
5501#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
5502#endif
5503
5504
5516#if defined(__cplusplus) && !defined(__HIP_DISABLE_CPP_FUNCTIONS__)
5517template <class T>
5518static inline hipError_t hipMalloc(T** devPtr, size_t size) {
5519 return hipMalloc((void**)devPtr, size);
5520}
5521
5522// Provide an override to automatically typecast the pointer type from void**, and also provide a
5523// default for the flags.
5524template <class T>
5525static inline hipError_t hipHostMalloc(T** ptr, size_t size,
5526 unsigned int flags = hipHostMallocDefault) {
5527 return hipHostMalloc((void**)ptr, size, flags);
5528}
5529
5530template <class T>
5531static inline hipError_t hipMallocManaged(T** devPtr, size_t size,
5532 unsigned int flags = hipMemAttachGlobal) {
5533 return hipMallocManaged((void**)devPtr, size, flags);
5534}
5535#endif
5536#endif
5537
5538#if USE_PROF_API
5539#include <hip/amd_detail/hip_prof_str.h>
5540#endif
hipMemcpyKind
Definition driver_types.h:344
@ hipMemcpyDeviceToHost
Device-to-Host Copy.
Definition driver_types.h:347
@ hipMemcpyHostToDevice
Host-to-Device Copy.
Definition driver_types.h:346
hipPointer_attribute
Definition driver_types.h:441
void * hipDeviceptr_t
Definition driver_types.h:40
hipFunction_attribute
Definition driver_types.h:427
hipArray_Format
Definition driver_types.h:58
unsigned hasSharedInt64Atomics
64-bit integer atomics for shared memory.
Definition hip_runtime_api.h:55
int ECCEnabled
Device has ECC support enabled.
Definition hip_runtime_api.h:132
@ hipLimitMallocHeapSize
Definition hip_runtime_api.h:539
@ hipLimitPrintfFifoSize
Definition hip_runtime_api.h:538
hipErrorIllegalAddress
Definition hip_runtime_api.h:263
hipErrorMemoryAllocation
Memory allocation error.
Definition hip_runtime_api.h:209
unsigned int flags
Definition hip_runtime_api.h:812
hipErrorNotFound
Definition hip_runtime_api.h:258
unsigned int flags
Definition hip_runtime_api.h:835
int maxTexture1DLinear
Maximum size for 1D textures bound to linear memory.
Definition hip_runtime_api.h:122
unsigned long long value
Definition hip_runtime_api.h:841
const void * name
Definition hip_runtime_api.h:808
hipErrorProfilerDisabled
Definition hip_runtime_api.h:214
int device
Definition hip_runtime_api.h:171
unsigned long long value
Definition hip_runtime_api.h:857
hipErrorInvalidDevicePointer
Invalid Device Pointer.
Definition hip_runtime_api.h:221
int pciBusID
PCI Bus ID.
Definition hip_runtime_api.h:112
enum hipMemoryType memoryType
Definition hip_runtime_api.h:170
unsigned hasSharedInt32Atomics
32-bit integer atomics for shared memory.
Definition hip_runtime_api.h:49
int maxTexture1D
Maximum number of elements in 1D images.
Definition hip_runtime_api.h:123
void * hostPointer
Definition hip_runtime_api.h:173
hipErrorRuntimeMemory
Definition hip_runtime_api.h:312
hipErrorInvalidImage
Definition hip_runtime_api.h:229
int memoryBusWidth
Global memory bus width in bits.
Definition hip_runtime_api.h:95
int clockRate
Max clock frequency of the multiProcessors in khz.
Definition hip_runtime_api.h:93
unsigned hasFloatAtomicAdd
32-bit float atomic add in global and shared memory.
Definition hip_runtime_api.h:51
int maxThreadsPerMultiProcessor
Maximum resident threads per multi-processor.
Definition hip_runtime_api.h:105
hipErrorPeerAccessUnsupported
Definition hip_runtime_api.h:246
hipErrorArrayIsMapped
Definition hip_runtime_api.h:236
int l2CacheSize
L2 cache size.
Definition hip_runtime_api.h:104
hipErrorStreamCaptureIsolation
Definition hip_runtime_api.h:293
void * dst
Definition hip_runtime_api.h:4330
hipErrorInvalidKernelFile
In CUDA DRV, it is CUDA_ERROR_INVALID_PTX.
Definition hip_runtime_api.h:247
size_t totalConstMem
Size of shared memory region (in bytes).
Definition hip_runtime_api.h:96
dim3 gridDim
Definition hip_runtime_api.h:4325
hipHostFn_t fn
Definition hip_runtime_api.h:4318
unsigned hasDoubles
Double-precision floating point.
Definition hip_runtime_api.h:58
hipErrorNotMapped
Definition hip_runtime_api.h:240
const void * name
Definition hip_runtime_api.h:832
int cacheModeCA
Definition hip_runtime_api.h:526
size_t memPitch
Maximum pitch in bytes allowed by memory copies.
Definition hip_runtime_api.h:128
unsigned int value
Definition hip_runtime_api.h:4334
unsigned hasWarpVote
Warp vote instructions (__any, __all).
Definition hip_runtime_api.h:61
unsigned int sharedMemBytes
Definition hip_runtime_api.h:4327
hipErrorGraphExecUpdateFailure
Definition hip_runtime_api.h:306
size_t sharedMemPerBlock
Size of shared memory region (in bytes).
Definition hip_runtime_api.h:87
hipErrorNotInitialized
Definition hip_runtime_api.h:210
hipErrorInvalidResourceHandle
Resource handle (hipEvent_t or hipStream_t) invalid.
Definition hip_runtime_api.h:256
unsigned hasWarpShuffle
Warp shuffle operations. (__shfl_*).
Definition hip_runtime_api.h:63
hipErrorSharedObjectInitFailed
Definition hip_runtime_api.h:252
hipErrorInvalidPitchValue
Definition hip_runtime_api.h:219
int fd
Definition hip_runtime_api.h:805
dim3 blockDim
Definition hip_runtime_api.h:4322
hipErrorNoBinaryForGpu
Definition hip_runtime_api.h:238
int cooperativeMultiDeviceLaunch
HIP device supports cooperative launch on multiple devices.
Definition hip_runtime_api.h:121
hipErrorInvalidContext
Produced when input context is invalid.
Definition hip_runtime_api.h:230
int binaryVersion
Definition hip_runtime_api.h:525
unsigned int flags
Definition hip_runtime_api.h:848
void * userData
Definition hip_runtime_api.h:4319
@ hipDevP2PAttrAccessSupported
Definition hip_runtime_api.h:509
@ hipDevP2PAttrHipArrayAccessSupported
Definition hip_runtime_api.h:511
@ hipDevP2PAttrNativeAtomicSupported
Definition hip_runtime_api.h:510
@ hipDevP2PAttrPerformanceRank
Definition hip_runtime_api.h:508
hipErrorStreamCaptureUnsupported
Definition hip_runtime_api.h:284
hipErrorPeerAccessNotEnabled
Peer access was never enabled from the current device.
Definition hip_runtime_api.h:268
hipErrorOperatingSystem
Definition hip_runtime_api.h:253
hipErrorStreamCaptureUnjoined
Definition hip_runtime_api.h:291
int pageableMemoryAccess
Definition hip_runtime_api.h:147
char name[256]
Device name.
Definition hip_runtime_api.h:85
size_t textureAlignment
Alignment requirement for textures.
Definition hip_runtime_api.h:129
hipErrorInitializationError
Definition hip_runtime_api.h:212
hipErrorNotMappedAsPointer
Definition hip_runtime_api.h:242
hipExternalSemaphoreHandleType type
Definition hip_runtime_api.h:827
hipErrorPriorLaunchFailure
Definition hip_runtime_api.h:225
size_t constSizeBytes
Definition hip_runtime_api.h:527
hipErrorContextIsDestroyed
Definition hip_runtime_api.h:271
hipErrorInvalidValue
Definition hip_runtime_api.h:205
hipErrorLaunchTimeOut
Definition hip_runtime_api.h:265
hipErrorUnmapFailed
Definition hip_runtime_api.h:235
hipErrorSetOnActiveProcess
Definition hip_runtime_api.h:270
int isManaged
Definition hip_runtime_api.h:174
unsigned long long size
Definition hip_runtime_api.h:811
hipErrorFileNotFound
Definition hip_runtime_api.h:250
int memoryClockRate
Max global memory clock frequency in khz.
Definition hip_runtime_api.h:94
hipErrorLaunchFailure
An exception occurred on the device while executing a kernel.
Definition hip_runtime_api.h:277
hipErrorInvalidDevice
DeviceID must be in range 0...#compute-devices.
Definition hip_runtime_api.h:228
int clockInstructionRate
Definition hip_runtime_api.h:107
hipErrorUnsupportedLimit
Definition hip_runtime_api.h:244
hipErrorMapBufferObjectFailed
Produced when the IPC memory attach failed from ROCr.
Definition hip_runtime_api.h:234
unsigned int timeoutMs
Definition hip_runtime_api.h:861
hipErrorHostMemoryAlreadyRegistered
Produced when trying to lock a page-locked memory.
Definition hip_runtime_api.h:273
int regsPerBlock
Registers per block.
Definition hip_runtime_api.h:88
hipErrorMissingConfiguration
Definition hip_runtime_api.h:224
hipErrorSharedObjectSymbolNotFound
Definition hip_runtime_api.h:251
int maxTexture2D[2]
Maximum dimensions (width, height) of 2D images, in image elements.
Definition hip_runtime_api.h:124
int preferredShmemCarveout
Definition hip_runtime_api.h:532
int cooperativeLaunch
HIP device supports cooperative launch.
Definition hip_runtime_api.h:120
int maxTexture3D[3]
Maximum dimensions (width, height, depth) of 3D images, in image elements.
Definition hip_runtime_api.h:125
hipErrorECCNotCorrectable
Definition hip_runtime_api.h:243
int directManagedMemAccessFromHost
Host can directly access managed memory on the device without migration.
Definition hip_runtime_api.h:145
uint32_t y
y
Definition hip_runtime_api.h:779
hipErrorStreamCaptureWrongThread
Definition hip_runtime_api.h:302
uint32_t z
z
Definition hip_runtime_api.h:780
int cooperativeMultiDeviceUnmatchedFunc
Definition hip_runtime_api.h:134
hipErrorAssert
Produced when the kernel calls assert.
Definition hip_runtime_api.h:272
int pageableMemoryAccessUsesHostPageTables
Device accesses pageable memory via the host's page tables.
Definition hip_runtime_api.h:149
hipErrorContextAlreadyInUse
Definition hip_runtime_api.h:245
void ** kernelParams
Definition hip_runtime_api.h:4326
unsigned int * hdpRegFlushCntl
Addres of HDP_REG_COHERENCY_FLUSH_CNTL register.
Definition hip_runtime_api.h:127
unsigned hasGlobalInt32Atomics
32-bit integer atomics for global memory.
Definition hip_runtime_api.h:47
hipErrorNotReady
Definition hip_runtime_api.h:259
int maxThreadsDim[3]
Max number of threads in each dimension (XYZ) of a block.
Definition hip_runtime_api.h:91
unsigned hasGlobalFloatAtomicExch
32-bit float atomic exch for global memory.
Definition hip_runtime_api.h:48
unsigned hasDynamicParallelism
Dynamic parallelism.
Definition hip_runtime_api.h:73
hipErrorInvalidSource
Definition hip_runtime_api.h:249
size_t sharedMem
Shared memory.
Definition hip_runtime_api.h:790
hipErrorLaunchOutOfResources
Out of resources error.
Definition hip_runtime_api.h:264
int isMultiGpuBoard
1 if device is on a multi-GPU board, 0 if not.
Definition hip_runtime_api.h:115
size_t sharedSizeBytes
Definition hip_runtime_api.h:534
int maxDynamicSharedSizeBytes
Definition hip_runtime_api.h:529
unsigned long long key
Definition hip_runtime_api.h:860
unsigned hasSurfaceFuncs
Surface functions.
Definition hip_runtime_api.h:71
hipErrorInvalidDeviceFunction
Definition hip_runtime_api.h:226
int pciDomainID
PCI Domain ID.
Definition hip_runtime_api.h:111
void * handle
Definition hip_runtime_api.h:831
size_t maxSharedMemoryPerMultiProcessor
Maximum Shared Memory Per Multiprocessor.
Definition hip_runtime_api.h:114
unsigned has3dGrid
Grid and group dims are 3D (rather than 2D).
Definition hip_runtime_api.h:72
hipExternalMemoryHandleType type
Definition hip_runtime_api.h:803
int ptxVersion
Definition hip_runtime_api.h:533
hipErrorCooperativeLaunchTooLarge
Definition hip_runtime_api.h:279
void ** extra
Definition hip_runtime_api.h:4323
unsigned hasFunnelShift
Funnel two words into one with shift&mask caps.
Definition hip_runtime_api.h:64
hipErrorAlreadyMapped
Definition hip_runtime_api.h:237
unsigned long long key
Definition hip_runtime_api.h:844
hipErrorProfilerNotInitialized
Definition hip_runtime_api.h:215
hipErrorProfilerAlreadyStarted
Definition hip_runtime_api.h:216
unsigned int elementSize
Definition hip_runtime_api.h:4331
int cooperativeMultiDeviceUnmatchedGridDim
Definition hip_runtime_api.h:136
unsigned int flags
Definition hip_runtime_api.h:865
hipErrorNoDevice
Call to hipGetDeviceCount returned 0 devices.
Definition hip_runtime_api.h:227
int minor
Definition hip_runtime_api.h:100
char gcnArchName[256]
AMD GCN Arch Name.
Definition hip_runtime_api.h:118
int fd
Definition hip_runtime_api.h:829
@ HIP_ERROR_LAUNCH_OUT_OF_RESOURCES
Definition hip_runtime_api.h:42
@ HIP_ERROR_INVALID_VALUE
Definition hip_runtime_api.h:40
@ HIP_SUCCESS
Definition hip_runtime_api.h:39
@ HIP_ERROR_NOT_INITIALIZED
Definition hip_runtime_api.h:41
void * devicePointer
Definition hip_runtime_api.h:172
int kernelExecTimeoutEnabled
Run time limit for kernels executed on the device.
Definition hip_runtime_api.h:131
void * func
Definition hip_runtime_api.h:4324
unsigned int * hdpMemFlushCntl
Addres of HDP_MEM_COHERENCY_FLUSH_CNTL register.
Definition hip_runtime_api.h:126
int concurrentManagedAccess
Device can coherently access managed memory concurrently with the CPU.
Definition hip_runtime_api.h:146
int integrated
APU vs dGPU.
Definition hip_runtime_api.h:119
hipErrorMapFailed
Definition hip_runtime_api.h:232
int canMapHostMemory
Check whether HIP can map host memory.
Definition hip_runtime_api.h:116
unsigned hasThreadFenceSystem
__threadfence_system.
Definition hip_runtime_api.h:67
hipErrorStreamCaptureInvalidated
Definition hip_runtime_api.h:286
uint32_t x
x
Definition hip_runtime_api.h:778
void ** args
Arguments.
Definition hip_runtime_api.h:789
int asicRevision
Revision of the GPU in this device.
Definition hip_runtime_api.h:143
hipErrorProfilerAlreadyStopped
Definition hip_runtime_api.h:217
dim3 blockDim
Block dimentions.
Definition hip_runtime_api.h:788
hipErrorDeinitialized
Definition hip_runtime_api.h:213
size_t totalGlobalMem
Size of global memory region (in bytes).
Definition hip_runtime_api.h:86
size_t width
Definition hip_runtime_api.h:4335
hipErrorPeerAccessAlreadyEnabled
Peer access was already enabled from the current device.
Definition hip_runtime_api.h:266
hipErrorNotMappedAsArray
Definition hip_runtime_api.h:241
int cooperativeMultiDeviceUnmatchedBlockDim
Definition hip_runtime_api.h:138
hipErrorNotSupported
Produced when the hip API is not supported/implemented.
Definition hip_runtime_api.h:283
unsigned allocationFlags
Definition hip_runtime_api.h:175
hipErrorInvalidConfiguration
Definition hip_runtime_api.h:218
unsigned hasGlobalInt64Atomics
64-bit integer atomics for global memory.
Definition hip_runtime_api.h:54
hipErrorStreamCaptureImplicit
Definition hip_runtime_api.h:297
hipErrorStreamCaptureMerge
Definition hip_runtime_api.h:288
int concurrentKernels
Device can possibly execute multiple kernels concurrently.
Definition hip_runtime_api.h:110
int isLargeBar
1: if it is a large PCI bar device, else 0
Definition hip_runtime_api.h:142
hipErrorInvalidGraphicsContext
Definition hip_runtime_api.h:248
int numRegs
Definition hip_runtime_api.h:531
hipErrorIllegalState
Resource required is not in a valid state to perform operation.
Definition hip_runtime_api.h:257
int gcnArch
DEPRECATED: use gcnArchName instead.
Definition hip_runtime_api.h:117
int multiProcessorCount
Number of multi-processors (compute units).
Definition hip_runtime_api.h:103
unsigned hasSyncThreadsExt
__syncthreads_count, syncthreads_and, syncthreads_or.
Definition hip_runtime_api.h:68
unsigned int flags
Definition hip_runtime_api.h:817
hipErrorOutOfMemory
Definition hip_runtime_api.h:207
hipErrorInvalidSymbol
Definition hip_runtime_api.h:220
hipSuccess
Successful completion.
Definition hip_runtime_api.h:204
int maxGridSize[3]
Max grid dimensions (XYZ).
Definition hip_runtime_api.h:92
hipErrorUnknown
Definition hip_runtime_api.h:310
int pciDeviceID
PCI Device ID.
Definition hip_runtime_api.h:113
int computeMode
Compute mode.
Definition hip_runtime_api.h:106
void * handle
Definition hip_runtime_api.h:807
@ hipMemoryTypeDevice
Definition hip_runtime_api.h:158
@ hipMemoryTypeHost
Memory is physically located on host.
Definition hip_runtime_api.h:157
@ hipMemoryTypeArray
Definition hip_runtime_api.h:160
@ hipMemoryTypeUnified
Not used currently.
Definition hip_runtime_api.h:162
hipErrorInvalidHandle
Definition hip_runtime_api.h:254
hipErrorStreamCaptureUnmatched
The capture was not initiated in this stream.
Definition hip_runtime_api.h:290
hipErrorCapturedEvent
Definition hip_runtime_api.h:300
int major
Definition hip_runtime_api.h:97
hipErrorAlreadyAcquired
Definition hip_runtime_api.h:239
hipErrorInsufficientDriver
Definition hip_runtime_api.h:223
dim3 gridDim
Grid dimentions.
Definition hip_runtime_api.h:787
hipErrorHostMemoryNotRegistered
Produced when trying to unlock a non-page-locked memory.
Definition hip_runtime_api.h:275
void * func
Device function symbol.
Definition hip_runtime_api.h:786
unsigned hasWarpBallot
Warp ballot instructions (__ballot).
Definition hip_runtime_api.h:62
unsigned long long offset
Definition hip_runtime_api.h:815
int warpSize
Warp size.
Definition hip_runtime_api.h:89
int tccDriver
1:If device is Tesla device using TCC driver, else 0
Definition hip_runtime_api.h:133
size_t pitch
Definition hip_runtime_api.h:4333
size_t height
Definition hip_runtime_api.h:4332
size_t localSizeBytes
Definition hip_runtime_api.h:528
unsigned long long size
Definition hip_runtime_api.h:816
int cooperativeMultiDeviceUnmatchedSharedMem
Definition hip_runtime_api.h:140
hipErrorRuntimeOther
Definition hip_runtime_api.h:314
hipStream_t stream
Stream identifier.
Definition hip_runtime_api.h:791
int maxThreadsPerBlock
Definition hip_runtime_api.h:530
int maxThreadsPerBlock
Max work items per work group or workgroup max size.
Definition hip_runtime_api.h:90
hipErrorContextAlreadyCurrent
Definition hip_runtime_api.h:231
hipErrorInvalidMemcpyDirection
Invalid memory copy direction.
Definition hip_runtime_api.h:222
hipDeviceArch_t arch
Architectural feature flags. New for HIP.
Definition hip_runtime_api.h:109
int managedMemory
Device supports allocating managed memory on this system.
Definition hip_runtime_api.h:144
unsigned hasSharedFloatAtomicExch
32-bit float atomic exch for shared memory.
Definition hip_runtime_api.h:50
size_t texturePitchAlignment
Pitch alignment requirement for texture references bound to pitched memory.
Definition hip_runtime_api.h:130
hipError_t hipRegisterApiCallback(uint32_t id, void *fun, void *arg)
const char * hipApiName(uint32_t id)
hipError_t hipRemoveApiCallback(uint32_t id)
const char * hipKernelNameRef(const hipFunction_t f)
const char * hipKernelNameRefByPtr(const void *hostFunction, hipStream_t stream)
hipError_t hipRemoveActivityCallback(uint32_t id)
int hipGetStreamDeviceId(hipStream_t stream)
hipError_t hipRegisterActivityCallback(uint32_t id, void *fun, void *arg)
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
hipError_t __hipPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, hipStream_t *stream)
Pop configuration of a kernel launch.
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 hipExtLaunchKernel(const void *function_address, dim3 numBlocks, dim3 dimBlocks, void **args, size_t sharedMemBytes, hipStream_t stream, hipEvent_t startEvent, hipEvent_t stopEvent, int flags)
Launches kernel from the pointer address, with arguments and shared memory on stream.
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Configure a kernel launch.
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
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 hipDrvMemcpy2DUnaligned(const hip_Memcpy2D *pCopy)
hipError_t hipCtxGetFlags(unsigned int *flags)
Return flags used for creating default context.
hipError_t hipCtxPopCurrent(hipCtx_t *ctx)
Pop the current/default context and return the popped context.
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
hipError_t hipCtxGetCurrent(hipCtx_t *ctx)
Get the handle of the current/ default context.
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipError_t hipCtxSetCurrent(hipCtx_t ctx)
Set the passed context as current/default.
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
hipError_t hipCtxGetDevice(hipDevice_t *device)
Get the handle of the device associated with current/default context.
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
hipError_t hipCtxPushCurrent(hipCtx_t ctx)
Push the context to be set as current/ default context.
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device)
Create a context and set it as current/ default context.
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion)
Returns the approximate HIP api version.
hipError_t hipCtxSynchronize(void)
Blocks until the default context has completed all preceding requested tasks.
hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config)
Set Shared memory bank configuration.
hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx)
Disable direct access from current context's virtual address space to memory allocations physically l...
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
hipError_t hipGetDeviceFlags(unsigned int *flags)
Gets the flags set for current device.
hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t *handle, hipEvent_t event)
Gets an opaque interprocess handle for an event.
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current 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 hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
hipError_t hipSetDevice(int deviceId)
Set default device to be used for subsequent hip API calls from this thread.
hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t *linktype, uint32_t *hopcount)
Returns the link type and hop count between two devices.
hipError_t hipSetDeviceFlags(unsigned flags)
The current device behavior is changed according the flags passed.
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
hipError_t hipDeviceReset(void)
The state of current device is discarded and updated to a fresh state.
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
hipError_t hipIpcOpenEventHandle(hipEvent_t *event, hipIpcEventHandle_t handle)
Opens an interprocess event handles.
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop)
Device which matches hipDeviceProp_t is returned.
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
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 hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
hipError_t hipDeviceGetP2PAttribute(int *value, hipDeviceP2PAttr attr, int srcDevice, int dstDevice)
Returns a value for attr of link between two devices.
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
const char * hipGetErrorString(hipError_t hipError)
Return handy text string message to explain the error which occurred.
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
hipError_t hipGetLastError(void)
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess...
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
hipError_t hipEventSynchronize(hipEvent_t event)
Wait for an event to complete.
hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
Record an event in the specified stream.
hipError_t hipEventQuery(hipEvent_t event)
Query event status.
hipError_t hipEventCreate(hipEvent_t *event)
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
hipError_t hipFuncSetSharedMemConfig(const void *func, hipSharedMemConfig config)
Set shared memory configuation for a specific function.
hipError_t hipFuncSetAttribute(const void *func, hipFuncAttribute attr, int value)
Set attribute for a specific function.
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
hipError_t hipGLGetDevices(unsigned int *pHipDeviceCount, int *pHipDevices, unsigned int hipDeviceCount, hipGLDeviceList deviceList)
hipError_t hipGraphicsUnregisterResource(hipGraphicsResource_t resource)
hipError_t hipGraphicsGLRegisterBuffer(hipGraphicsResource **resource, GLuint buffer, unsigned int flags)
hipError_t hipGraphicsMapResources(int count, hipGraphicsResource_t *resources, hipStream_t stream __dparm(0))
unsigned int GLuint
Definition hip_runtime_api.h:5466
hipError_t hipGraphicsUnmapResources(int count, hipGraphicsResource_t *resources, hipStream_t stream __dparm(0))
hipError_t hipGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, hipGraphicsResource_t resource)
hipGraphicsResource * hipGraphicsResource_t
Definition hip_runtime_api.h:908
hipGLDeviceList
Definition hip_runtime_api.h:883
hipMemRangeAttribute
Definition hip_runtime_api.h:710
#define hipMemAttachSingle
Definition hip_runtime_api.h:605
hipMemoryAdvise
Definition hip_runtime_api.h:673
#define hipArrayDefault
Definition hip_runtime_api.h:647
hipSharedMemConfig
Definition hip_runtime_api.h:766
hipComputeMode
Definition hip_runtime_api.h:453
hipExternalMemoryHandleType
Definition hip_runtime_api.h:793
#define hipMemAttachGlobal
Definition hip_runtime_api.h:599
hipFuncAttribute
Definition hip_runtime_api.h:749
hipExternalSemaphoreHandleType
Definition hip_runtime_api.h:820
hipJitOption
Definition hip_runtime_api.h:726
enum __HIP_NODISCARD hipError_t hipError_t
Definition hip_runtime_api.h:203
#define hipOccupancyDefault
Definition hip_runtime_api.h:652
hipFuncCache_t
Definition hip_runtime_api.h:757
#define __HIP_NODISCARD
Definition hip_runtime_api.h:192
void * hipExternalSemaphore_t
Definition hip_runtime_api.h:837
hipGraphicsRegisterFlags
Definition hip_runtime_api.h:896
hipMemRangeCoherencyMode
Definition hip_runtime_api.h:696
void * hipExternalMemory_t
Definition hip_runtime_api.h:819
hipDeviceAttribute_t
Definition hip_runtime_api.h:326
#define hipHostMallocDefault
Definition hip_runtime_api.h:575
struct _hipGraphicsResource hipGraphicsResource
Definition hip_runtime_api.h:906
@ hipGLDeviceListNextFrame
frame.
Definition hip_runtime_api.h:887
@ hipGLDeviceListAll
All hip devices used by current OpenGL context.
Definition hip_runtime_api.h:884
@ hipGLDeviceListCurrentFrame
frame
Definition hip_runtime_api.h:885
@ hipMemRangeAttributeLastPrefetchLocation
prefetched
Definition hip_runtime_api.h:716
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition hip_runtime_api.h:713
@ hipMemRangeAttributeAccessedBy
Definition hip_runtime_api.h:714
@ hipMemRangeAttributeReadMostly
Definition hip_runtime_api.h:711
@ hipMemRangeAttributeCoherencyMode
Definition hip_runtime_api.h:718
@ hipMemAdviseUnsetAccessedBy
Definition hip_runtime_api.h:682
@ hipMemAdviseUnsetCoarseGrain
Restores cache coherency policy back to fine-grain.
Definition hip_runtime_api.h:689
@ hipMemAdviseSetCoarseGrain
Definition hip_runtime_api.h:684
@ hipMemAdviseUnsetPreferredLocation
Clear the preferred location for the data.
Definition hip_runtime_api.h:679
@ hipMemAdviseSetAccessedBy
Definition hip_runtime_api.h:680
@ hipMemAdviseSetPreferredLocation
Definition hip_runtime_api.h:677
@ hipMemAdviseSetReadMostly
Definition hip_runtime_api.h:674
@ hipMemAdviseUnsetReadMostly
Undo the effect of hipMemAdviseSetReadMostly.
Definition hip_runtime_api.h:676
@ hipSharedMemBankSizeFourByte
Definition hip_runtime_api.h:768
@ hipSharedMemBankSizeEightByte
Definition hip_runtime_api.h:770
@ hipSharedMemBankSizeDefault
The compiler selects a device-specific value for the banking.
Definition hip_runtime_api.h:767
@ hipComputeModeProhibited
Definition hip_runtime_api.h:456
@ hipComputeModeExclusive
Definition hip_runtime_api.h:455
@ hipComputeModeDefault
Definition hip_runtime_api.h:454
@ hipComputeModeExclusiveProcess
Definition hip_runtime_api.h:457
@ hipExternalMemoryHandleTypeD3D11Resource
Definition hip_runtime_api.h:799
@ hipExternalMemoryHandleTypeD3D12Resource
Definition hip_runtime_api.h:798
@ hipExternalMemoryHandleTypeOpaqueFd
Definition hip_runtime_api.h:794
@ hipExternalMemoryHandleTypeD3D12Heap
Definition hip_runtime_api.h:797
@ hipExternalMemoryHandleTypeOpaqueWin32Kmt
Definition hip_runtime_api.h:796
@ hipExternalMemoryHandleTypeOpaqueWin32
Definition hip_runtime_api.h:795
@ hipExternalMemoryHandleTypeD3D11ResourceKmt
Definition hip_runtime_api.h:800
@ hipFuncAttributePreferredSharedMemoryCarveout
Definition hip_runtime_api.h:751
@ hipFuncAttributeMaxDynamicSharedMemorySize
Definition hip_runtime_api.h:750
@ hipFuncAttributeMax
Definition hip_runtime_api.h:752
@ hipExternalSemaphoreHandleTypeOpaqueWin32Kmt
Definition hip_runtime_api.h:823
@ hipExternalSemaphoreHandleTypeOpaqueFd
Definition hip_runtime_api.h:821
@ hipExternalSemaphoreHandleTypeOpaqueWin32
Definition hip_runtime_api.h:822
@ hipExternalSemaphoreHandleTypeD3D12Fence
Definition hip_runtime_api.h:824
@ hipJitOptionCacheMode
Definition hip_runtime_api.h:741
@ hipJitOptionFastCompile
Definition hip_runtime_api.h:743
@ hipJitOptionInfoLogBuffer
Definition hip_runtime_api.h:730
@ hipJitOptionErrorLogBuffer
Definition hip_runtime_api.h:732
@ hipJitOptionTarget
Definition hip_runtime_api.h:736
@ hipJitOptionThreadsPerBlock
Definition hip_runtime_api.h:728
@ hipJitOptionNumOptions
Definition hip_runtime_api.h:744
@ hipJitOptionGenerateLineInfo
Definition hip_runtime_api.h:740
@ hipJitOptionOptimizationLevel
Definition hip_runtime_api.h:734
@ hipJitOptionErrorLogBufferSizeBytes
Definition hip_runtime_api.h:733
@ hipJitOptionWallTime
Definition hip_runtime_api.h:729
@ hipJitOptionInfoLogBufferSizeBytes
Definition hip_runtime_api.h:731
@ hipJitOptionTargetFromContext
Definition hip_runtime_api.h:735
@ hipJitOptionGenerateDebugInfo
Definition hip_runtime_api.h:738
@ hipJitOptionLogVerbose
Definition hip_runtime_api.h:739
@ hipJitOptionMaxRegisters
Definition hip_runtime_api.h:727
@ hipJitOptionSm3xOpt
Definition hip_runtime_api.h:742
@ hipJitOptionFallbackStrategy
Definition hip_runtime_api.h:737
@ hipFuncCachePreferNone
no preference for shared memory or L1 (default)
Definition hip_runtime_api.h:758
@ hipFuncCachePreferEqual
prefer equal size L1 cache and shared memory
Definition hip_runtime_api.h:761
@ hipFuncCachePreferL1
prefer larger L1 cache and smaller shared memory
Definition hip_runtime_api.h:760
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition hip_runtime_api.h:759
@ hipGraphicsRegisterFlagsReadOnly
HIP will not write to this registered resource.
Definition hip_runtime_api.h:898
@ hipGraphicsRegisterFlagsTextureGather
HIP will perform texture gather operations on this registered resource.
Definition hip_runtime_api.h:902
@ hipGraphicsRegisterFlagsWriteDiscard
HIP will only write and will not read from this registered resource.
Definition hip_runtime_api.h:899
@ hipGraphicsRegisterFlagsNone
Definition hip_runtime_api.h:897
@ hipGraphicsRegisterFlagsSurfaceLoadStore
HIP will bind this resource to a surface.
Definition hip_runtime_api.h:901
@ hipMemRangeCoherencyModeFineGrain
Definition hip_runtime_api.h:697
@ hipMemRangeCoherencyModeIndeterminate
Definition hip_runtime_api.h:701
@ hipMemRangeCoherencyModeCoarseGrain
Definition hip_runtime_api.h:699
@ hipDeviceAttributeDirectManagedMemAccessFromHost
Definition hip_runtime_api.h:344
@ hipDeviceAttributeSurfaceAlignment
Cuda only. Alignment requirement for surfaces.
Definition hip_runtime_api.h:414
@ hipDeviceAttributeMaxGridDimX
Max grid size in width.
Definition hip_runtime_api.h:361
@ hipDeviceAttributeMaxSurfaceCubemapLayered
Cuda only. Maximum dimension of Cubemap layered surface.
Definition hip_runtime_api.h:370
@ hipDeviceAttributeMaxSurface3D
Maximum dimension (width, height, depth) of 3D surface.
Definition hip_runtime_api.h:368
@ hipDeviceAttributeMaxPitch
Maximum pitch in bytes allowed by memory copies.
Definition hip_runtime_api.h:391
@ hipDeviceAttributeTccDriver
Cuda only. Whether device is a Tesla device using TCC driver.
Definition hip_runtime_api.h:415
@ hipDeviceAttributeHostNativeAtomicSupported
Cuda only. Link between the device and the host supports native atomic operations.
Definition hip_runtime_api.h:347
@ hipDeviceAttributePageableMemoryAccessUsesHostPageTables
Device accesses pageable memory via the host's page tables.
Definition hip_runtime_api.h:400
@ hipDeviceAttributeMaxBlockDimY
Max block size in height.
Definition hip_runtime_api.h:359
@ hipDeviceAttributeMaxSurfaceCubemap
Cuda only. Maximum dimensions of Cubemap surface.
Definition hip_runtime_api.h:369
@ hipDeviceAttributeName
Device name.
Definition hip_runtime_api.h:397
@ hipDeviceAttributePageableMemoryAccess
Definition hip_runtime_api.h:398
@ hipDeviceAttributeClockRate
Peak clock frequency in kilohertz.
Definition hip_runtime_api.h:335
@ hipDeviceAttributeCudaCompatibleEnd
Definition hip_runtime_api.h:424
@ hipDeviceAttributeMaxTexture1DMipmap
Cuda only. Maximum size of 1D mipmapped texture.
Definition hip_runtime_api.h:375
@ hipDeviceAttributeComputeCapabilityMajor
Major compute capability version number.
Definition hip_runtime_api.h:355
@ hipDeviceAttributeGlobalL1CacheSupported
Cuda only. Device supports caching globals in L1.
Definition hip_runtime_api.h:346
@ hipDeviceAttributeCooperativeMultiDeviceUnmatchedSharedMem
Definition hip_runtime_api.h:440
@ hipDeviceAttributeAccessPolicyMaxWindowSize
Cuda only. The maximum size of the window policy in bytes.
Definition hip_runtime_api.h:330
@ hipDeviceAttributeMaxTexture3DHeight
Maximum dimension height of 3D texture.
Definition hip_runtime_api.h:383
@ hipDeviceAttributeComputeCapabilityMinor
Minor compute capability version number.
Definition hip_runtime_api.h:394
@ hipDeviceAttributeMaxTextureCubemap
Cuda only. Maximum dimensions of Cubemap texture.
Definition hip_runtime_api.h:386
@ hipDeviceAttributeDeviceOverlap
Definition hip_runtime_api.h:342
@ hipDeviceAttributeMaxTexture2DLinear
Cuda only. Maximum dimensions (width, height, pitch) of 2D textures bound to pitched memory.
Definition hip_runtime_api.h:380
@ hipDeviceAttributeMaxSurface2D
Maximum dimension (width, height) of 2D surface.
Definition hip_runtime_api.h:366
@ hipDeviceAttributeMaxSurface1DLayered
Cuda only. Maximum dimensions of 1D layered surface.
Definition hip_runtime_api.h:365
@ hipDeviceAttributeHdpRegFlushCntl
Address of the HDP_REG_COHERENCY_FLUSH_CNTL register.
Definition hip_runtime_api.h:433
@ hipDeviceAttributeComputeMode
Compute mode that device is currently in.
Definition hip_runtime_api.h:336
@ hipDeviceAttributeCooperativeMultiDeviceUnmatchedFunc
Definition hip_runtime_api.h:434
@ hipDeviceAttributeAsicRevision
Revision of the GPU in this device.
Definition hip_runtime_api.h:443
@ hipDeviceAttributeCooperativeMultiDeviceLaunch
Support cooperative launch on multiple devices.
Definition hip_runtime_api.h:341
@ hipDeviceAttributeMaxTexture2DHeight
Maximum dimension hight of 2D texture.
Definition hip_runtime_api.h:377
@ hipDeviceAttributePersistingL2CacheMaxSize
Cuda11 only. Maximum l2 persisting lines capacity in bytes.
Definition hip_runtime_api.h:404
@ hipDeviceAttributeEccEnabled
Whether ECC support is enabled.
Definition hip_runtime_api.h:329
@ hipDeviceAttributeCanUseHostPointerForRegisteredMem
Definition hip_runtime_api.h:333
@ hipDeviceAttributePciBusId
PCI Bus ID.
Definition hip_runtime_api.h:401
@ hipDeviceAttributeL2CacheSize
Size of L2 cache in bytes. 0 if the device doesn't have L2 cache.
Definition hip_runtime_api.h:351
@ hipDeviceAttributeKernelExecTimeout
Run time limit for kernels executed on the device.
Definition hip_runtime_api.h:350
@ hipDeviceAttributeMaxThreadsDim
Maximum dimension of a block.
Definition hip_runtime_api.h:388
@ hipDeviceAttributeSingleToDoublePrecisionPerfRatio
Cuda only. Performance ratio of single precision to double precision.
Definition hip_runtime_api.h:412
@ hipDeviceAttributeMaxGridDimY
Max grid size in height.
Definition hip_runtime_api.h:362
@ hipDeviceAttributeMultiprocessorCount
Number of multiprocessors on the device.
Definition hip_runtime_api.h:396
@ hipDeviceAttributeUuid
Cuda only. Unique ID in 16 byte.
Definition hip_runtime_api.h:421
@ hipDeviceAttributeAmdSpecificBegin
Definition hip_runtime_api.h:425
@ hipDeviceAttributeMaxRegistersPerMultiprocessor
32-bit registers available per block.
Definition hip_runtime_api.h:407
@ hipDeviceAttributeGcnArchName
Device gcnArch name in 256 bytes.
Definition hip_runtime_api.h:431
@ hipDeviceAttributeIsMultiGpuBoard
Multiple GPU devices.
Definition hip_runtime_api.h:349
@ hipDeviceAttributeSharedMemPerBlockOptin
Cuda only. Maximum shared memory per block usable by special opt in.
Definition hip_runtime_api.h:410
@ hipDeviceAttributeMaxSurface2DLayered
Cuda only. Maximum dimensions of 2D layered surface.
Definition hip_runtime_api.h:367
@ hipDeviceAttributeAmdSpecificEnd
Definition hip_runtime_api.h:448
@ hipDeviceAttributeMemoryClockRate
Peak memory clock frequency in kilohertz.
Definition hip_runtime_api.h:393
@ hipDeviceAttributeGcnArch
Device gcn architecture.
Definition hip_runtime_api.h:430
@ hipDeviceAttributeMaxGridDimZ
Max grid size in depth.
Definition hip_runtime_api.h:363
@ hipDeviceAttributeHdpMemFlushCntl
Address of the HDP_MEM_COHERENCY_FLUSH_CNTL register.
Definition hip_runtime_api.h:432
@ hipDeviceAttributeCooperativeLaunch
Support cooperative launch.
Definition hip_runtime_api.h:340
@ hipDeviceAttributeUnifiedAddressing
Cuda only. An unified address space shared with the host.
Definition hip_runtime_api.h:420
@ hipDeviceAttributeAsyncEngineCount
Cuda only. Asynchronous engines number.
Definition hip_runtime_api.h:331
@ hipDeviceAttributeMultiGpuBoardGroupID
Cuda only. Unique ID of device group on the same multi-GPU board.
Definition hip_runtime_api.h:395
@ hipDeviceAttributeStreamPrioritiesSupported
Cuda only. Whether to support stream priorities.
Definition hip_runtime_api.h:413
@ hipDeviceAttributeMaxSharedMemoryPerBlock
Maximum shared memory available per block in bytes.
Definition hip_runtime_api.h:409
@ hipDeviceAttributeLocalL1CacheSupported
caching locals in L1 is supported
Definition hip_runtime_api.h:352
@ hipDeviceAttributeCanUseStreamWaitValue
Definition hip_runtime_api.h:444
@ hipDeviceAttributeMaxRegistersPerBlock
Definition hip_runtime_api.h:405
@ hipDeviceAttributeMaxThreadsPerBlock
Maximum number of threads per block.
Definition hip_runtime_api.h:389
@ hipDeviceAttributeMemoryBusWidth
Global memory bus width in bits.
Definition hip_runtime_api.h:392
@ hipDeviceAttributeComputePreemptionSupported
Cuda only. Device supports Compute Preemption.
Definition hip_runtime_api.h:337
@ hipDeviceAttributeMaxSurface1D
Maximum size of 1D surface.
Definition hip_runtime_api.h:364
@ hipDeviceAttributeMaxTexture3DAlt
Cuda only. Maximum dimensions of alternate 3D texture.
Definition hip_runtime_api.h:385
@ hipDeviceAttributeMaxTexture1DLinear
Definition hip_runtime_api.h:373
@ hipDeviceAttributeMaxTexture2DGather
Cuda only. Maximum dimensions of 2D texture if gather operations performed.
Definition hip_runtime_api.h:378
@ hipDeviceAttributePciDeviceId
PCI Device ID.
Definition hip_runtime_api.h:402
@ hipDeviceAttributeCanMapHostMemory
Whether host memory can be mapped into device address space.
Definition hip_runtime_api.h:332
@ hipDeviceAttributeMaxTexture1DWidth
Maximum size of 1D texture.
Definition hip_runtime_api.h:371
@ hipDeviceAttributeConcurrentManagedAccess
Device can coherently access managed memory concurrently with the CPU.
Definition hip_runtime_api.h:339
@ hipDeviceAttributeVendorSpecificBegin
Definition hip_runtime_api.h:449
@ hipDeviceAttributeArch
Device architecture.
Definition hip_runtime_api.h:428
@ hipDeviceAttributeManagedMemory
Device supports allocating managed memory on this system.
Definition hip_runtime_api.h:356
@ hipDeviceAttributeIntegrated
Device is integrated GPU.
Definition hip_runtime_api.h:348
@ hipDeviceAttributeMaxTexture2DLayered
Cuda only. Maximum dimensions of 2D layered texture.
Definition hip_runtime_api.h:379
@ hipDeviceAttributeCooperativeMultiDeviceUnmatchedGridDim
Definition hip_runtime_api.h:436
@ hipDeviceAttributeMaxTexture3DDepth
Maximum dimension depth of 3D texture.
Definition hip_runtime_api.h:384
@ hipDeviceAttributeImageSupport
'1' if Device supports image, '0' otherwise.
Definition hip_runtime_api.h:446
@ hipDeviceAttributeTotalGlobalMem
Global memory available on devicice.
Definition hip_runtime_api.h:419
@ hipDeviceAttributeMaxBlocksPerMultiProcessor
Cuda only. Max block size per multiprocessor.
Definition hip_runtime_api.h:357
@ hipDeviceAttributeIsLargeBar
Whether it is LargeBar.
Definition hip_runtime_api.h:442
@ hipDeviceAttributeMaxTexture2DWidth
Maximum dimension width of 2D texture.
Definition hip_runtime_api.h:376
@ hipDeviceAttributeMaxBlockDimX
Max block size in width.
Definition hip_runtime_api.h:358
@ hipDeviceAttributeMaxTexture3DWidth
Maximum dimension width of 3D texture.
Definition hip_runtime_api.h:382
@ hipDeviceAttributeTotalConstantMemory
Constant memory size in bytes.
Definition hip_runtime_api.h:418
@ hipDeviceAttributeTextureAlignment
Alignment requirement for textures.
Definition hip_runtime_api.h:416
@ hipDeviceAttributeMaxTexture1DLayered
Cuda only. Maximum dimensions of 1D layered texture.
Definition hip_runtime_api.h:372
@ hipDeviceAttributeMaxSharedMemoryPerMultiprocessor
Maximum Shared Memory PerMultiprocessor.
Definition hip_runtime_api.h:429
@ hipDeviceAttributeReservedSharedMemPerBlock
Cuda11 only. Shared memory reserved by CUDA driver per block.
Definition hip_runtime_api.h:408
@ hipDeviceAttributeCudaCompatibleBegin
Definition hip_runtime_api.h:327
@ hipDeviceAttributeConcurrentKernels
Device can possibly execute multiple kernels concurrently.
Definition hip_runtime_api.h:338
@ hipDeviceAttributeLuid
Cuda only. 8-byte locally unique identifier in 8 bytes. Undefined on TCC and non-Windows platforms.
Definition hip_runtime_api.h:353
@ hipDeviceAttributePciDomainID
PCI Domain ID.
Definition hip_runtime_api.h:403
@ hipDeviceAttributeMaxThreadsPerMultiProcessor
Maximum resident threads per multiprocessor.
Definition hip_runtime_api.h:390
@ hipDeviceAttributeTexturePitchAlignment
Pitch alignment requirement for 2D texture references bound to pitched memory;.
Definition hip_runtime_api.h:417
@ hipDeviceAttributeSharedMemPerMultiprocessor
Cuda only. Shared memory available per multiprocessor.
Definition hip_runtime_api.h:411
@ hipDeviceAttributeLuidDeviceNodeMask
Cuda only. Luid device node mask. Undefined on TCC and non-Windows platforms.
Definition hip_runtime_api.h:354
@ hipDeviceAttributeMaxTextureCubemapLayered
Cuda only. Maximum dimensions of Cubemap layered texture.
Definition hip_runtime_api.h:387
@ hipDeviceAttributeCooperativeMultiDeviceUnmatchedBlockDim
Definition hip_runtime_api.h:438
@ hipDeviceAttributeClockInstructionRate
Frequency in khz of the timer used by the device-side "clock*".
Definition hip_runtime_api.h:427
@ hipDeviceAttributeMaxTexture2DMipmap
Cuda only. Maximum dimensions of 2D mipmapped texture.
Definition hip_runtime_api.h:381
@ hipDeviceAttributeMaxBlockDimZ
Max block size in depth.
Definition hip_runtime_api.h:360
@ hipDeviceAttributeWarpSize
Warp size in threads.
Definition hip_runtime_api.h:422
hipError_t hipGraphKernelNodeSetParams(hipGraphNode_t node, const hipKernelNodeParams *pNodeParams)
Sets a kernel node's parameters.
hipError_t hipGraphNodeGetDependencies(hipGraphNode_t node, hipGraphNode_t *pDependencies, size_t *pNumDependencies)
Returns a node's dependencies.
hipError_t hipGraphCreate(hipGraph_t *pGraph, unsigned int flags)
Creates a graph.
hipError_t hipGraphAddMemcpyNode1D(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, hipMemcpyKind kind)
Creates a 1D memcpy node and adds it to a graph.
hipError_t hipGraphMemcpyNodeSetParams(hipGraphNode_t node, const hipMemcpy3DParms *pNodeParams)
Sets a memcpy node's parameters.
hipError_t hipGraphExecUpdate(hipGraphExec_t hGraphExec, hipGraph_t hGraph, hipGraphNode_t *hErrorNode_out, hipGraphExecUpdateResult *updateResult_out)
Check whether an executable graph can be updated with a graph and perform the update if * possible.
hipError_t hipGraphNodeFindInClone(hipGraphNode_t *pNode, hipGraphNode_t originalNode, hipGraph_t clonedGraph)
Finds a cloned version of a node.
hipError_t hipGraphAddEventWaitNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, hipEvent_t event)
Creates an event wait node and adds it to a graph.
hipError_t hipGraphMemcpyNodeSetParamsToSymbol(hipGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, hipMemcpyKind kind)
Sets a memcpy node's parameters to copy to a symbol on the device.
hipError_t hipStreamIsCapturing(hipStream_t stream, hipStreamCaptureStatus *pCaptureStatus)
Get stream's capture state.
hipError_t hipGraphAddChildGraphNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, hipGraph_t childGraph)
Creates a child graph node and adds it to a graph.
hipError_t hipGraphDestroyNode(hipGraphNode_t node)
Remove a node from the graph.
hipError_t hipGraphMemcpyNodeSetParamsFromSymbol(hipGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, hipMemcpyKind kind)
Sets a memcpy node's parameters to copy from a symbol on the device.
hipError_t hipGraphRemoveDependencies(hipGraph_t graph, const hipGraphNode_t *from, const hipGraphNode_t *to, size_t numDependencies)
Removes dependency edges from a graph.
hipStreamCaptureMode
Definition hip_runtime_api.h:4358
hipError_t hipGraphMemcpyNodeSetParams1D(hipGraphNode_t node, void *dst, const void *src, size_t count, hipMemcpyKind kind)
Sets a memcpy node's parameters to perform a 1-dimensional copy.
hipError_t hipGraphExecMemcpyNodeSetParams1D(hipGraphExec_t hGraphExec, hipGraphNode_t node, void *dst, const void *src, size_t count, hipMemcpyKind kind)
Sets the parameters for a memcpy node in the given graphExec to perform a 1-dimensional copy.
hipGraphNodeType
Definition hip_runtime_api.h:4301
hipError_t hipGraphExecDestroy(hipGraphExec_t graphExec)
Destroys an executable graph.
hipError_t hipGraphExecHostNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, const hipHostNodeParams *pNodeParams)
Sets the parameters for a host node in the given graphExec.
hipError_t hipGraphExecChildGraphNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, hipGraph_t childGraph)
Updates node parameters in the child graph node in the given graphExec.
hipError_t hipStreamGetCaptureInfo(hipStream_t stream, hipStreamCaptureStatus *pCaptureStatus, unsigned long long *pId)
Get capture status of a stream.
hipError_t hipGraphAddDependencies(hipGraph_t graph, const hipGraphNode_t *from, const hipGraphNode_t *to, size_t numDependencies)
Adds dependency edges to a graph.
hipError_t hipGraphExecKernelNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, const hipKernelNodeParams *pNodeParams)
Sets the parameters for a kernel node in the given graphExec.
hipError_t hipGraphNodeGetDependentNodes(hipGraphNode_t node, hipGraphNode_t *pDependentNodes, size_t *pNumDependentNodes)
Returns a node's dependent nodes.
hipError_t hipGraphHostNodeGetParams(hipGraphNode_t node, hipHostNodeParams *pNodeParams)
Returns a host node's parameters.
hipError_t hipGraphInstantiateWithFlags(hipGraphExec_t *pGraphExec, hipGraph_t graph, unsigned long long flags)
Creates an executable graph from a graph.
hipError_t hipGraphExecMemcpyNodeSetParamsToSymbol(hipGraphExec_t hGraphExec, hipGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, hipMemcpyKind kind)
Sets the parameters for a memcpy node in the given graphExec to copy to a symbol on the device.
void(* hipHostFn_t)(void *userData)
Definition hip_runtime_api.h:4316
hipError_t hipGraphKernelNodeGetParams(hipGraphNode_t node, hipKernelNodeParams *pNodeParams)
Gets kernel node's parameters.
hipError_t hipGraphAddMemcpyNodeFromSymbol(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, hipMemcpyKind kind)
Creates a memcpy node to copy from a symbol on the device and adds it to a graph.
hipError_t hipGraphMemcpyNodeGetParams(hipGraphNode_t node, hipMemcpy3DParms *pNodeParams)
Gets a memcpy node's parameters.
hipError_t hipGraphAddEventRecordNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, hipEvent_t event)
Creates an event record node and adds it to a graph.
hipStreamUpdateCaptureDependenciesFlags
Definition hip_runtime_api.h:4370
struct ihipGraph * hipGraph_t
Definition hip_runtime_api.h:4286
hipError_t hipStreamUpdateCaptureDependencies(hipStream_t stream, hipGraphNode_t *dependencies, size_t numDependencies, unsigned int flags __dparm(0))
Update the set of dependencies in a capturing stream.
hipError_t hipStreamBeginCapture(hipStream_t stream, hipStreamCaptureMode mode)
Begins graph capture on a stream.
hipError_t hipStreamEndCapture(hipStream_t stream, hipGraph_t *pGraph)
Ends capture on a stream, returning the captured graph.
hipError_t hipGraphNodeGetType(hipGraphNode_t node, hipGraphNodeType *pType)
Returns a node's type.
hipError_t hipGraphExecMemcpyNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, hipMemcpy3DParms *pNodeParams)
Sets the parameters for a memcpy node in the given graphExec.
hipError_t hipGraphHostNodeSetParams(hipGraphNode_t node, const hipHostNodeParams *pNodeParams)
Sets a host node's parameters.
hipError_t hipGraphExecEventRecordNodeSetEvent(hipGraphExec_t hGraphExec, hipGraphNode_t hNode, hipEvent_t event)
Sets the event for an event record node in the given graphExec.
hipError_t hipGraphMemsetNodeGetParams(hipGraphNode_t node, hipMemsetParams *pNodeParams)
Gets a memset node's parameters.
hipError_t hipGraphChildGraphNodeGetGraph(hipGraphNode_t node, hipGraph_t *pGraph)
Gets a handle to the embedded graph of a child graph node.
hipError_t hipGraphLaunch(hipGraphExec_t graphExec, hipStream_t stream)
launches an executable graph in a stream
hipError_t hipGraphExecMemsetNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, const hipMemsetParams *pNodeParams)
Sets the parameters for a memset node in the given graphExec.
hipError_t hipGraphGetEdges(hipGraph_t graph, hipGraphNode_t *from, hipGraphNode_t *to, size_t *numEdges)
Returns a graph's dependency edges.
hipError_t hipGraphAddKernelNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, const hipKernelNodeParams *pNodeParams)
Creates a kernel execution node and adds it to a graph.
hipError_t hipGraphExecEventWaitNodeSetEvent(hipGraphExec_t hGraphExec, hipGraphNode_t hNode, hipEvent_t event)
Sets the event for an event record node in the given graphExec.
struct hipGraphExec * hipGraphExec_t
Definition hip_runtime_api.h:4294
hipGraphExecUpdateResult
Definition hip_runtime_api.h:4343
hipError_t hipGraphEventWaitNodeSetEvent(hipGraphNode_t node, hipEvent_t event)
Sets an event wait node's event.
hipError_t hipGraphEventRecordNodeSetEvent(hipGraphNode_t node, hipEvent_t event)
Sets an event record node's event.
hipStreamCaptureStatus
Definition hip_runtime_api.h:4363
hipError_t hipGraphEventWaitNodeGetEvent(hipGraphNode_t node, hipEvent_t *event_out)
Returns the event associated with an event wait node.
hipError_t hipGraphMemsetNodeSetParams(hipGraphNode_t node, const hipMemsetParams *pNodeParams)
Sets a memset node's parameters.
hipError_t hipGraphEventRecordNodeGetEvent(hipGraphNode_t node, hipEvent_t *event_out)
Returns the event associated with an event record node.
hipError_t hipGraphAddEmptyNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies)
Creates an empty node and adds it to a graph.
hipError_t hipGraphAddMemcpyNodeToSymbol(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, hipMemcpyKind kind)
Creates a memcpy node to copy to a symbol on the device and adds it to a graph.
hipError_t hipGraphDestroy(hipGraph_t graph)
Destroys a graph.
struct hipGraphNode * hipGraphNode_t
Definition hip_runtime_api.h:4290
hipError_t hipGraphExecMemcpyNodeSetParamsFromSymbol(hipGraphExec_t hGraphExec, hipGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, hipMemcpyKind kind)
Sets the parameters for a memcpy node in the given graphExec to copy from a symbol on the.
hipError_t hipGraphAddHostNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, const hipHostNodeParams *pNodeParams)
Creates a host execution node and adds it to a graph.
hipError_t hipGraphGetNodes(hipGraph_t graph, hipGraphNode_t *nodes, size_t *numNodes)
Returns graph nodes.
hipError_t hipGraphAddMemsetNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, const hipMemsetParams *pMemsetParams)
Creates a memset node and adds it to a graph.
hipError_t hipGraphInstantiate(hipGraphExec_t *pGraphExec, hipGraph_t graph, hipGraphNode_t *pErrorNode, char *pLogBuffer, size_t bufferSize)
Creates an executable graph from a graph.
hipError_t hipGraphClone(hipGraph_t *pGraphClone, hipGraph_t originalGraph)
Clones a graph.
hipError_t hipGraphGetRootNodes(hipGraph_t graph, hipGraphNode_t *pRootNodes, size_t *pNumRootNodes)
Returns graph's root nodes.
hipError_t hipGraphAddMemcpyNode(hipGraphNode_t *pGraphNode, hipGraph_t graph, const hipGraphNode_t *pDependencies, size_t numDependencies, const hipMemcpy3DParms *pCopyParams)
Creates a memcpy node and adds it to a graph.
hipError_t hipStreamGetCaptureInfo_v2(hipStream_t stream, hipStreamCaptureStatus *captureStatus_out, unsigned long long *id_out __dparm(0), hipGraph_t *graph_out __dparm(0), const hipGraphNode_t **dependencies_out __dparm(0), size_t *numDependencies_out __dparm(0))
Get stream's capture state.
@ hipStreamCaptureModeRelaxed
Definition hip_runtime_api.h:4361
@ hipStreamCaptureModeThreadLocal
Definition hip_runtime_api.h:4360
@ hipStreamCaptureModeGlobal
Definition hip_runtime_api.h:4359
@ hipGraphNodeTypeGraph
Node which executes an embedded graph.
Definition hip_runtime_api.h:4306
@ hipGraphNodeTypeMemset
Memset 1D node.
Definition hip_runtime_api.h:4304
@ hipGraphNodeTypeEventRecord
External event record node.
Definition hip_runtime_api.h:4309
@ hipGraphNodeTypeMemcpy
Memcpy 3D node.
Definition hip_runtime_api.h:4303
@ hipGraphNodeTypeWaitEvent
External event wait node.
Definition hip_runtime_api.h:4308
@ hipGraphNodeTypeMemcpy1D
Memcpy 1D node.
Definition hip_runtime_api.h:4310
@ hipGraphNodeTypeCount
Definition hip_runtime_api.h:4313
@ hipGraphNodeTypeKernel
GPU kernel node.
Definition hip_runtime_api.h:4302
@ hipGraphNodeTypeHost
Host (executable) node.
Definition hip_runtime_api.h:4305
@ hipGraphNodeTypeMemcpyFromSymbol
MemcpyFromSymbol node.
Definition hip_runtime_api.h:4311
@ hipGraphNodeTypeMemcpyToSymbol
MemcpyToSymbol node.
Definition hip_runtime_api.h:4312
@ hipGraphNodeTypeEmpty
Empty (no-op) node.
Definition hip_runtime_api.h:4307
@ hipStreamAddCaptureDependencies
Add new nodes to the dependency set.
Definition hip_runtime_api.h:4371
@ hipStreamSetCaptureDependencies
Replace the dependency set with the new nodes.
Definition hip_runtime_api.h:4372
@ hipGraphExecUpdateErrorNotSupported
The update failed because something about the node is not supported.
Definition hip_runtime_api.h:4353
@ hipGraphExecUpdateErrorNodeTypeChanged
The update failed because a node type changed.
Definition hip_runtime_api.h:4348
@ hipGraphExecUpdateErrorTopologyChanged
The update failed because the topology changed.
Definition hip_runtime_api.h:4347
@ hipGraphExecUpdateErrorUnsupportedFunctionChange
Definition hip_runtime_api.h:4355
@ hipGraphExecUpdateError
Definition hip_runtime_api.h:4345
@ hipGraphExecUpdateErrorFunctionChanged
The update failed because the function of a kernel node changed.
Definition hip_runtime_api.h:4349
@ hipGraphExecUpdateSuccess
The update succeeded.
Definition hip_runtime_api.h:4344
@ hipGraphExecUpdateErrorParametersChanged
The update failed because the parameters changed in a way that is not supported.
Definition hip_runtime_api.h:4351
@ hipStreamCaptureStatusInvalidated
Definition hip_runtime_api.h:4366
@ hipStreamCaptureStatusNone
Stream is not capturing.
Definition hip_runtime_api.h:4364
@ hipStreamCaptureStatusActive
Stream is actively capturing.
Definition hip_runtime_api.h:4365
hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray)
Frees a mipmapped array on the device.
hipError_t hipMemcpyToSymbol(const void *symbol, const void *src, size_t sizeBytes, size_t offset __dparm(0), hipMemcpyKind kind __dparm(hipMemcpyHostToDevice))
hipError_t hipDestroyExternalMemory(hipExternalMemory_t extMem)
Destroys an external memory object.
hipError_t hipStreamAttachMemAsync(hipStream_t stream, void *dev_ptr, size_t length __dparm(0), unsigned int flags __dparm(hipMemAttachSingle))
Attach memory to a stream asynchronously in HIP.
hipError_t hipImportExternalSemaphore(hipExternalSemaphore_t *extSem_out, const hipExternalSemaphoreHandleDesc *semHandleDesc)
Imports an external semaphore.
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory [Deprecated].
hipError_t hipMemcpy2DToArrayAsync(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device.
hipError_t hipGetMipmappedArrayLevel(hipArray_t *levelArray, hipMipmappedArray_const_t mipmappedArray, unsigned int level)
Gets a mipmap level of a HIP mipmapped array.
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 hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
hipError_t hipMemcpyFromSymbol(void *dst, const void *symbol, size_t sizeBytes, size_t offset __dparm(0), hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost))
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
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.
hipError_t hipMemcpy2DFromArrayAsync(void *dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipError_t hipMemGetInfo(size_t *free, size_t *total)
Query memory info. Return snapshot of free memory, and total allocatable memory on the device.
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
hipError_t hipImportExternalMemory(hipExternalMemory_t *extMem_out, const hipExternalMemoryHandleDesc *memHandleDesc)
Imports an external memory object.
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms *p, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent)
Fills synchronously the memory area pointed to by pitchedDevPtr with the constant value.
hipError_t hipModuleGetGlobal(hipDeviceptr_t *dptr, size_t *bytes, hipModule_t hmod, const char *name)
Returns a global pointer from a module. Returns in *dptr and *bytes the pointer and size of the globa...
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...
hipError_t hipMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t sizeBytes, size_t offset, hipMemcpyKind kind, hipStream_t stream __dparm(0))
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 HIP.
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
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 hipMemAdvise(const void *dev_ptr, size_t count, hipMemoryAdvise advice, int device)
Advise about the usage of a given memory range to HIP.
hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D *pCopy, hipStream_t stream)
Copies data between host and device asynchronously.
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
hipError_t hipMalloc3DArray(hipArray **array, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int flags)
Allocate an array on the device.
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 HIP.
hipError_t hipFree(void *ptr)
Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSy...
hipError_t hipMemcpyToSymbolAsync(const void *symbol, const void *src, size_t sizeBytes, size_t offset, hipMemcpyKind kind, hipStream_t stream __dparm(0))
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
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.
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 hipHostGetDevicePointer(void **devPtr, void *hstPtr, unsigned int flags)
Get Device pointer from Host Pointer allocated through hipHostMalloc.
hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D *pCopy, hipStream_t stream __dparm(0))
Copies memory for 2D arrays.
hipError_t hipDestroyExternalSemaphore(hipExternalSemaphore_t extSem)
Destroys an external semaphore object and releases any references to the underlying resource....
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 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 hipDrvMemcpy3D(const HIP_MEMCPY3D *pCopy)
Copies data between host and device.
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
hipError_t hipMemcpyParam2D(const hip_Memcpy2D *pCopy)
Copies memory for 2D arrays.
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 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 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 HIP.
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
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 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 hipArray3DCreate(hipArray **array, const HIP_ARRAY3D_DESCRIPTOR *pAllocateArray)
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 hipMallocManaged(void **dev_ptr, size_t size, unsigned int flags __dparm(hipMemAttachGlobal))
Allocates memory that will be automatically managed by HIP.
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
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 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 hipDrvPointerGetAttributes(unsigned int numAttributes, hipPointer_attribute *attributes, void **data, hipDeviceptr_t ptr)
Returns information about the specified pointer.[BETA].
hipError_t hipMalloc3D(hipPitchedPtr *pitchedDevPtr, hipExtent extent)
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 hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Device asynchronously.
hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes)
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 hipMemcpyDtoHAsync(void *dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Host asynchronously.
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.
hipError_t hipWaitExternalSemaphoresAsync(const hipExternalSemaphore_t *extSemArray, const hipExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, hipStream_t stream)
Waits on a set of external semaphore objects.
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 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 hipFreeArray(hipArray *array)
Frees an array on the device.
hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void *src, size_t sizeBytes, hipStream_t stream)
Copy data from Host to Device asynchronously.
hipError_t hipGetSymbolSize(size_t *size, const void *symbol)
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
hipError_t hipMemcpyWithStream(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream)
hipError_t hipSignalExternalSemaphoresAsync(const hipExternalSemaphore_t *extSemArray, const hipExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, hipStream_t stream)
Signals a set of external semaphore objects.
hipError_t hipGetSymbolAddress(void **devPtr, const void *symbol)
hipError_t hipArrayCreate(hipArray **pHandle, const HIP_ARRAY_DESCRIPTOR *pAllocateArray)
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
hipError_t hipPointerGetAttribute(void *data, hipPointer_attribute attribute, hipDeviceptr_t ptr)
Returns information about the specified pointer.[BETA].
hipError_t hipArrayDestroy(hipArray *array)
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
hipError_t hipMemPtrGetInfo(void *ptr, size_t *size)
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 hipExternalMemoryGetMappedBuffer(void **devPtr, hipExternalMemory_t extMem, const hipExternalMemoryBufferDesc *bufferDesc)
Maps a buffer onto an imported memory object.
hipError_t hipFuncGetAttributes(struct hipFuncAttributes *attr, const void *func)
Find out attributes for a given 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 hipExtLaunchMultiKernelMultiDevice(hipLaunchParams *launchParamsList, int numDevices, unsigned int flags)
Launches kernels on multiple devices and guarantees all specified kernels are dispatched on respectiv...
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 hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
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 hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
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 hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname)
Function with kname will be extracted if present in module.
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 hipModuleLoadData(hipModule_t *module, const void *image)
builds module from code object which resides in host memory. Image is pointer to that location.
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
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 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 hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
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 hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
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 hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer's memory.
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 hipDeviceDisablePeerAccess(int peerDeviceId)
Disable direct access from current device's virtual address space to memory allocations physically lo...
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
hipError_t hipStreamWriteValue64(hipStream_t stream, void *ptr, uint64_t value, unsigned int flags)
Enqueues a write command to the stream.[BETA].
hipError_t hipStreamWriteValue32(hipStream_t stream, void *ptr, uint32_t value, unsigned int flags)
Enqueues a write command to the stream.[BETA].
hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priority.
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
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...
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition hip_runtime_api.h:1702
hipError_t hipStreamQuery(hipStream_t stream)
Return hipSuccess if all of the operations in the specified stream have completed,...
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags)
Make the specified compute stream wait for an event.
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
hipError_t hipExtStreamCreateWithCUMask(hipStream_t *stream, uint32_t cuMaskSize, const uint32_t *cuMask)
Create an asynchronous stream with the specified CU mask.
hipError_t hipStreamGetPriority(hipStream_t stream, int *priority)
Query the priority of a stream.
hipError_t hipStreamWaitValue32(hipStream_t stream, void *ptr, uint32_t value, unsigned int flags, uint32_t mask __dparm(0xFFFFFFFF))
Enqueues a wait command to the stream.[BETA].
hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32_t *cuMask)
Get CU mask associated with an asynchronous stream.
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
hipError_t hipStreamWaitValue64(hipStream_t stream, void *ptr, uint64_t value, unsigned int flags, uint64_t mask __dparm(0xFFFFFFFFFFFFFFFF))
Enqueues a wait command to the stream.[BETA].
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
hipError_t hipTexRefGetFilterMode(enum hipTextureFilterMode *pfm, const textureReference *texRef)
hipError_t hipTexRefGetMipmapLevelClamp(float *pminMipmapLevelClamp, float *pmaxMipmapLevelClamp, const textureReference *texRef)
hipError_t hipTexRefGetAddressMode(enum hipTextureAddressMode *pam, const textureReference *texRef, int dim)
hipError_t hipTexRefGetFlags(unsigned int *pFlags, const textureReference *texRef)
hipError_t hipTexRefSetAddress(size_t *ByteOffset, textureReference *texRef, hipDeviceptr_t dptr, size_t bytes)
hipError_t hipTexRefGetMipmapFilterMode(enum hipTextureFilterMode *pfm, const textureReference *texRef)
hipError_t hipGetTextureAlignmentOffset(size_t *offset, const textureReference *texref)
hipError_t hipBindTexture2D(size_t *offset, const textureReference *tex, const void *devPtr, const hipChannelFormatDesc *desc, size_t width, size_t height, size_t pitch)
hipError_t hipTexRefGetMaxAnisotropy(int *pmaxAnsio, const textureReference *texRef)
hipError_t hipUnbindTexture(const textureReference *tex)
hipError_t hipTexRefGetAddress(hipDeviceptr_t *dev_ptr, const textureReference *texRef)
hipError_t hipTexRefGetMipMappedArray(hipMipmappedArray_t *pArray, const textureReference *texRef)
hipError_t hipTexRefSetMaxAnisotropy(textureReference *texRef, unsigned int maxAniso)
hipError_t hipTexRefGetMipmapLevelBias(float *pbias, const textureReference *texRef)
hipError_t hipBindTextureToArray(const textureReference *tex, hipArray_const_t array, const hipChannelFormatDesc *desc)
hipError_t hipBindTexture(size_t *offset, const textureReference *tex, const void *devPtr, const hipChannelFormatDesc *desc, size_t size __dparm(UINT_MAX))
hipError_t hipTexRefSetAddress2D(textureReference *texRef, const HIP_ARRAY_DESCRIPTOR *desc, hipDeviceptr_t dptr, size_t Pitch)
hipError_t hipTexRefGetFormat(hipArray_Format *pFormat, int *pNumChannels, const textureReference *texRef)
hipError_t hipBindTextureToMipmappedArray(const textureReference *tex, hipMipmappedArray_const_t mipmappedArray, const hipChannelFormatDesc *desc)
hipError_t hipTexRefSetFilterMode(textureReference *texRef, enum hipTextureFilterMode fm)
hipError_t hipTexObjectCreate(hipTextureObject_t *pTexObject, const HIP_RESOURCE_DESC *pResDesc, const HIP_TEXTURE_DESC *pTexDesc, const HIP_RESOURCE_VIEW_DESC *pResViewDesc)
hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc *pResDesc, hipTextureObject_t textureObject)
hipError_t hipTexRefSetFormat(textureReference *texRef, hipArray_Format fmt, int NumPackedComponents)
hipError_t hipGetTextureObjectResourceViewDesc(struct hipResourceViewDesc *pResViewDesc, hipTextureObject_t textureObject)
hipError_t hipTexObjectGetTextureDesc(HIP_TEXTURE_DESC *pTexDesc, hipTextureObject_t texObject)
hipError_t hipCreateTextureObject(hipTextureObject_t *pTexObject, const hipResourceDesc *pResDesc, const hipTextureDesc *pTexDesc, const struct hipResourceViewDesc *pResViewDesc)
hipError_t hipTexRefSetFlags(textureReference *texRef, unsigned int Flags)
hipError_t hipTexRefSetAddressMode(textureReference *texRef, int dim, enum hipTextureAddressMode am)
hipError_t hipTexObjectDestroy(hipTextureObject_t texObject)
hipError_t hipGetChannelDesc(hipChannelFormatDesc *desc, hipArray_const_t array)
hipError_t hipTexObjectGetResourceDesc(HIP_RESOURCE_DESC *pResDesc, hipTextureObject_t texObject)
hipError_t hipTexObjectGetResourceViewDesc(HIP_RESOURCE_VIEW_DESC *pResViewDesc, hipTextureObject_t texObject)
hipError_t hipTexRefSetArray(textureReference *tex, hipArray_const_t array, unsigned int flags)
hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject)
hipError_t hipGetTextureReference(const textureReference **texref, const void *symbol)
hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc *pTexDesc, hipTextureObject_t textureObject)
hipError_t hipTexRefSetMipmappedArray(textureReference *texRef, struct hipMipmappedArray *mipmappedArray, unsigned int Flags)
hipError_t hipMipmappedArrayGetLevel(hipArray_t *pLevelArray, hipMipmappedArray_t hMipMappedArray, unsigned int level)
hipError_t hipMipmappedArrayDestroy(hipMipmappedArray_t hMipmappedArray)
hipError_t hipMipmappedArrayCreate(hipMipmappedArray_t *pHandle, HIP_ARRAY3D_DESCRIPTOR *pMipmappedArrayDesc, unsigned int numMipmapLevels)
hipError_t hipTexRefSetMipmapLevelClamp(textureReference *texRef, float minMipMapLevelClamp, float maxMipMapLevelClamp)
hipError_t hipTexRefSetBorderColor(textureReference *texRef, float *pBorderColor)
hipError_t hipTexRefSetMipmapLevelBias(textureReference *texRef, float bias)
hipError_t hipTexRefSetMipmapFilterMode(textureReference *texRef, enum hipTextureFilterMode fm)
hipLimit_t
Definition hip_runtime_api.h:537
struct ihipCtx_t * hipCtx_t
Definition hip_runtime_api.h:504
#define __dparm(x)
Definition hip_runtime_api.h:488
struct ihipStream_t * hipStream_t
Definition hip_runtime_api.h:513
int hipDevice_t
Definition hip_runtime_api.h:506
struct ihipEvent_t * hipEvent_t
Definition hip_runtime_api.h:536
hipDeviceP2PAttr
Definition hip_runtime_api.h:507
#define DEPRECATED_MSG
Definition hip_runtime_api.h:480
struct ihipModule_t * hipModule_t
Definition hip_runtime_api.h:522
struct ihipModuleSymbol_t * hipFunction_t
Definition hip_runtime_api.h:523
#define DEPRECATED(msg)
Definition hip_runtime_api.h:478
hipMemoryType
Definition hip_runtime_api.h:156
#define HIP_IPC_HANDLE_SIZE
Definition hip_runtime_api.h:515
Definition driver_types.h:74
Definition driver_types.h:68
Definition driver_types.h:379
Definition driver_types.h:282
Definition driver_types.h:328
Definition driver_types.h:165
Definition hip_runtime_api.h:777
Definition driver_types.h:95
Definition driver_types.h:82
Definition driver_types.h:47
Definition hip_runtime_api.h:45
Definition hip_runtime_api.h:84
Definition driver_types.h:358
Definition hip_runtime_api.h:814
Definition hip_runtime_api.h:802
Definition hip_runtime_api.h:826
Definition hip_runtime_api.h:838
Definition hip_runtime_api.h:854
Definition hip_runtime_api.h:524
Definition hip_runtime_api.h:4317
Definition hip_runtime_api.h:519
Definition hip_runtime_api.h:516
Definition hip_runtime_api.h:4321
Definition hip_runtime_api.h:785
Definition driver_types.h:369
Definition hip_runtime_api.h:4329
Definition driver_types.h:117
Definition driver_types.h:352
Definition hip_runtime_api.h:169
Definition driver_types.h:258
Definition driver_types.h:314
Definition texture_types.h:109
Definition texture_types.h:88
Defines surface types for HIP runtime.
unsigned long long hipSurfaceObject_t
Definition surface_types.h:33
struct __hip_texture * hipTextureObject_t
Definition texture_types.h:63
hipTextureAddressMode
Definition texture_types.h:68
hipTextureFilterMode
Definition texture_types.h:78