HIP: Heterogenous-computing Interface for Portability
hip_runtime_api.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 //#pragma once
24 #ifndef HIP_INCLUDE_HIP_AMD_DETAIL_HIP_RUNTIME_API_H
25 #define HIP_INCLUDE_HIP_AMD_DETAIL_HIP_RUNTIME_API_H
26 
31 #include <stdint.h>
32 #include <stddef.h>
33 
34 #ifndef GENERIC_GRID_LAUNCH
35 #define GENERIC_GRID_LAUNCH 1
36 #endif
37 
39 #include <hip/amd_detail/driver_types.h>
42 
43 #if defined(_MSC_VER)
44 #define DEPRECATED(msg) __declspec(deprecated(msg))
45 #else // !defined(_MSC_VER)
46 #define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
47 #endif // !defined(_MSC_VER)
48 
49 #define DEPRECATED_MSG "This API is marked as deprecated and may not be supported in future releases. For more details please refer https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_deprecated_api_list.md"
50 
51 #define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
52 #define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
53 #define HIP_LAUNCH_PARAM_END ((void*)0x03)
54 
55 #ifdef __cplusplus
56  #define __dparm(x) \
57  = x
58 #else
59  #define __dparm(x)
60 #endif
61 
62 #ifdef __GNUC__
63 #pragma GCC visibility push (default)
64 #endif
65 
66 #ifdef __cplusplus
67 namespace hip_impl {
68 hipError_t hip_init();
69 } // namespace hip_impl
70 #endif
71 
72 // Structure definitions:
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 //---
78 // API-visible structures
79 typedef struct ihipCtx_t* hipCtx_t;
80 
81 // Note many APIs also use integer deviceIds as an alternative to the device pointer:
82 typedef int hipDevice_t;
83 
84 typedef enum hipDeviceP2PAttr {
85  hipDevP2PAttrPerformanceRank = 0,
86  hipDevP2PAttrAccessSupported,
87  hipDevP2PAttrNativeAtomicSupported,
88  hipDevP2PAttrHipArrayAccessSupported
89 } hipDeviceP2PAttr;
90 
91 typedef struct ihipStream_t* hipStream_t;
92 
93 #define hipIpcMemLazyEnablePeerAccess 0
94 
95 #define HIP_IPC_HANDLE_SIZE 64
96 
97 typedef struct hipIpcMemHandle_st {
98  char reserved[HIP_IPC_HANDLE_SIZE];
100 
101 typedef struct hipIpcEventHandle_st {
102  char reserved[HIP_IPC_HANDLE_SIZE];
104 
105 typedef struct ihipModule_t* hipModule_t;
106 
107 typedef struct ihipModuleSymbol_t* hipFunction_t;
108 
109 typedef struct hipFuncAttributes {
110  int binaryVersion;
111  int cacheModeCA;
112  size_t constSizeBytes;
113  size_t localSizeBytes;
114  int maxDynamicSharedSizeBytes;
115  int maxThreadsPerBlock;
116  int numRegs;
117  int preferredShmemCarveout;
118  int ptxVersion;
119  size_t sharedSizeBytes;
121 
122 typedef struct ihipEvent_t* hipEvent_t;
123 
124 enum hipLimit_t {
125  hipLimitMallocHeapSize = 0x02,
126 };
127 
132 #define hipStreamDefault \
134  0x00
135 #define hipStreamNonBlocking 0x01
136 
137 
139 #define hipEventDefault 0x0
140 #define hipEventBlockingSync \
141  0x1
142 #define hipEventDisableTiming \
143  0x2
144 #define hipEventInterprocess 0x4
145 #define hipEventReleaseToDevice \
146  0x40000000
147 #define hipEventReleaseToSystem \
150  0x80000000
151 
154 
156 #define hipHostMallocDefault 0x0
157 #define hipHostMallocPortable 0x1
158 #define hipHostMallocMapped \
159  0x2
160 #define hipHostMallocWriteCombined 0x4
162 #define hipHostMallocNumaUser \
163  0x20000000
164 
165 #define hipHostMallocCoherent \
166  0x40000000
167 #define hipHostMallocNonCoherent \
169  0x80000000
170 
172 #define hipMemAttachGlobal 0x01
173 #define hipMemAttachHost 0x02
174 #define hipMemAttachSingle 0x04
175 
177 #define hipDeviceMallocDefault 0x0
178 #define hipDeviceMallocFinegrained 0x1
179 #define hipMallocSignalMemory 0x2
180 
181 #define hipHostRegisterDefault 0x0
183 #define hipHostRegisterPortable 0x1
184 #define hipHostRegisterMapped \
185  0x2
186 #define hipHostRegisterIoMemory 0x4
188 #define hipExtHostRegisterCoarseGrained 0x8
189 
190 #define hipDeviceScheduleAuto 0x0
191 #define hipDeviceScheduleSpin \
192  0x1
193 #define hipDeviceScheduleYield \
195  0x2
196 #define hipDeviceScheduleBlockingSync 0x4
198 #define hipDeviceScheduleMask 0x7
199 
200 #define hipDeviceMapHost 0x8
201 #define hipDeviceLmemResizeToMax 0x16
202 
203 #define hipArrayDefault 0x00
204 #define hipArrayLayered 0x01
205 #define hipArraySurfaceLoadStore 0x02
206 #define hipArrayCubemap 0x04
207 #define hipArrayTextureGather 0x08
208 
209 #define hipOccupancyDefault 0x00
210 
211 #define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
212 #define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
213 
214 #define hipCpuDeviceId ((int)-1)
215 #define hipInvalidDeviceId ((int)-2)
216 
217 // Flags that can be used with hipExtLaunch Set of APIs
218 #define hipExtAnyOrderLaunch 0x01
219 
220 // Flags to be used with hipStreamWaitValue32 and hipStreamWaitValue64
221 #define hipStreamWaitValueGte 0x0
222 #define hipStreamWaitValueEq 0x1
223 #define hipStreamWaitValueAnd 0x2
224 #define hipStreamWaitValueNor 0x3
225 
226 /*
227  * @brief HIP Memory Advise values
228  * @enum
229  * @ingroup Enumerations
230  */
231 typedef enum hipMemoryAdvise {
243 
244 /*
245  * @brief HIP range attributes
246  * @enum
247  * @ingroup Enumerations
248  */
249 typedef enum hipMemRangeAttribute {
257 
258 /*
259  * @brief hipJitOption
260  * @enum
261  * @ingroup Enumerations
262  */
263 typedef enum hipJitOption {
264  hipJitOptionMaxRegisters = 0,
265  hipJitOptionThreadsPerBlock,
266  hipJitOptionWallTime,
267  hipJitOptionInfoLogBuffer,
268  hipJitOptionInfoLogBufferSizeBytes,
269  hipJitOptionErrorLogBuffer,
270  hipJitOptionErrorLogBufferSizeBytes,
271  hipJitOptionOptimizationLevel,
272  hipJitOptionTargetFromContext,
273  hipJitOptionTarget,
274  hipJitOptionFallbackStrategy,
275  hipJitOptionGenerateDebugInfo,
276  hipJitOptionLogVerbose,
277  hipJitOptionGenerateLineInfo,
278  hipJitOptionCacheMode,
279  hipJitOptionSm3xOpt,
280  hipJitOptionFastCompile,
281  hipJitOptionNumOptions
282 } hipJitOption;
283 
287 typedef enum hipFuncAttribute {
288  hipFuncAttributeMaxDynamicSharedMemorySize = 8,
289  hipFuncAttributePreferredSharedMemoryCarveout = 9,
290  hipFuncAttributeMax
292 
296 typedef enum hipFuncCache_t {
302 
306 typedef enum hipSharedMemConfig {
313 
318 typedef struct dim3 {
319  uint32_t x;
320  uint32_t y;
321  uint32_t z;
322 #ifdef __cplusplus
323  constexpr __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
324 #endif
326 
327 typedef struct hipLaunchParams_t {
328  void* func;
331  void **args;
332  size_t sharedMem;
333  hipStream_t stream;
335 
336 #if __HIP_HAS_GET_PCH
337 
342  void __hipGetPCH(const char** pch, unsigned int*size);
343 #endif
344 
345 
346 // Doxygen end group GlobalDefs
350 //-------------------------------------------------------------------------------------------------
351 
352 
353 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
354 // out-of-scope.
355 // typedef class ihipStream_t * hipStream_t;
356 
357 
358 /*
359  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
360  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
361  * out-of-scope but the true event is being written by some async queue or device */
362 // typedef struct hipEvent_t {
363 // struct ihipEvent_t *_handle;
364 //} hipEvent_t;
365 
366 
388 // TODO-ctx - more description on error codes.
389 hipError_t hipInit(unsigned int flags);
390 
406 hipError_t hipDriverGetVersion(int* driverVersion);
407 
420 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
421 
422 
430 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
431 
440 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
441 
450 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
451 
452 
462 hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr,
463  int srcDevice, int dstDevice);
464 
473 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
474 
475 
483 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
484 
485 
493 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
494 
495 
496 // doxygen end initialization
517 hipError_t hipDeviceSynchronize(void);
518 
519 
531 hipError_t hipDeviceReset(void);
532 
533 
565 hipError_t hipSetDevice(int deviceId);
566 
567 
581 hipError_t hipGetDevice(int* deviceId);
582 
583 
596 hipError_t hipGetDeviceCount(int* count);
597 
607 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
608 
622 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
623 
624 
635 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
636 
637 
648 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
649 
660 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
661 
662 
675 
683 hipError_t hipGetDeviceFlags(unsigned int* flags);
684 
697 
722 hipError_t hipSetDeviceFlags(unsigned flags);
723 
732 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
733 
746 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
747 
748 
749 // TODO: implement IPC apis
750 
776 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
777 
814 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
815 
834 hipError_t hipIpcCloseMemHandle(void* devPtr);
835 
836 
837 hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event);
838 hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
839 
840 // end doxygen Device
865 hipError_t hipFuncSetAttribute(const void* func, hipFuncAttribute attr, int value);
866 
877 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
878 
891 hipError_t hipFuncSetSharedMemConfig(const void* func, hipSharedMemConfig config);
892 
893 //doxygen end execution
917 hipError_t hipGetLastError(void);
918 
919 
930 hipError_t hipPeekAtLastError(void);
931 
932 
941 const char* hipGetErrorName(hipError_t hip_error);
942 
943 
954 const char* hipGetErrorString(hipError_t hipError);
955 
956 // end doxygen Error
989 hipError_t hipStreamCreate(hipStream_t* stream);
990 
991 
1009 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
1010 
1011 
1030 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
1031 
1032 
1047 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
1048 
1049 
1068 hipError_t hipStreamDestroy(hipStream_t stream);
1069 
1070 
1086 hipError_t hipStreamQuery(hipStream_t stream);
1087 
1088 
1108 hipError_t hipStreamSynchronize(hipStream_t stream);
1109 
1110 
1130 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
1131 
1132 
1146 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
1147 
1148 
1162 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
1163 
1164 
1184 hipError_t hipExtStreamCreateWithCUMask(hipStream_t* stream, uint32_t cuMaskSize, const uint32_t* cuMask);
1185 
1186 
1199 hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32_t* cuMask);
1200 
1204 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
1205 
1221 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
1222  unsigned int flags);
1223 
1224 
1225 // end doxygen Stream
1270 hipError_t hipStreamWaitValue32(hipStream_t stream, void* ptr, int32_t value, unsigned int flags,
1271  uint32_t mask __dparm(0xFFFFFFFF));
1272 
1303 hipError_t hipStreamWaitValue64(hipStream_t stream, void* ptr, int64_t value, unsigned int flags,
1304  uint64_t mask __dparm(0xFFFFFFFFFFFFFFFF));
1305 
1322 hipError_t hipStreamWriteValue32(hipStream_t stream, void* ptr, int32_t value, unsigned int flags);
1323 
1340 hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, int64_t value, unsigned int flags);
1341 
1342 
1343 // end doxygen Stream Memory Operations
1381 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
1382 
1383 
1395 hipError_t hipEventCreate(hipEvent_t* event);
1396 
1397 
1425 #ifdef __cplusplus
1426 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1427 #else
1428 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
1429 #endif
1430 
1447 hipError_t hipEventDestroy(hipEvent_t event);
1448 
1449 
1467 hipError_t hipEventSynchronize(hipEvent_t event);
1468 
1469 
1505 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1506 
1507 
1523 hipError_t hipEventQuery(hipEvent_t event);
1524 
1525 
1526 // end doxygen Events
1556 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1557 
1571 hipError_t hipMalloc(void** ptr, size_t size);
1572 
1587 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1588 
1601 DEPRECATED("use hipHostMalloc instead")
1602 hipError_t hipMallocHost(void** ptr, size_t size);
1603 
1616 DEPRECATED("use hipHostMalloc instead")
1617 hipError_t hipMemAllocHost(void** ptr, size_t size);
1618 
1632 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1633 
1654 hipError_t hipMallocManaged(void** dev_ptr,
1655  size_t size,
1656  unsigned int flags __dparm(hipMemAttachGlobal));
1657 
1668 hipError_t hipMemPrefetchAsync(const void* dev_ptr,
1669  size_t count,
1670  int device,
1671  hipStream_t stream __dparm(0));
1672 
1683 hipError_t hipMemAdvise(const void* dev_ptr,
1684  size_t count,
1685  hipMemoryAdvise advice,
1686  int device);
1687 
1700 hipError_t hipMemRangeGetAttribute(void* data,
1701  size_t data_size,
1702  hipMemRangeAttribute attribute,
1703  const void* dev_ptr,
1704  size_t count);
1705 
1720 hipError_t hipMemRangeGetAttributes(void** data,
1721  size_t* data_sizes,
1722  hipMemRangeAttribute* attributes,
1723  size_t num_attributes,
1724  const void* dev_ptr,
1725  size_t count);
1726 
1739 hipError_t hipStreamAttachMemAsync(hipStream_t stream,
1740  hipDeviceptr_t* dev_ptr,
1741  size_t length __dparm(0),
1742  unsigned int flags __dparm(hipMemAttachSingle));
1743 
1744 // end doxygen Managed Memory
1762 DEPRECATED("use hipHostMalloc instead")
1763 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1764 
1776 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1777 
1787 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1788 
1825 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1826 
1835 hipError_t hipHostUnregister(void* hostPtr);
1836 
1856 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1857 
1880 hipError_t hipMemAllocPitch(hipDeviceptr_t* dptr, size_t* pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes);
1881 
1895 hipError_t hipFree(void* ptr);
1896 
1907 DEPRECATED("use hipHostFree instead")
1908 hipError_t hipFreeHost(void* ptr);
1909 
1923 hipError_t hipHostFree(void* ptr);
1924 
1954 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1955 
1956 // TODO: Add description
1957 hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
1958  hipMemcpyKind kind, hipStream_t stream);
1976 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1977 
1995 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1996 
2014 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
2015 
2033 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
2034 
2052 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
2053 
2071 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
2072  hipStream_t stream);
2073 
2074 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
2075  hipModule_t hmod, const char* name);
2076 
2077 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol);
2078 hipError_t hipGetSymbolSize(size_t* size, const void* symbol);
2079 hipError_t hipMemcpyToSymbol(const void* symbol, const void* src,
2080  size_t sizeBytes, size_t offset __dparm(0),
2081  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
2082 hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src,
2083  size_t sizeBytes, size_t offset,
2084  hipMemcpyKind kind, hipStream_t stream __dparm(0));
2085 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbol,
2086  size_t sizeBytes, size_t offset __dparm(0),
2087  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
2088 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbol,
2089  size_t sizeBytes, size_t offset,
2090  hipMemcpyKind kind,
2091  hipStream_t stream __dparm(0));
2092 
2121 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
2122  hipStream_t stream __dparm(0));
2123 
2133 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
2134 
2144 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count);
2145 
2161 hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0));
2162 
2172 hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count);
2173 
2189 hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0));
2190 
2200 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
2201 
2217 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
2218 
2234 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
2235  hipStream_t stream __dparm(0));
2236 
2248 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
2249 
2262 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
2263 
2272 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
2273 
2283 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
2284 
2294 hipError_t hipMemGetInfo(size_t* free, size_t* total);
2295 
2296 
2297 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
2298 
2299 
2312 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
2313  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
2314 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
2315 
2316 hipError_t hipArrayDestroy(hipArray* array);
2317 
2318 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
2319 
2320 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
2321 
2330 hipError_t hipFreeArray(hipArray* array);
2331 
2339 hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray);
2340 
2353 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
2354  struct hipExtent extent, unsigned int flags);
2355 
2368  hipMipmappedArray_t *mipmappedArray,
2369  const struct hipChannelFormatDesc* desc,
2370  struct hipExtent extent,
2371  unsigned int numLevels,
2372  unsigned int flags __dparm(0));
2373 
2384  hipArray_t *levelArray,
2385  hipMipmappedArray_const_t mipmappedArray,
2386  unsigned int level);
2387 
2404 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2405  size_t height, hipMemcpyKind kind);
2406 
2416 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
2417 
2428 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
2429 
2447 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2448  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2449 
2467 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2468  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
2469 
2485 DEPRECATED(DEPRECATED_MSG)
2486 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2487  size_t count, hipMemcpyKind kind);
2488 
2504 DEPRECATED(DEPRECATED_MSG)
2505 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
2506  size_t count, hipMemcpyKind kind);
2507 
2525 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);
2526 
2545 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));
2546 
2560 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
2561 
2575 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2576 
2587 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2588 
2600 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2601 
2612 hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D* pCopy);
2613 
2625 hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D* pCopy, hipStream_t stream);
2626 
2627 // doxygen end Memory
2658 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2659 
2660 
2677 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2678 
2679 
2691 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2692 
2705 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2706 
2707 #ifndef USE_PEER_NON_UNIFIED
2708 #define USE_PEER_NON_UNIFIED 1
2709 #endif
2710 
2711 #if USE_PEER_NON_UNIFIED == 1
2712 
2723 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2724  size_t sizeBytes);
2725 
2738 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2739  size_t sizeBytes, hipStream_t stream __dparm(0));
2740 #endif
2741 
2742 
2743 // doxygen end PeerToPeer
2777 DEPRECATED(DEPRECATED_MSG)
2778 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2779 
2790 DEPRECATED(DEPRECATED_MSG)
2791 hipError_t hipCtxDestroy(hipCtx_t ctx);
2792 
2803 DEPRECATED(DEPRECATED_MSG)
2804 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2805 
2816 DEPRECATED(DEPRECATED_MSG)
2817 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2818 
2829 DEPRECATED(DEPRECATED_MSG)
2830 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2831 
2842 DEPRECATED(DEPRECATED_MSG)
2843 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2844 
2856 DEPRECATED(DEPRECATED_MSG)
2857 hipError_t hipCtxGetDevice(hipDevice_t* device);
2858 
2876 DEPRECATED(DEPRECATED_MSG)
2877 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2878 
2892 DEPRECATED(DEPRECATED_MSG)
2893 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2894 
2908 DEPRECATED(DEPRECATED_MSG)
2909 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2910 
2924 DEPRECATED(DEPRECATED_MSG)
2926 
2940 DEPRECATED(DEPRECATED_MSG)
2942 
2954 DEPRECATED(DEPRECATED_MSG)
2955 hipError_t hipCtxSynchronize(void);
2956 
2967 DEPRECATED(DEPRECATED_MSG)
2968 hipError_t hipCtxGetFlags(unsigned int* flags);
2969 
2989 DEPRECATED(DEPRECATED_MSG)
2990 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2991 
3008 DEPRECATED(DEPRECATED_MSG)
3009 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
3010 
3011 // doxygen end Context deprecated
3028 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
3029 
3042 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
3043 
3055 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
3056 
3067 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
3068 
3080 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
3081 
3082 // doxygen end Context Management
3106 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
3107 
3118 hipError_t hipModuleUnload(hipModule_t module);
3119 
3130 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
3131 
3141 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
3142 
3152 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
3153 
3163 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
3164 
3174 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
3175 
3188 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
3189  hipJitOption* options, void** optionValues);
3190 
3215 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
3216  unsigned int gridDimZ, unsigned int blockDimX,
3217  unsigned int blockDimY, unsigned int blockDimZ,
3218  unsigned int sharedMemBytes, hipStream_t stream,
3219  void** kernelParams, void** extra);
3220 
3236 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
3237  void** kernelParams, unsigned int sharedMemBytes,
3238  hipStream_t stream);
3239 
3251  int numDevices, unsigned int flags);
3252 
3253 
3266  int numDevices, unsigned int flags);
3267 
3268 
3269 // doxygen end Module
3294 //TODO - Match CUoccupancyB2DSize
3295 hipError_t hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3296  hipFunction_t f, size_t dynSharedMemPerBlk,
3297  int blockSizeLimit);
3298 
3311 //TODO - Match CUoccupancyB2DSize
3312 hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3313  hipFunction_t f, size_t dynSharedMemPerBlk,
3314  int blockSizeLimit, unsigned int flags);
3315 
3325  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk);
3326 
3337  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
3338 
3348  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk);
3349 
3360  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
3361 
3373 hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3374  const void* f, size_t dynSharedMemPerBlk,
3375  int blockSizeLimit);
3376 
3377 // doxygen end Occupancy
3395 // TODO - expand descriptions:
3401 DEPRECATED("use roctracer/rocTX instead")
3402 hipError_t hipProfilerStart();
3403 
3404 
3410 DEPRECATED("use roctracer/rocTX instead")
3411 hipError_t hipProfilerStop();
3412 
3413 // doxygen end profiler
3439 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3440 
3441 
3452 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3453 
3454 
3463 hipError_t hipLaunchByPtr(const void* func);
3464 
3465 
3481  dim3 blockDim,
3482  size_t sharedMem __dparm(0),
3483  hipStream_t stream __dparm(0));
3484 
3498 hipError_t __hipPopCallConfiguration(dim3 *gridDim,
3499  dim3 *blockDim,
3500  size_t *sharedMem,
3501  hipStream_t *stream);
3502 
3518 hipError_t hipLaunchKernel(const void* function_address,
3519  dim3 numBlocks,
3520  dim3 dimBlocks,
3521  void** args,
3522  size_t sharedMemBytes __dparm(0),
3523  hipStream_t stream __dparm(0));
3531 hipError_t hipDrvMemcpy2DUnaligned(const hip_Memcpy2D* pCopy);
3532 
3533 //TODO: Move this to hip_ext.h
3534 hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks, dim3 dimBlocks,
3535  void** args, size_t sharedMemBytes, hipStream_t stream,
3536  hipEvent_t startEvent, hipEvent_t stopEvent, int flags);
3537 // doxygen end Clang launch
3558 DEPRECATED(DEPRECATED_MSG)
3559 hipError_t hipBindTexture(
3560  size_t* offset,
3561  const textureReference* tex,
3562  const void* devPtr,
3563  const hipChannelFormatDesc* desc,
3564  size_t size __dparm(UINT_MAX));
3565 
3566 DEPRECATED(DEPRECATED_MSG)
3567 hipError_t hipBindTexture2D(
3568  size_t* offset,
3569  const textureReference* tex,
3570  const void* devPtr,
3571  const hipChannelFormatDesc* desc,
3572  size_t width,
3573  size_t height,
3574  size_t pitch);
3575 
3576 DEPRECATED(DEPRECATED_MSG)
3577 hipError_t hipBindTextureToArray(
3578  const textureReference* tex,
3579  hipArray_const_t array,
3580  const hipChannelFormatDesc* desc);
3581 
3582 DEPRECATED(DEPRECATED_MSG)
3583 hipError_t hipGetTextureAlignmentOffset(
3584  size_t* offset,
3585  const textureReference* texref);
3586 
3587 DEPRECATED(DEPRECATED_MSG)
3588 hipError_t hipUnbindTexture(const textureReference* tex);
3589 
3590 // doxygen end deprecated texture management
3595 hipError_t hipBindTextureToMipmappedArray(
3596  const textureReference* tex,
3597  hipMipmappedArray_const_t mipmappedArray,
3598  const hipChannelFormatDesc* desc);
3599 
3600  hipError_t hipGetTextureReference(
3601  const textureReference** texref,
3602  const void* symbol);
3603 
3604 hipError_t hipCreateTextureObject(
3605  hipTextureObject_t* pTexObject,
3606  const hipResourceDesc* pResDesc,
3607  const hipTextureDesc* pTexDesc,
3608  const struct hipResourceViewDesc* pResViewDesc);
3609 
3610 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3611 
3612 hipError_t hipGetChannelDesc(
3613  hipChannelFormatDesc* desc,
3614  hipArray_const_t array);
3615 
3616 hipError_t hipGetTextureObjectResourceDesc(
3617  hipResourceDesc* pResDesc,
3618  hipTextureObject_t textureObject);
3619 
3620 hipError_t hipGetTextureObjectResourceViewDesc(
3621  struct hipResourceViewDesc* pResViewDesc,
3622  hipTextureObject_t textureObject);
3623 
3624 hipError_t hipGetTextureObjectTextureDesc(
3625  hipTextureDesc* pTexDesc,
3626  hipTextureObject_t textureObject);
3627 
3628 hipError_t hipTexRefGetAddress(
3629  hipDeviceptr_t* dev_ptr,
3630  const textureReference* texRef);
3631 
3632 hipError_t hipTexRefGetAddressMode(
3633  enum hipTextureAddressMode* pam,
3634  const textureReference* texRef,
3635  int dim);
3636 
3637 hipError_t hipTexRefGetFilterMode(
3638  enum hipTextureFilterMode* pfm,
3639  const textureReference* texRef);
3640 
3641 hipError_t hipTexRefGetFlags(
3642  unsigned int* pFlags,
3643  const textureReference* texRef);
3644 
3645 hipError_t hipTexRefGetFormat(
3646  hipArray_Format* pFormat,
3647  int* pNumChannels,
3648  const textureReference* texRef);
3649 
3650 hipError_t hipTexRefGetMaxAnisotropy(
3651  int* pmaxAnsio,
3652  const textureReference* texRef);
3653 
3654 hipError_t hipTexRefGetMipmapFilterMode(
3655  enum hipTextureFilterMode* pfm,
3656  const textureReference* texRef);
3657 
3658 hipError_t hipTexRefGetMipmapLevelBias(
3659  float* pbias,
3660  const textureReference* texRef);
3661 
3662 hipError_t hipTexRefGetMipmapLevelClamp(
3663  float* pminMipmapLevelClamp,
3664  float* pmaxMipmapLevelClamp,
3665  const textureReference* texRef);
3666 
3667 hipError_t hipTexRefGetMipMappedArray(
3668  hipMipmappedArray_t* pArray,
3669  const textureReference* texRef);
3670 
3671 hipError_t hipTexRefSetAddress(
3672  size_t* ByteOffset,
3673  textureReference* texRef,
3674  hipDeviceptr_t dptr,
3675  size_t bytes);
3676 
3677 hipError_t hipTexRefSetAddress2D(
3678  textureReference* texRef,
3679  const HIP_ARRAY_DESCRIPTOR* desc,
3680  hipDeviceptr_t dptr,
3681  size_t Pitch);
3682 
3683 hipError_t hipTexRefSetAddressMode(
3684  textureReference* texRef,
3685  int dim,
3686  enum hipTextureAddressMode am);
3687 
3688 hipError_t hipTexRefSetArray(
3689  textureReference* tex,
3690  hipArray_const_t array,
3691  unsigned int flags);
3692 
3693 hipError_t hipTexRefSetFilterMode(
3694  textureReference* texRef,
3695  enum hipTextureFilterMode fm);
3696 
3697 hipError_t hipTexRefSetFlags(
3698  textureReference* texRef,
3699  unsigned int Flags);
3700 
3701 hipError_t hipTexRefSetFormat(
3702  textureReference* texRef,
3703  hipArray_Format fmt,
3704  int NumPackedComponents);
3705 
3706 hipError_t hipTexRefSetMaxAnisotropy(
3707  textureReference* texRef,
3708  unsigned int maxAniso);
3709 
3710 hipError_t hipTexObjectCreate(
3711  hipTextureObject_t* pTexObject,
3712  const HIP_RESOURCE_DESC* pResDesc,
3713  const HIP_TEXTURE_DESC* pTexDesc,
3714  const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
3715 
3716 hipError_t hipTexObjectDestroy(
3717  hipTextureObject_t texObject);
3718 
3719 hipError_t hipTexObjectGetResourceDesc(
3720  HIP_RESOURCE_DESC* pResDesc,
3721  hipTextureObject_t texObject);
3722 
3723 hipError_t hipTexObjectGetResourceViewDesc(
3724  HIP_RESOURCE_VIEW_DESC* pResViewDesc,
3725  hipTextureObject_t texObject);
3726 
3727 hipError_t hipTexObjectGetTextureDesc(
3728  HIP_TEXTURE_DESC* pTexDesc,
3729  hipTextureObject_t texObject);
3730 
3731 // doxygen end Texture management
3736 // The following are not supported.
3737 hipError_t hipTexRefSetBorderColor(
3738  textureReference* texRef,
3739  float* pBorderColor);
3740 
3741 hipError_t hipTexRefSetMipmapFilterMode(
3742  textureReference* texRef,
3743  enum hipTextureFilterMode fm);
3744 
3745 hipError_t hipTexRefSetMipmapLevelBias(
3746  textureReference* texRef,
3747  float bias);
3748 
3749 hipError_t hipTexRefSetMipmapLevelClamp(
3750  textureReference* texRef,
3751  float minMipMapLevelClamp,
3752  float maxMipMapLevelClamp);
3753 
3754 hipError_t hipTexRefSetMipmappedArray(
3755  textureReference* texRef,
3756  struct hipMipmappedArray* mipmappedArray,
3757  unsigned int Flags);
3758 
3759 hipError_t hipMipmappedArrayCreate(
3760  hipMipmappedArray_t* pHandle,
3761  HIP_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc,
3762  unsigned int numMipmapLevels);
3763 
3764 hipError_t hipMipmappedArrayDestroy(
3765  hipMipmappedArray_t hMipmappedArray);
3766 
3767 hipError_t hipMipmappedArrayGetLevel(
3768  hipArray_t* pLevelArray,
3769  hipMipmappedArray_t hMipMappedArray,
3770  unsigned int level);
3771 
3775 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3776 hipError_t hipRemoveApiCallback(uint32_t id);
3777 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3778 hipError_t hipRemoveActivityCallback(uint32_t id);
3779 const char* hipApiName(uint32_t id);
3780 const char* hipKernelNameRef(const hipFunction_t f);
3781 const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream);
3782 int hipGetStreamDeviceId(hipStream_t stream);
3783 
3784 #ifdef __cplusplus
3785 } /* extern "c" */
3786 #endif
3787 
3788 
3789 #if USE_PROF_API
3790 #include <hip/amd_detail/hip_prof_str.h>
3791 #endif
3792 
3793 #ifdef __cplusplus
3794 
3795 #if defined(__clang__) && defined(__HIP__)
3796 template <typename T>
3797 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3798  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0) {
3799  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3800 }
3801 
3802 template <typename T>
3803 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3804  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0, unsigned int flags = 0 ) {
3805  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3806 }
3807 #endif // defined(__clang__) && defined(__HIP__)
3808 
3809 template <typename T>
3810 hipError_t hipGetSymbolAddress(void** devPtr, const T &symbol) {
3811  return ::hipGetSymbolAddress(devPtr, (const void *)&symbol);
3812 }
3813 
3814 template <typename T>
3815 hipError_t hipGetSymbolSize(size_t* size, const T &symbol) {
3816  return ::hipGetSymbolSize(size, (const void *)&symbol);
3817 }
3818 
3819 template <typename T>
3820 hipError_t hipMemcpyToSymbol(const T& symbol, const void* src, size_t sizeBytes,
3821  size_t offset __dparm(0),
3822  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
3823  return ::hipMemcpyToSymbol((const void*)&symbol, src, sizeBytes, offset, kind);
3824 }
3825 
3826 template <typename T>
3827 hipError_t hipMemcpyToSymbolAsync(const T& symbol, const void* src, size_t sizeBytes, size_t offset,
3828  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3829  return ::hipMemcpyToSymbolAsync((const void*)&symbol, src, sizeBytes, offset, kind, stream);
3830 }
3831 
3832 template <typename T>
3833 hipError_t hipMemcpyFromSymbol(void* dst, const T &symbol,
3834  size_t sizeBytes, size_t offset __dparm(0),
3835  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
3836  return ::hipMemcpyFromSymbol(dst, (const void*)&symbol, sizeBytes, offset, kind);
3837 }
3838 
3839 template <typename T>
3840 hipError_t hipMemcpyFromSymbolAsync(void* dst, const T& symbol, size_t sizeBytes, size_t offset,
3841  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3842  return ::hipMemcpyFromSymbolAsync(dst, (const void*)&symbol, sizeBytes, offset, kind, stream);
3843 }
3844 
3845 template <class T>
3847  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk) {
3849  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk);
3850 }
3851 
3852 template <class T>
3854  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
3856  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk, flags);
3857 }
3858 
3859 template <typename F>
3860 inline hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3861  F kernel, size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
3862 return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize,(hipFunction_t)kernel, dynSharedMemPerBlk, blockSizeLimit);
3863 }
3864 
3865 template <class T>
3866 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
3867  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
3868  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
3869  blockDim, kernelParams, sharedMemBytes, stream);
3870 }
3871 
3872 template <class T>
3873 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3874  unsigned int numDevices, unsigned int flags = 0) {
3875  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
3876 }
3877 
3878 template <class T>
3879 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
3880  unsigned int numDevices, unsigned int flags = 0) {
3881  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
3882 }
3883 
3884 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
3885 
3886 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
3887 
3888 template <class T, int dim, enum hipTextureReadMode readMode>
3889 DEPRECATED(DEPRECATED_MSG)
3890 static inline hipError_t hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex,
3891  const void* devPtr, size_t size = UINT_MAX) {
3892  return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
3893 }
3894 
3895 template <class T, int dim, enum hipTextureReadMode readMode>
3896 DEPRECATED(DEPRECATED_MSG)
3897 static inline hipError_t
3898  hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex, const void* devPtr,
3899  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3900  return hipBindTexture(offset, &tex, devPtr, &desc, size);
3901 }
3902 
3903 template<class T, int dim, enum hipTextureReadMode readMode>
3904 DEPRECATED(DEPRECATED_MSG)
3905 static inline hipError_t hipBindTexture2D(
3906  size_t *offset,
3907  const struct texture<T, dim, readMode> &tex,
3908  const void *devPtr,
3909  size_t width,
3910  size_t height,
3911  size_t pitch)
3912 {
3913  return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
3914 }
3915 
3916 template<class T, int dim, enum hipTextureReadMode readMode>
3917 DEPRECATED(DEPRECATED_MSG)
3918 static inline hipError_t hipBindTexture2D(
3919  size_t *offset,
3920  const struct texture<T, dim, readMode> &tex,
3921  const void *devPtr,
3922  const struct hipChannelFormatDesc &desc,
3923  size_t width,
3924  size_t height,
3925  size_t pitch)
3926 {
3927  return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
3928 }
3929 
3930 template<class T, int dim, enum hipTextureReadMode readMode>
3931 DEPRECATED(DEPRECATED_MSG)
3932 static inline hipError_t hipBindTextureToArray(
3933  const struct texture<T, dim, readMode> &tex,
3934  hipArray_const_t array)
3935 {
3936  struct hipChannelFormatDesc desc;
3937  hipError_t err = hipGetChannelDesc(&desc, array);
3938  return (err == hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
3939 }
3940 
3941 template<class T, int dim, enum hipTextureReadMode readMode>
3942 DEPRECATED(DEPRECATED_MSG)
3943 static inline hipError_t hipBindTextureToArray(
3944  const struct texture<T, dim, readMode> &tex,
3945  hipArray_const_t array,
3946  const struct hipChannelFormatDesc &desc)
3947 {
3948  return hipBindTextureToArray(&tex, array, &desc);
3949 }
3950 
3951 template<class T, int dim, enum hipTextureReadMode readMode>
3952 static inline hipError_t hipBindTextureToMipmappedArray(
3953  const struct texture<T, dim, readMode> &tex,
3954  hipMipmappedArray_const_t mipmappedArray)
3955 {
3956  struct hipChannelFormatDesc desc;
3957  hipArray_t levelArray;
3958  hipError_t err = hipGetMipmappedArrayLevel(&levelArray, mipmappedArray, 0);
3959  if (err != hipSuccess) {
3960  return err;
3961  }
3962  err = hipGetChannelDesc(&desc, levelArray);
3963  return (err == hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
3964 }
3965 
3966 template<class T, int dim, enum hipTextureReadMode readMode>
3967 static inline hipError_t hipBindTextureToMipmappedArray(
3968  const struct texture<T, dim, readMode> &tex,
3969  hipMipmappedArray_const_t mipmappedArray,
3970  const struct hipChannelFormatDesc &desc)
3971 {
3972  return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
3973 }
3974 
3975 template<class T, int dim, enum hipTextureReadMode readMode>
3976 DEPRECATED(DEPRECATED_MSG)
3977 static inline hipError_t hipUnbindTexture(
3978  const struct texture<T, dim, readMode> &tex)
3979 {
3980  return hipUnbindTexture(&tex);
3981 }
3982 
3983 #endif // __cplusplus
3984 
3985 #ifdef __GNUC__
3986 #pragma GCC visibility pop
3987 #endif
3988 
3989 // doxygen end HIP API
3994 #endif // HIP_INCLUDE_HIP_AMD_DETAIL_HIP_RUNTIME_API_H
hipFuncAttributes
Definition: hip_runtime_api.h:109
hipPointerGetAttributes
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
hipMemset3DAsync
hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent, hipStream_t stream __dparm(0))
Fills asynchronously the memory area pointed to by pitchedDevPtr with the constant value.
hipMemAdviseUnsetAccessedBy
@ hipMemAdviseUnsetAccessedBy
Definition: hip_runtime_api.h:240
hipMemcpy3D
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
hipIpcOpenMemHandle
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...
hipCtxEnablePeerAccess
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
hipMallocPitch
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
hipSetDevice
hipError_t hipSetDevice(int deviceId)
Set default device to be used for subsequent hip API calls from this thread.
hipDeviceGetP2PAttribute
hipError_t hipDeviceGetP2PAttribute(int *value, hipDeviceP2PAttr attr, int srcDevice, int dstDevice)
Returns a value for attr of link between two devices.
hipMemsetD16Async
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...
hipMemcpy2DFromArrayAsync
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.
hipGetErrorString
const char * hipGetErrorString(hipError_t hipError)
Return handy text string message to explain the error which occurred.
hipMemRangeGetAttributes
hipError_t hipMemRangeGetAttributes(void **data, size_t *data_sizes, hipMemRangeAttribute *attributes, size_t num_attributes, const void *dev_ptr, size_t count)
Query attributes of a given memory range in AMD HMM.
hipGetDeviceFlags
hipError_t hipGetDeviceFlags(unsigned int *flags)
Gets the flags set for current device.
hipDeviceGetByPCIBusId
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
hipMalloc3DArray
hipError_t hipMalloc3DArray(hipArray **array, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int flags)
Allocate an array on the device.
hipChooseDevice
hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop)
Device which matches hipDeviceProp_t is returned.
hipMemcpy2DAsync
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.
hipLaunchKernel
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.
hipMemsetD32
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...
hipStreamWriteValue64
hipError_t hipStreamWriteValue64(hipStream_t stream, void *ptr, int64_t value, unsigned int flags)
Enqueues a write command to the stream.
hipStreamCreate
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
hipDeviceGetStreamPriorityRange
hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priority.
hipIpcEventHandle_st
Definition: hip_runtime_api.h:101
hipStreamCreateWithPriority
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
hipMemAdviseUnsetReadMostly
@ hipMemAdviseUnsetReadMostly
Undo the effect of hipMemAdviseSetReadMostly.
Definition: hip_runtime_api.h:234
hipFuncCache_t
hipFuncCache_t
Definition: hip_runtime_api.h:296
hipPeekAtLastError
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault))
Returns occupancy for a device function.
hipModuleGetTexRef
hipError_t hipModuleGetTexRef(textureReference **texRef, hipModule_t hmod, const char *name)
returns the handle of the texture reference with the name from the module.
hipMemcpy3DAsync
hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms *p, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipDeviceGetPCIBusId
hipError_t hipDeviceGetPCIBusId(char *pciBusId, int len, int device)
Returns a PCI Bus Id string for the device, overloaded to take int device ID.
hipHostGetFlags
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
hipMemGetAddressRange
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
hipMemRangeAttributePreferredLocation
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:252
hipSurfaceObject_t
unsigned long long hipSurfaceObject_t
Definition: hip_surface_types.h:36
hipStreamWaitEvent
hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags)
Make the specified compute stream wait for an event.
hipFuncCachePreferEqual
@ hipFuncCachePreferEqual
prefer equal size L1 cache and shared memory
Definition: hip_runtime_api.h:300
hipGetDevice
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
hipMallocArray
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.
hipCtxSetCurrent
hipError_t hipCtxSetCurrent(hipCtx_t ctx)
Set the passed context as current/default.
hipMemcpyToArray
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.
HIP_MEMCPY3D
Definition: driver_types.h:398
hipMemcpyDtoDAsync
hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Device asynchronously.
hipMemcpy2DFromArray
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.
hipModuleOccupancyMaxPotentialBlockSizeWithFlags
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
hipDevicePrimaryCtxRelease
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
hipHostMalloc
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
dim3::y
uint32_t y
y
Definition: hip_runtime_api.h:320
hipMemRangeGetAttribute
hipError_t hipMemRangeGetAttribute(void *data, size_t data_size, hipMemRangeAttribute attribute, const void *dev_ptr, size_t count)
Query an attribute of a given memory range in AMD HMM.
hipDeviceGetName
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
hipMemcpyParam2DAsync
hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D *pCopy, hipStream_t stream __dparm(0))
Copies memory for 2D arrays.
hipMemAdvise
hipError_t hipMemAdvise(const void *dev_ptr, size_t count, hipMemoryAdvise advice, int device)
Advise about the usage of a given memory range to AMD HMM.
hipDeviceEnablePeerAccess
hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags)
Enable direct access from current device's virtual address space to memory allocations physically loc...
hipCtxSetCacheConfig
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipStreamWaitValue32
hipError_t hipStreamWaitValue32(hipStream_t stream, void *ptr, int32_t value, unsigned int flags, uint32_t mask __dparm(0xFFFFFFFF))
Enqueues a wait command to the stream.
hipMallocMipmappedArray
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.
hipCtxPushCurrent
hipError_t hipCtxPushCurrent(hipCtx_t ctx)
Push the context to be set as current/ default context.
hipSharedMemConfig
hipSharedMemConfig
Definition: hip_runtime_api.h:306
hipDrvMemcpy3D
hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D *pCopy)
Copies data between host and device.
dim3::x
uint32_t x
x
Definition: hip_runtime_api.h:319
hipDeviceComputeCapability
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
hipStreamCallback_t
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:1204
hipMemoryAdvise
hipMemoryAdvise
Definition: hip_runtime_api.h:231
hip_Memcpy2D
Definition: driver_types.h:95
hipGetMipmappedArrayLevel
hipError_t hipGetMipmappedArrayLevel(hipArray_t *levelArray, hipMipmappedArray_const_t mipmappedArray, unsigned int level)
Gets a mipmap level of a HIP mipmapped array.
hipModuleOccupancyMaxPotentialBlockSize
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
__hipPushCallConfiguration
hipError_t __hipPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Push configuration of a kernel launch.
hipIpcCloseMemHandle
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
hipDevicePrimaryCtxGetState
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
hipLaunchCooperativeKernelMultiDevice
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...
hipDeviceSetCacheConfig
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipMemcpyAtoH
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
hipGetDeviceCount
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
hipSuccess
hipSuccess
Successful completion.
Definition: hip_runtime_api.h:204
hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
hipSetupArgument
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
hipHostUnregister
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
hipStreamGetFlags
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
hipMemsetD8Async
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...
hipExtStreamCreateWithCUMask
hipError_t hipExtStreamCreateWithCUMask(hipStream_t *stream, uint32_t cuMaskSize, const uint32_t *cuMask)
Create an asynchronous stream with the specified CU mask.
hipMemRangeAttributeReadMostly
@ hipMemRangeAttributeReadMostly
Definition: hip_runtime_api.h:250
hipStreamSynchronize
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
hip_texture_types.h
Defines the different newt vector types for HIP runtime.
hipGetErrorName
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
dim3
struct dim3 dim3
hipDeviceGet
hipError_t hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
__host__
#define __host__
Definition: host_defines.h:59
hipMemcpyDtoD
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
hipMemcpy3DParms
Definition: driver_types.h:387
hipIpcGetMemHandle
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
hipMemcpyHtoD
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
hipDriverGetVersion
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
hipCtxGetFlags
hipError_t hipCtxGetFlags(unsigned int *flags)
Return flags used for creating default context.
hipMemcpy2DToArray
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.
hipMemAllocPitch
hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes)
hipDeviceProp_t
Definition: hip_runtime_api.h:84
hipMemAllocHost
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:947
hipMallocHost
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:941
hip_surface_types.h
Defines surface types for HIP runtime.
host_defines.h
TODO-doc.
hipMemsetD32Async
hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count, hipStream_t stream __dparm(0))
Fills the memory area pointed to by dev with the constant integer value for specified number of times...
hipMemRangeAttributeAccessedBy
@ hipMemRangeAttributeAccessedBy
Definition: hip_runtime_api.h:253
hipRuntimeGetVersion
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
hipConfigureCall
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Configure a kernel launch.
hipLaunchCooperativeKernel
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...
hipEventQuery
hipError_t hipEventQuery(hipEvent_t event)
Query event status.
hipExtLaunchMultiKernelMultiDevice
hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams *launchParamsList, int numDevices, unsigned int flags)
Launches kernels on multiple devices and guarantees all specified kernels are dispatched on respectiv...
hipStreamGetPriority
hipError_t hipStreamGetPriority(hipStream_t stream, int *priority)
Query the priority of a stream.
hipOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
hipCtxGetApiVersion
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion)
Returns the approximate HIP api version.
hipSharedMemBankSizeFourByte
@ hipSharedMemBankSizeFourByte
Definition: hip_runtime_api.h:308
hipEventSynchronize
hipError_t hipEventSynchronize(hipEvent_t event)
Wait for an event to complete.
hipFuncCachePreferNone
@ hipFuncCachePreferNone
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:297
hipCtxCreate
hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device)
Create a context and set it as current/ default context.
hipHostFree
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
hipMemsetD16
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...
hipMipmappedArray
Definition: driver_types.h:120
hipDeviceGetLimit
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
hipLaunchParams_t::args
void ** args
Arguments.
Definition: hip_runtime_api.h:331
hipMalloc
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
hipIpcMemHandle_st
Definition: hip_runtime_api.h:97
hipEventElapsedTime
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
hipGetLastError
hipError_t hipGetLastError(void)
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess...
hipInit
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
HIP_TEXTURE_DESC_st
Definition: driver_types.h:170
hipFuncSetCacheConfig
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
hipCtxPopCurrent
hipError_t hipCtxPopCurrent(hipCtx_t *ctx)
Pop the current/default context and return the popped context.
hipArray
Definition: driver_types.h:82
hipHostGetDevicePointer
hipError_t hipHostGetDevicePointer(void **devPtr, void *hstPtr, unsigned int flags)
Get Device pointer from Host Pointer allocated through hipHostMalloc.
hipMemGetInfo
hipError_t hipMemGetInfo(size_t *free, size_t *total)
Query memory info. Return snapshot of free memory, and total allocatable memory on the device.
hipEventDestroy
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
hipDeviceSetSharedMemConfig
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
hipDeviceReset
hipError_t hipDeviceReset(void)
The state of current device is discarded and updated to a fresh state.
hipSetDeviceFlags
hipError_t hipSetDeviceFlags(unsigned flags)
The current device behavior is changed according the flags passed.
hipCtxGetCurrent
hipError_t hipCtxGetCurrent(hipCtx_t *ctx)
Get the handle of the current/ default context.
hipFuncGetAttributes
hipError_t hipFuncGetAttributes(struct hipFuncAttributes *attr, const void *func)
Find out attributes for a given function.
HIP_ARRAY3D_DESCRIPTOR
Definition: driver_types.h:73
hipFuncGetAttribute
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
dim3
Definition: hip_runtime_api.h:318
hipStreamQuery
hipError_t hipStreamQuery(hipStream_t stream)
Return hipSuccess if all of the operations in the specified stream have completed,...
hipLaunchByPtr
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
hipExtStreamGetCUMask
hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32_t *cuMask)
Get CU mask associated with an asynchronous stream.
hipExtMallocWithFlags
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
hipStreamAttachMemAsync
hipError_t hipStreamAttachMemAsync(hipStream_t stream, hipDeviceptr_t *dev_ptr, size_t length __dparm(0), unsigned int flags __dparm(hipMemAttachSingle))
Attach memory to a stream asynchronously in AMD HMM.
hipDevicePrimaryCtxSetFlags
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
hipPointerAttribute_t
Definition: hip_runtime_api.h:169
hipFree
hipError_t hipFree(void *ptr)
Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSy...
hipLaunchParams_t::func
void * func
Device function symbol.
Definition: hip_runtime_api.h:328
hipArrayDefault
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:203
hipDevicePrimaryCtxRetain
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
hipMemRangeAttributeLastPrefetchLocation
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:255
hipCtxSynchronize
hipError_t hipCtxSynchronize(void)
Blocks until the default context has completed all preceding requested tasks.
hipFreeHost
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_runtime_api.h:1031
hipMemcpyHtoA
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
hipStreamAddCallback
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...
hipLaunchParams_t::stream
hipStream_t stream
Stream identifier.
Definition: hip_runtime_api.h:333
hipMemcpyDtoHAsync
hipError_t hipMemcpyDtoHAsync(void *dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Host asynchronously.
hipDrvMemcpy3DAsync
hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D *pCopy, hipStream_t stream)
Copies data between host and device asynchronously.
hipEventRecord
hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
Record an event in the specified stream.
hipLaunchParams_t::gridDim
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:329
hipMemcpy2D
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.
hipExtent
Definition: driver_types.h:374
hipPitchedPtr
Definition: driver_types.h:367
hipMemAdviseSetReadMostly
@ hipMemAdviseSetReadMostly
Definition: hip_runtime_api.h:232
hipSharedMemBankSizeDefault
@ hipSharedMemBankSizeDefault
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:307
hipMemset2D
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.
hipMemset3D
hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent)
Fills synchronously the memory area pointed to by pitchedDevPtr with the constant value.
hipStreamCreateWithFlags
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
hipDeviceGetAttribute
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
hipMemcpyFromArray
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.
hipMemcpyPeerAsync
hipError_t hipMemcpyPeerAsync(void *dst, int dstDeviceId, const void *src, int srcDevice, size_t sizeBytes, hipStream_t stream __dparm(0))
Copies memory from one device to memory on another device.
hipDrvMemcpy2DUnaligned
hipError_t hipDrvMemcpy2DUnaligned(const hip_Memcpy2D *pCopy)
hipMemcpyHtoDAsync
hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void *src, size_t sizeBytes, hipStream_t stream)
Copy data from Host to Device asynchronously.
hipMemcpyDtoH
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
hipDeviceGetCacheConfig
hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
hipMemcpyPeer
hipError_t hipMemcpyPeer(void *dst, int dstDeviceId, const void *src, int srcDeviceId, size_t sizeBytes)
Copies memory from one device to memory on another device.
hipModuleLoadDataEx
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....
hipFreeMipmappedArray
hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray)
Frees a mipmapped array on the device.
hipRegisterApiCallback
hipError_t hipRegisterApiCallback(uint32_t id, void *fun, void *arg)
hipGetDeviceProperties
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
hipMemcpy
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
hipEventCreateWithFlags
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
hipDeviceTotalMem
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
hipStreamWaitValue64
hipError_t hipStreamWaitValue64(hipStream_t stream, void *ptr, int64_t value, unsigned int flags, uint64_t mask __dparm(0xFFFFFFFFFFFFFFFF))
Enqueues a wait command to the stream.
hipFreeArray
hipError_t hipFreeArray(hipArray *array)
Frees an array on the device.
hipMallocManaged
hipError_t hipMallocManaged(void **dev_ptr, size_t size, unsigned int flags __dparm(hipMemAttachGlobal))
Allocates memory that will be automatically managed by AMD HMM.
textureReference
Definition: texture_types.h:74
hipCtxGetSharedMemConfig
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
hipDeviceCanAccessPeer
hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer's memory.
hipModuleGetFunction
hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname)
Function with kname will be extracted if present in module.
hipMemAdviseUnsetPreferredLocation
@ hipMemAdviseUnsetPreferredLocation
Clear the preferred location for the data.
Definition: hip_runtime_api.h:237
hipMemPrefetchAsync
hipError_t hipMemPrefetchAsync(const void *dev_ptr, size_t count, int device, hipStream_t stream __dparm(0))
Prefetches memory to the specified destination device using AMD HMM.
hipCtxDisablePeerAccess
hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx)
Disable direct access from current context's virtual address space to memory allocations physically l...
hipMemAdviseSetPreferredLocation
@ hipMemAdviseSetPreferredLocation
Definition: hip_runtime_api.h:235
HIP_RESOURCE_DESC_st
Definition: driver_types.h:292
hipTextureDesc
Definition: texture_types.h:95
hipResourceViewDesc
Definition: driver_types.h:327
dim3::z
uint32_t z
z
Definition: hip_runtime_api.h:321
hipCtxSetSharedMemConfig
hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config)
Set Shared memory bank configuration.
hipMemsetD8
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...
hipMemset2DAsync
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.
HIP_ARRAY_DESCRIPTOR
Definition: driver_types.h:66
hipCtxGetDevice
hipError_t hipCtxGetDevice(hipDevice_t *device)
Get the handle of the device associated with current/default context.
hipLaunchParams_t::blockDim
dim3 blockDim
Block dimentions.
Definition: hip_runtime_api.h:330
hipMemAttachGlobal
#define hipMemAttachGlobal
Memory can be accessed by any stream on any device.
Definition: hip_runtime_api.h:172
hipLaunchParams_t
Definition: hip_runtime_api.h:327
hipFuncCachePreferShared
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:298
hipFuncAttribute
hipFuncAttribute
Definition: hip_runtime_api.h:287
hipStreamWriteValue32
hipError_t hipStreamWriteValue32(hipStream_t stream, void *ptr, int32_t value, unsigned int flags)
Enqueues a write command to the stream.
hipSharedMemBankSizeEightByte
@ hipSharedMemBankSizeEightByte
Definition: hip_runtime_api.h:310
hipDeviceAttribute_t
hipDeviceAttribute_t
Definition: hip_runtime_api.h:298
hipFuncSetSharedMemConfig
hipError_t hipFuncSetSharedMemConfig(const void *func, hipSharedMemConfig config)
Set shared memory configuation for a specific function.
hipExtGetLinkTypeAndHopCount
hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t *linktype, uint32_t *hopcount)
Returns the link type and hop count between two devices.
hipResourceDesc
Definition: driver_types.h:266
hipDeviceSynchronize
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
hipCtxGetCacheConfig
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
hipLaunchParams_t::sharedMem
size_t sharedMem
Shared memory.
Definition: hip_runtime_api.h:332
hipCtxDestroy
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
hipModuleLaunchKernel
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...
hipProfilerStart
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
hipDeviceGetSharedMemConfig
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current device.
hipMemcpyAsync
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.
hipOccupancyMaxPotentialBlockSize
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
hipStreamDestroy
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
hipHostRegister
hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
Register host memory so it can be accessed from the current device.
hipModuleLoad
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
hipProfilerStop
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
hipEventCreate
hipError_t hipEventCreate(hipEvent_t *event)
HIP_RESOURCE_VIEW_DESC_st
Definition: driver_types.h:342
hipMemsetAsync
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...
hipModuleLoadData
hipError_t hipModuleLoadData(hipModule_t *module, const void *image)
builds module from code object which resides in host memory. Image is pointer to that location.
hipFuncCachePreferL1
@ hipFuncCachePreferL1
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:299
hipMemAttachSingle
#define hipMemAttachSingle
the associated device
Definition: hip_runtime_api.h:174
hipMemcpyParam2D
hipError_t hipMemcpyParam2D(const hip_Memcpy2D *pCopy)
Copies memory for 2D arrays.
hipHostAlloc
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory [Deprecated].
Definition: hip_runtime_api.h:953
hipMemset
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...
hipDeviceDisablePeerAccess
hipError_t hipDeviceDisablePeerAccess(int peerDeviceId)
Disable direct access from current device's virtual address space to memory allocations physically lo...
hipModuleOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
hipFuncSetAttribute
hipError_t hipFuncSetAttribute(const void *func, hipFuncAttribute attr, int value)
Set attribute for a specific function.
__hipPopCallConfiguration
hipError_t __hipPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, hipStream_t *stream)
Pop configuration of a kernel launch.
hipDevicePrimaryCtxReset
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
hipChannelFormatDesc
Definition: driver_types.h:42
hipModuleUnload
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
hipMemAdviseSetAccessedBy
@ hipMemAdviseSetAccessedBy
Definition: hip_runtime_api.h:238
hipMemRangeAttribute
hipMemRangeAttribute
Definition: hip_runtime_api.h:249