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_HCC_DETAIL_HIP_RUNTIME_API_H
25 #define HIP_INCLUDE_HIP_HCC_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 
38 #ifndef __HIP_ROCclr__
39 #define __HIP_ROCclr__ 0
40 #endif
41 
43 #include <hip/hcc_detail/driver_types.h>
46 
47 #if !__HIP_ROCclr__ && defined(__cplusplus)
48 #include <hsa/hsa.h>
49 #include <hip/hcc_detail/program_state.hpp>
50 #endif
51 
52 #if defined(_MSC_VER)
53 #define DEPRECATED(msg) __declspec(deprecated(msg))
54 #else // !defined(_MSC_VER)
55 #define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
56 #endif // !defined(_MSC_VER)
57 
58 #define DEPRECATED_MSG "This API is marked as deprecated and may not be supported in future releases. For more details please refer https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_deprecated_api_list.md"
59 
60 #if defined(__HCC__) && (__hcc_workweek__ < 16155)
61 #error("This version of HIP requires a newer version of HCC.");
62 #endif
63 
64 #define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
65 #define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
66 #define HIP_LAUNCH_PARAM_END ((void*)0x03)
67 
68 #ifdef __cplusplus
69  #define __dparm(x) \
70  = x
71 #else
72  #define __dparm(x)
73 #endif
74 
75 #ifdef __GNUC__
76 #pragma GCC visibility push (default)
77 #endif
78 
79 #ifdef __cplusplus
80 
81 namespace hip_impl {
82 hipError_t hip_init();
83 } // namespace hip_impl
84 #endif
85 
86 // Structure definitions:
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
91 //---
92 // API-visible structures
93 typedef struct ihipCtx_t* hipCtx_t;
94 
95 // Note many APIs also use integer deviceIds as an alternative to the device pointer:
96 typedef int hipDevice_t;
97 
98 typedef enum hipDeviceP2PAttr {
99  hipDevP2PAttrPerformanceRank = 0,
100  hipDevP2PAttrAccessSupported,
101  hipDevP2PAttrNativeAtomicSupported,
102  hipDevP2PAttrHipArrayAccessSupported
103 } hipDeviceP2PAttr;
104 
105 typedef struct ihipStream_t* hipStream_t;
106 
107 #define hipIpcMemLazyEnablePeerAccess 0
108 
109 #define HIP_IPC_HANDLE_SIZE 64
110 
111 typedef struct hipIpcMemHandle_st {
112  char reserved[HIP_IPC_HANDLE_SIZE];
114 
115 #if __HIP_ROCclr__
116 // TODO: IPC event handle currently unsupported
117 struct ihipIpcEventHandle_t;
119 #else
120 typedef struct hipIpcEventHandle_st {
121  char reserved[HIP_IPC_HANDLE_SIZE];
123 #endif
124 typedef struct ihipModule_t* hipModule_t;
125 
126 typedef struct ihipModuleSymbol_t* hipFunction_t;
127 
128 typedef struct hipFuncAttributes {
129  int binaryVersion;
130  int cacheModeCA;
131  size_t constSizeBytes;
132  size_t localSizeBytes;
133  int maxDynamicSharedSizeBytes;
134  int maxThreadsPerBlock;
135  int numRegs;
136  int preferredShmemCarveout;
137  int ptxVersion;
138  size_t sharedSizeBytes;
140 
141 typedef struct ihipEvent_t* hipEvent_t;
142 
143 enum hipLimit_t {
144  hipLimitMallocHeapSize = 0x02,
145 };
146 
151 #define hipStreamDefault \
153  0x00
154 #define hipStreamNonBlocking 0x01
155 
156 
158 #define hipEventDefault 0x0
159 #define hipEventBlockingSync \
160  0x1
161 #define hipEventDisableTiming \
162  0x2
163 #define hipEventInterprocess 0x4
164 #define hipEventReleaseToDevice \
165  0x40000000
166 #define hipEventReleaseToSystem \
169  0x80000000
170 
173 
175 #define hipHostMallocDefault 0x0
176 #define hipHostMallocPortable 0x1
177 #define hipHostMallocMapped \
178  0x2
179 #define hipHostMallocWriteCombined 0x4
181 #define hipHostMallocNumaUser \
182  0x20000000
183 
184 #define hipHostMallocCoherent \
185  0x40000000
186 #define hipHostMallocNonCoherent \
188  0x80000000
189 
191 #define hipMemAttachGlobal 0x01
192 #define hipMemAttachHost 0x02
193 #define hipMemAttachSingle 0x04
194 
196 #define hipDeviceMallocDefault 0x0
197 #define hipDeviceMallocFinegrained 0x1
198 
199 #define hipHostRegisterDefault 0x0
201 #define hipHostRegisterPortable 0x1
202 #define hipHostRegisterMapped \
203  0x2
204 #define hipHostRegisterIoMemory 0x4
206 #define hipExtHostRegisterCoarseGrained 0x8
207 
208 #define hipDeviceScheduleAuto 0x0
209 #define hipDeviceScheduleSpin \
210  0x1
211 #define hipDeviceScheduleYield \
213  0x2
214 #define hipDeviceScheduleBlockingSync 0x4
216 #define hipDeviceScheduleMask 0x7
217 
218 #define hipDeviceMapHost 0x8
219 #define hipDeviceLmemResizeToMax 0x16
220 
221 #define hipArrayDefault 0x00
222 #define hipArrayLayered 0x01
223 #define hipArraySurfaceLoadStore 0x02
224 #define hipArrayCubemap 0x04
225 #define hipArrayTextureGather 0x08
226 
227 #define hipOccupancyDefault 0x00
228 
229 #define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
230 #define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
231 
232 #define hipCpuDeviceId ((int)-1)
233 #define hipInvalidDeviceId ((int)-2)
234 
235 /*
236  * @brief HIP Memory Advise values
237  * @enum
238  * @ingroup Enumerations
239  */
240 typedef enum hipMemoryAdvise {
252 
253 /*
254  * @brief HIP range attributes
255  * @enum
256  * @ingroup Enumerations
257  */
258 typedef enum hipMemRangeAttribute {
266 
267 /*
268  * @brief hipJitOption
269  * @enum
270  * @ingroup Enumerations
271  */
272 typedef enum hipJitOption {
273  hipJitOptionMaxRegisters = 0,
274  hipJitOptionThreadsPerBlock,
275  hipJitOptionWallTime,
276  hipJitOptionInfoLogBuffer,
277  hipJitOptionInfoLogBufferSizeBytes,
278  hipJitOptionErrorLogBuffer,
279  hipJitOptionErrorLogBufferSizeBytes,
280  hipJitOptionOptimizationLevel,
281  hipJitOptionTargetFromContext,
282  hipJitOptionTarget,
283  hipJitOptionFallbackStrategy,
284  hipJitOptionGenerateDebugInfo,
285  hipJitOptionLogVerbose,
286  hipJitOptionGenerateLineInfo,
287  hipJitOptionCacheMode,
288  hipJitOptionSm3xOpt,
289  hipJitOptionFastCompile,
290  hipJitOptionNumOptions
291 } hipJitOption;
292 
293 
297 typedef enum hipFuncCache_t {
303 
304 
308 typedef enum hipSharedMemConfig {
315 
320 typedef struct dim3 {
321  uint32_t x;
322  uint32_t y;
323  uint32_t z;
324 #ifdef __cplusplus
325  __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
326 #endif
328 
329 typedef struct hipLaunchParams_t {
330  void* func;
333  void **args;
334  size_t sharedMem;
337 
338 
339 // Doxygen end group GlobalDefs
343 //-------------------------------------------------------------------------------------------------
344 
345 
346 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
347 // out-of-scope.
348 // typedef class ihipStream_t * hipStream_t;
349 
350 
351 /*
352  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
353  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
354  * out-of-scope but the true event is being written by some async queue or device */
355 // typedef struct hipEvent_t {
356 // struct ihipEvent_t *_handle;
357 //} hipEvent_t;
358 
359 
385 hipError_t hipDeviceSynchronize(void);
386 
387 
399 hipError_t hipDeviceReset(void);
400 
401 
433 hipError_t hipSetDevice(int deviceId);
434 
435 
449 hipError_t hipGetDevice(int* deviceId);
450 
451 
464 hipError_t hipGetDeviceCount(int* count);
465 
475 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
476 
490 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
491 
492 
503 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
504 
505 
516 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
517 
528 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
529 
530 
541 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
542 
555 
563 hipError_t hipGetDeviceFlags(unsigned int* flags);
564 
577 
602 hipError_t hipSetDeviceFlags(unsigned flags);
603 
612 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
613 
626 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
627 
628 // end doxygen Device
651 hipError_t hipGetLastError(void);
652 
653 
664 hipError_t hipPeekAtLastError(void);
665 
666 
675 const char* hipGetErrorName(hipError_t hip_error);
676 
677 
688 const char* hipGetErrorString(hipError_t hipError);
689 
690 // end doxygen Error
723 hipError_t hipStreamCreate(hipStream_t* stream);
724 
725 
743 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
744 
745 
764 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
765 
766 
781 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
782 
783 
802 hipError_t hipStreamDestroy(hipStream_t stream);
803 
804 
820 hipError_t hipStreamQuery(hipStream_t stream);
821 
822 
842 hipError_t hipStreamSynchronize(hipStream_t stream);
843 
844 
864 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
865 
866 
880 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
881 
882 
896 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
897 
898 
918 hipError_t hipExtStreamCreateWithCUMask(hipStream_t* stream, uint32_t cuMaskSize, const uint32_t* cuMask);
919 
920 
924 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
925 
941 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
942  unsigned int flags);
943 
944 
945 // end doxygen Stream
982 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
983 
984 
996 hipError_t hipEventCreate(hipEvent_t* event);
997 
998 
1026 #ifdef __cplusplus
1027 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1028 #else
1029 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
1030 #endif
1031 
1048 hipError_t hipEventDestroy(hipEvent_t event);
1049 
1050 
1068 hipError_t hipEventSynchronize(hipEvent_t event);
1069 
1070 
1099 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1100 
1101 
1117 hipError_t hipEventQuery(hipEvent_t event);
1118 
1119 
1120 // end doxygen Events
1151 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1152 
1166 hipError_t hipMalloc(void** ptr, size_t size);
1167 
1182 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1183 
1196 DEPRECATED("use hipHostMalloc instead")
1197 hipError_t hipMallocHost(void** ptr, size_t size);
1198 
1211 DEPRECATED("use hipHostMalloc instead")
1212 hipError_t hipMemAllocHost(void** ptr, size_t size);
1213 
1227 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1228 
1239 hipError_t hipMallocManaged(void** dev_ptr,
1240  size_t size,
1241  unsigned int flags __dparm(hipMemAttachGlobal));
1242 
1256 DEPRECATED("use hipHostMalloc instead")
1257 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1258 
1270 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1271 
1281 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1282 
1319 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1320 
1329 hipError_t hipHostUnregister(void* hostPtr);
1330 
1350 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1351 
1374 hipError_t hipMemAllocPitch(hipDeviceptr_t* dptr, size_t* pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes);
1375 
1389 hipError_t hipFree(void* ptr);
1390 
1401 DEPRECATED("use hipHostFree instead")
1402 hipError_t hipFreeHost(void* ptr);
1403 
1417 hipError_t hipHostFree(void* ptr);
1418 
1448 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1449 
1450 // TODO: Add description
1451 hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
1452  hipMemcpyKind kind, hipStream_t stream);
1470 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1471 
1489 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1490 
1508 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1509 
1527 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1528 
1546 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1547 
1565 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1566  hipStream_t stream);
1567 
1568 #if __HIP_ROCclr__
1569 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1570  hipModule_t hmod, const char* name);
1571 
1572 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol);
1573 hipError_t hipGetSymbolSize(size_t* size, const void* symbol);
1574 hipError_t hipMemcpyToSymbol(const void* symbol, const void* src,
1575  size_t sizeBytes, size_t offset __dparm(0),
1576  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1577 hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src,
1578  size_t sizeBytes, size_t offset,
1579  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1580 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbol,
1581  size_t sizeBytes, size_t offset __dparm(0),
1582  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1583 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbol,
1584  size_t sizeBytes, size_t offset,
1585  hipMemcpyKind kind,
1586  hipStream_t stream __dparm(0));
1587 #else
1588 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1589 
1590 #ifdef __cplusplus //Start : Not supported in gcc
1591 namespace hip_impl {
1592 inline
1593 __attribute__((visibility("hidden")))
1594 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1595  const char* name);
1596 } // Namespace hip_impl.
1597 
1598 
1609 inline
1610 __attribute__((visibility("hidden")))
1611 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
1612  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
1613  hip_impl::hip_init();
1614  size_t size = 0;
1615  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
1616 }
1617 
1618 
1629 inline
1630 __attribute__((visibility("hidden")))
1631 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
1632  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
1633  hip_impl::hip_init();
1634  void* devPtr = nullptr;
1635  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
1636 }
1637 #endif // End : Not supported in gcc
1638 
1639 #if defined(__cplusplus)
1640 } // extern "C"
1641 #endif
1642 
1643 #ifdef __cplusplus
1644 namespace hip_impl {
1645 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
1646  const char*);
1647 } // Namespace hip_impl.
1648 #endif
1649 
1650 #if defined(__cplusplus)
1651 extern "C" {
1652 #endif
1653 
1677 #ifdef __cplusplus
1678 inline
1679 __attribute__((visibility("hidden")))
1680 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1681  size_t sizeBytes, size_t offset __dparm(0),
1682  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
1683  if (!symbolName) return hipErrorInvalidSymbol;
1684 
1685  hipDeviceptr_t dst = NULL;
1686  hipGetSymbolAddress(&dst, (const char*)symbolName);
1687 
1688  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
1689  (const char*)symbolName);
1690 }
1691 #endif
1692 
1693 #if defined(__cplusplus)
1694 } // extern "C"
1695 #endif
1696 
1697 #ifdef __cplusplus
1698 namespace hip_impl {
1699 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
1700  hipMemcpyKind, hipStream_t, const char*);
1701 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
1702  hipMemcpyKind, const char*);
1703 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
1704  hipMemcpyKind, hipStream_t, const char*);
1705 } // Namespace hip_impl.
1706 #endif
1707 
1708 #if defined(__cplusplus)
1709 extern "C" {
1710 #endif
1711 
1738 #ifdef __cplusplus //Start : Not supported in gcc
1739 inline
1740 __attribute__((visibility("hidden")))
1741 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1742  size_t sizeBytes, size_t offset,
1743  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
1744  if (!symbolName) return hipErrorInvalidSymbol;
1745 
1746  hipDeviceptr_t dst = NULL;
1747  hipGetSymbolAddress(&dst, symbolName);
1748 
1749  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
1750  stream,
1751  (const char*)symbolName);
1752 }
1753 
1754 inline
1755 __attribute__((visibility("hidden")))
1756 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1757  size_t sizeBytes, size_t offset __dparm(0),
1758  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
1759  if (!symbolName) return hipErrorInvalidSymbol;
1760 
1761  hipDeviceptr_t src = NULL;
1762  hipGetSymbolAddress(&src, symbolName);
1763 
1764  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
1765  (const char*)symbolName);
1766 }
1767 
1768 inline
1769 __attribute__((visibility("hidden")))
1770 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1771  size_t sizeBytes, size_t offset,
1772  hipMemcpyKind kind,
1773  hipStream_t stream __dparm(0)) {
1774  if (!symbolName) return hipErrorInvalidSymbol;
1775 
1776  hipDeviceptr_t src = NULL;
1777  hipGetSymbolAddress(&src, symbolName);
1778 
1779  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
1780  stream,
1781  (const char*)symbolName);
1782 }
1783 #endif // End : Not supported in gcc
1784 
1785 #endif // __HIP_ROCclr__
1786 
1814 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
1815  hipStream_t stream __dparm(0));
1816 
1826 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
1827 
1837 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count);
1838 
1854 hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0));
1855 
1865 hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count);
1866 
1882 hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0));
1883 
1893 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
1894 
1910 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
1911 
1927 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
1928  hipStream_t stream __dparm(0));
1929 
1941 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
1942 
1955 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
1956 
1965 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
1966 
1976 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
1977 
1987 hipError_t hipMemGetInfo(size_t* free, size_t* total);
1988 
1989 
1990 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
1991 
1992 
2005 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
2006  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
2007 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
2008 
2009 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
2010 
2011 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
2012 
2021 hipError_t hipFreeArray(hipArray* array);
2022 
2030 hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray);
2031 
2044 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
2045  struct hipExtent extent, unsigned int flags);
2046 
2059  hipMipmappedArray_t *mipmappedArray,
2060  const struct hipChannelFormatDesc* desc,
2061  struct hipExtent extent,
2062  unsigned int numLevels,
2063  unsigned int flags __dparm(0));
2064 
2075  hipArray_t *levelArray,
2076  hipMipmappedArray_const_t mipmappedArray,
2077  unsigned int level);
2078 
2095 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2096  size_t height, hipMemcpyKind kind);
2097 
2107 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
2108 
2119 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
2120 
2138 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2139  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2140 
2158 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2159  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
2160 
2176 DEPRECATED(DEPRECATED_MSG)
2177 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2178  size_t count, hipMemcpyKind kind);
2179 
2195 DEPRECATED(DEPRECATED_MSG)
2196 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
2197  size_t count, hipMemcpyKind kind);
2198 
2216 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);
2217 
2236 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));
2237 
2251 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
2252 
2266 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2267 
2278 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2279 
2291 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2292 
2303 hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D* pCopy);
2304 
2316 hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D* pCopy, hipStream_t stream);
2317 
2318 // doxygen end Memory
2350 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2351 
2352 
2369 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2370 
2371 
2383 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2384 
2397 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2398 
2399 #ifndef USE_PEER_NON_UNIFIED
2400 #define USE_PEER_NON_UNIFIED 1
2401 #endif
2402 
2403 #if USE_PEER_NON_UNIFIED == 1
2404 
2415 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2416  size_t sizeBytes);
2417 
2430 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2431  size_t sizeBytes, hipStream_t stream __dparm(0));
2432 #endif
2433 
2434 
2435 // doxygen end PeerToPeer
2454 // TODO-ctx - more description on error codes.
2455 hipError_t hipInit(unsigned int flags);
2456 
2457 
2477 DEPRECATED(DEPRECATED_MSG)
2478 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2479 
2490 DEPRECATED(DEPRECATED_MSG)
2491 hipError_t hipCtxDestroy(hipCtx_t ctx);
2492 
2503 DEPRECATED(DEPRECATED_MSG)
2504 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2505 
2516 DEPRECATED(DEPRECATED_MSG)
2517 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2518 
2529 DEPRECATED(DEPRECATED_MSG)
2530 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2531 
2542 DEPRECATED(DEPRECATED_MSG)
2543 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2544 
2556 DEPRECATED(DEPRECATED_MSG)
2557 hipError_t hipCtxGetDevice(hipDevice_t* device);
2558 
2576 DEPRECATED(DEPRECATED_MSG)
2577 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2578 
2592 DEPRECATED(DEPRECATED_MSG)
2593 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2594 
2608 DEPRECATED(DEPRECATED_MSG)
2609 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2610 
2624 DEPRECATED(DEPRECATED_MSG)
2625 hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config);
2626 
2640 DEPRECATED(DEPRECATED_MSG)
2641 hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig);
2642 
2654 DEPRECATED(DEPRECATED_MSG)
2655 hipError_t hipCtxSynchronize(void);
2656 
2667 DEPRECATED(DEPRECATED_MSG)
2668 hipError_t hipCtxGetFlags(unsigned int* flags);
2669 
2689 DEPRECATED(DEPRECATED_MSG)
2690 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2691 
2708 DEPRECATED(DEPRECATED_MSG)
2709 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
2710 
2723 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
2724 
2737 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
2738 
2750 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
2751 
2762 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
2763 
2775 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
2776 
2777 // doxygen end Context Management
2789 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
2790 
2799 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
2800 
2809 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
2810 
2811 
2821 hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr,
2822  int srcDevice, int dstDevice);
2823 
2832 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
2833 
2834 
2842 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
2843 
2844 
2852 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
2853 
2869 hipError_t hipDriverGetVersion(int* driverVersion);
2870 
2883 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
2884 
2896 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
2897 
2908 hipError_t hipModuleUnload(hipModule_t module);
2909 
2920 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
2921 
2931 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
2932 
2942 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
2943 
2944 #if !__HIP_ROCclr__
2945 #if defined(__cplusplus)
2946 } // extern "C"
2947 #endif
2948 
2949 #ifdef __cplusplus
2950 namespace hip_impl {
2951  class agent_globals_impl;
2952  class agent_globals {
2953  public:
2954  agent_globals();
2955  ~agent_globals();
2956  agent_globals(const agent_globals&) = delete;
2957 
2958  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
2959  hipModule_t hmod, const char* name);
2960  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2961  const char* name);
2962  private:
2963  agent_globals_impl* impl;
2964  };
2965 
2966  inline
2967  __attribute__((visibility("hidden")))
2968  agent_globals& get_agent_globals() {
2969  static agent_globals ag;
2970  return ag;
2971  }
2972 
2973  extern "C"
2974  inline
2975  __attribute__((visibility("hidden")))
2976  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2977  const char* name) {
2978  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
2979  }
2980 } // Namespace hip_impl.
2981 #endif
2982 
2983 #if defined(__cplusplus)
2984 extern "C" {
2985 #endif
2986 
2997 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
2998  hipModule_t hmod, const char* name);
2999 #endif // __HIP_ROCclr__
3000 
3001 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
3002 
3012 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
3013 
3026 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
3027  hipJitOption* options, void** optionValues);
3028 
3053 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
3054  unsigned int gridDimZ, unsigned int blockDimX,
3055  unsigned int blockDimY, unsigned int blockDimZ,
3056  unsigned int sharedMemBytes, hipStream_t stream,
3057  void** kernelParams, void** extra);
3058 
3059 
3060 #if __HIP_ROCclr__ && !defined(__HCC__)
3061 
3076 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
3077  void** kernelParams, unsigned int sharedMemBytes,
3078  hipStream_t stream);
3079 
3090 hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3091  int numDevices, unsigned int flags);
3092 
3093 #endif
3094 
3107 //TODO - Match CUoccupancyB2DSize
3108 hipError_t hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3109  hipFunction_t f, size_t dynSharedMemPerBlk,
3110  int blockSizeLimit);
3111 
3124 //TODO - Match CUoccupancyB2DSize
3125 hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3126  hipFunction_t f, size_t dynSharedMemPerBlk,
3127  int blockSizeLimit, unsigned int flags);
3128 
3138  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk);
3139 
3150  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
3151 
3161  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk);
3162 
3173  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
3174 
3186 hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3187  const void* f, size_t dynSharedMemPerBlk,
3188  int blockSizeLimit);
3189 
3202  int numDevices, unsigned int flags);
3203 
3204 
3205 // doxygen end Version Management
3223 // TODO - expand descriptions:
3229 DEPRECATED("use roctracer/rocTX instead")
3230 hipError_t hipProfilerStart();
3231 
3232 
3238 DEPRECATED("use roctracer/rocTX instead")
3239 hipError_t hipProfilerStop();
3240 
3241 
3246 // TODO: implement IPC apis
3247 
3273 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
3274 
3311 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
3312 
3331 hipError_t hipIpcCloseMemHandle(void* devPtr);
3332 
3333 
3334 hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event);
3335 hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
3336 
3337 
3358 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3359 
3360 
3371 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3372 
3373 
3382 hipError_t hipLaunchByPtr(const void* func);
3383 
3384 
3400  dim3 blockDim,
3401  size_t sharedMem __dparm(0),
3402  hipStream_t stream __dparm(0));
3403 
3417 hipError_t __hipPopCallConfiguration(dim3 *gridDim,
3418  dim3 *blockDim,
3419  size_t *sharedMem,
3420  hipStream_t *stream);
3421 
3437 hipError_t hipLaunchKernel(const void* function_address,
3438  dim3 numBlocks,
3439  dim3 dimBlocks,
3440  void** args,
3441  size_t sharedMemBytes __dparm(0),
3442  hipStream_t stream __dparm(0));
3443 
3454 hipError_t hipMemPrefetchAsync(const void* dev_ptr,
3455  size_t count,
3456  int device,
3457  hipStream_t stream __dparm(0));
3458 
3469 hipError_t hipMemAdvise(const void* dev_ptr,
3470  size_t count,
3471  hipMemoryAdvise advice,
3472  int device);
3473 
3486 hipError_t hipMemRangeGetAttribute(void* data,
3487  size_t data_size,
3488  hipMemRangeAttribute attribute,
3489  const void* dev_ptr,
3490  size_t count);
3491 
3506 hipError_t hipMemRangeGetAttributes(void** data,
3507  size_t* data_sizes,
3508  hipMemRangeAttribute* attributes,
3509  size_t num_attributes,
3510  const void* dev_ptr,
3511  size_t count);
3512 
3526  hipDeviceptr_t* dev_ptr,
3527  size_t length __dparm(0),
3528  unsigned int flags __dparm(hipMemAttachSingle));
3529 
3530 #if __HIP_ROCclr__ || !defined(__HCC__)
3531 //TODO: Move this to hip_ext.h
3532 hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks, dim3 dimBlocks,
3533  void** args, size_t sharedMemBytes, hipStream_t stream,
3534  hipEvent_t startEvent, hipEvent_t stopEvent, int flags);
3535 
3536 DEPRECATED(DEPRECATED_MSG)
3537 hipError_t hipBindTexture(
3538  size_t* offset,
3539  const textureReference* tex,
3540  const void* devPtr,
3541  const hipChannelFormatDesc* desc,
3542  size_t size __dparm(UINT_MAX));
3543 
3544 DEPRECATED(DEPRECATED_MSG)
3545 hipError_t hipBindTexture2D(
3546  size_t* offset,
3547  const textureReference* tex,
3548  const void* devPtr,
3549  const hipChannelFormatDesc* desc,
3550  size_t width,
3551  size_t height,
3552  size_t pitch);
3553 
3554 DEPRECATED(DEPRECATED_MSG)
3555 hipError_t hipBindTextureToArray(
3556  const textureReference* tex,
3557  hipArray_const_t array,
3558  const hipChannelFormatDesc* desc);
3559 
3560 hipError_t hipBindTextureToMipmappedArray(
3561  const textureReference* tex,
3562  hipMipmappedArray_const_t mipmappedArray,
3563  const hipChannelFormatDesc* desc);
3564 
3565 DEPRECATED(DEPRECATED_MSG)
3566 hipError_t hipGetTextureAlignmentOffset(
3567  size_t* offset,
3568  const textureReference* texref);
3569 
3570 hipError_t hipGetTextureReference(
3571  const textureReference** texref,
3572  const void* symbol);
3573 
3574 DEPRECATED(DEPRECATED_MSG)
3575 hipError_t hipUnbindTexture(const textureReference* tex);
3576 
3577 hipError_t hipCreateTextureObject(
3578  hipTextureObject_t* pTexObject,
3579  const hipResourceDesc* pResDesc,
3580  const hipTextureDesc* pTexDesc,
3581  const struct hipResourceViewDesc* pResViewDesc);
3582 
3583 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3584 
3585 hipError_t hipGetChannelDesc(
3586  hipChannelFormatDesc* desc,
3587  hipArray_const_t array);
3588 
3589 hipError_t hipGetTextureObjectResourceDesc(
3590  hipResourceDesc* pResDesc,
3591  hipTextureObject_t textureObject);
3592 
3593 hipError_t hipGetTextureObjectResourceViewDesc(
3594  struct hipResourceViewDesc* pResViewDesc,
3595  hipTextureObject_t textureObject);
3596 
3597 hipError_t hipGetTextureObjectTextureDesc(
3598  hipTextureDesc* pTexDesc,
3599  hipTextureObject_t textureObject);
3600 
3601 hipError_t hipTexRefGetAddress(
3602  hipDeviceptr_t* dev_ptr,
3603  const textureReference* texRef);
3604 
3605 hipError_t hipTexRefGetAddressMode(
3606  enum hipTextureAddressMode* pam,
3607  const textureReference* texRef,
3608  int dim);
3609 
3610 hipError_t hipTexRefGetFilterMode(
3611  enum hipTextureFilterMode* pfm,
3612  const textureReference* texRef);
3613 
3614 hipError_t hipTexRefGetFlags(
3615  unsigned int* pFlags,
3616  const textureReference* texRef);
3617 
3618 hipError_t hipTexRefGetFormat(
3619  hipArray_Format* pFormat,
3620  int* pNumChannels,
3621  const textureReference* texRef);
3622 
3623 hipError_t hipTexRefGetMaxAnisotropy(
3624  int* pmaxAnsio,
3625  const textureReference* texRef);
3626 
3627 hipError_t hipTexRefGetMipmapFilterMode(
3628  enum hipTextureFilterMode* pfm,
3629  const textureReference* texRef);
3630 
3631 hipError_t hipTexRefGetMipmapLevelBias(
3632  float* pbias,
3633  const textureReference* texRef);
3634 
3635 hipError_t hipTexRefGetMipmapLevelClamp(
3636  float* pminMipmapLevelClamp,
3637  float* pmaxMipmapLevelClamp,
3638  const textureReference* texRef);
3639 
3640 hipError_t hipTexRefGetMipMappedArray(
3641  hipMipmappedArray_t* pArray,
3642  const textureReference* texRef);
3643 
3644 hipError_t hipTexRefSetAddress(
3645  size_t* ByteOffset,
3646  textureReference* texRef,
3647  hipDeviceptr_t dptr,
3648  size_t bytes);
3649 
3650 hipError_t hipTexRefSetAddress2D(
3651  textureReference* texRef,
3652  const HIP_ARRAY_DESCRIPTOR* desc,
3653  hipDeviceptr_t dptr,
3654  size_t Pitch);
3655 
3656 hipError_t hipTexRefSetAddressMode(
3657  textureReference* texRef,
3658  int dim,
3659  enum hipTextureAddressMode am);
3660 
3661 hipError_t hipTexRefSetArray(
3662  textureReference* tex,
3663  hipArray_const_t array,
3664  unsigned int flags);
3665 
3666 hipError_t hipTexRefSetBorderColor(
3667  textureReference* texRef,
3668  float* pBorderColor);
3669 
3670 hipError_t hipTexRefSetFilterMode(
3671  textureReference* texRef,
3672  enum hipTextureFilterMode fm);
3673 
3674 hipError_t hipTexRefSetFlags(
3675  textureReference* texRef,
3676  unsigned int Flags);
3677 
3678 hipError_t hipTexRefSetFormat(
3679  textureReference* texRef,
3680  hipArray_Format fmt,
3681  int NumPackedComponents);
3682 
3683 hipError_t hipTexRefSetMaxAnisotropy(
3684  textureReference* texRef,
3685  unsigned int maxAniso);
3686 
3687 hipError_t hipTexRefSetMipmapFilterMode(
3688  textureReference* texRef,
3689  enum hipTextureFilterMode fm);
3690 
3691 hipError_t hipTexRefSetMipmapLevelBias(
3692  textureReference* texRef,
3693  float bias);
3694 
3695 hipError_t hipTexRefSetMipmapLevelClamp(
3696  textureReference* texRef,
3697  float minMipMapLevelClamp,
3698  float maxMipMapLevelClamp);
3699 
3700 hipError_t hipTexRefSetMipmappedArray(
3701  textureReference* texRef,
3702  struct hipMipmappedArray* mipmappedArray,
3703  unsigned int Flags);
3704 
3705 hipError_t hipMipmappedArrayCreate(
3706  hipMipmappedArray_t* pHandle,
3707  HIP_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc,
3708  unsigned int numMipmapLevels);
3709 
3710 hipError_t hipMipmappedArrayDestroy(
3711  hipMipmappedArray_t hMipmappedArray);
3712 
3713 hipError_t hipMipmappedArrayGetLevel(
3714  hipArray_t* pLevelArray,
3715  hipMipmappedArray_t hMipMappedArray,
3716  unsigned int level);
3717 
3718 hipError_t hipTexObjectCreate(
3719  hipTextureObject_t* pTexObject,
3720  const HIP_RESOURCE_DESC* pResDesc,
3721  const HIP_TEXTURE_DESC* pTexDesc,
3722  const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
3723 
3724 hipError_t hipTexObjectDestroy(
3725  hipTextureObject_t texObject);
3726 
3727 hipError_t hipTexObjectGetResourceDesc(
3728  HIP_RESOURCE_DESC* pResDesc,
3729  hipTextureObject_t texObject);
3730 
3731 hipError_t hipTexObjectGetResourceViewDesc(
3732  HIP_RESOURCE_VIEW_DESC* pResViewDesc,
3733  hipTextureObject_t texObject);
3734 
3735 hipError_t hipTexObjectGetTextureDesc(
3736  HIP_TEXTURE_DESC* pTexDesc,
3737  hipTextureObject_t texObject);
3738 #endif
3739 
3745 #ifdef __cplusplus
3746 } /* extern "c" */
3747 #endif
3748 
3749 #if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3750 template <typename T>
3751 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3752  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0) {
3753  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3754 }
3755 
3756 template <typename T>
3757 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3758  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0, unsigned int flags = 0 ) {
3759  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3760 }
3761 #endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3762 
3763 #if defined(__cplusplus) && !defined(__HCC__)
3764 
3765 template <typename T>
3766 hipError_t hipGetSymbolAddress(void** devPtr, const T &symbol) {
3767  return ::hipGetSymbolAddress(devPtr, (const void *)&symbol);
3768 }
3769 
3770 template <typename T>
3771 hipError_t hipGetSymbolSize(size_t* size, const T &symbol) {
3772  return ::hipGetSymbolSize(size, (const void *)&symbol);
3773 }
3774 
3775 template <typename T>
3776 hipError_t hipMemcpyToSymbol(const T& symbol, const void* src, size_t sizeBytes,
3777  size_t offset __dparm(0),
3778  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
3779  return ::hipMemcpyToSymbol((const void*)&symbol, src, sizeBytes, offset, kind);
3780 }
3781 
3782 template <typename T>
3783 hipError_t hipMemcpyToSymbolAsync(const T& symbol, const void* src, size_t sizeBytes, size_t offset,
3784  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3785  return ::hipMemcpyToSymbolAsync((const void*)&symbol, src, sizeBytes, offset, kind, stream);
3786 }
3787 
3788 template <typename T>
3789 hipError_t hipMemcpyFromSymbol(void* dst, const T &symbol,
3790  size_t sizeBytes, size_t offset __dparm(0),
3791  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
3792  return ::hipMemcpyFromSymbol(dst, (const void*)&symbol, sizeBytes, offset, kind);
3793 }
3794 
3795 template <typename T>
3796 hipError_t hipMemcpyFromSymbolAsync(void* dst, const T& symbol, size_t sizeBytes, size_t offset,
3797  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3798  return ::hipMemcpyFromSymbolAsync(dst, (const void*)&symbol, sizeBytes, offset, kind, stream);
3799 }
3800 
3801 #endif
3802 
3803 #if USE_PROF_API
3804 #include <hip/hcc_detail/hip_prof_str.h>
3805 #endif
3806 
3807 #ifdef __cplusplus
3808 extern "C" {
3809 #endif
3810 
3813 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3814 hipError_t hipRemoveApiCallback(uint32_t id);
3815 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3816 hipError_t hipRemoveActivityCallback(uint32_t id);
3817 const char* hipApiName(uint32_t id);
3818 const char* hipKernelNameRef(const hipFunction_t f);
3819 const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream);
3820 int hipGetStreamDeviceId(hipStream_t stream);
3821 #ifdef __cplusplus
3822 } /* extern "C" */
3823 #endif
3824 
3825 #ifdef __cplusplus
3826 
3827 template <class T>
3829  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk) {
3831  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk);
3832 }
3833 
3834 template <class T>
3836  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
3838  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk, flags);
3839 }
3840 
3841 class TlsData;
3842 
3843 #if !__HIP_ROCclr__
3844 DEPRECATED(DEPRECATED_MSG)
3845 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3846  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3847 #endif
3848 
3849 #if !__HIP_ROCclr__
3850 hipError_t ihipBindTextureImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, size_t* offset,
3851  const void* devPtr, const struct hipChannelFormatDesc* desc,
3852  size_t size, textureReference* tex);
3853 #endif
3854 
3855 /*
3856  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3857  *reference tex.
3858  *
3859  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3860  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3861  *memory previously bound to tex is unbound.
3862  *
3863  * @param[in] offset - Offset in bytes
3864  * @param[out] tex - texture to bind
3865  * @param[in] devPtr - Memory area on device
3866  * @param[in] desc - Channel format
3867  * @param[in] size - Size of the memory area pointed to by devPtr
3868  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3869  **/
3870 #if !__HIP_ROCclr__
3871 template <class T, int dim, enum hipTextureReadMode readMode>
3872 DEPRECATED(DEPRECATED_MSG)
3873 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3874  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3875  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
3876 }
3877 #endif
3878 
3879 /*
3880  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3881  *reference tex.
3882  *
3883  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3884  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3885  *memory previously bound to tex is unbound.
3886  *
3887  * @param[in] offset - Offset in bytes
3888  * @param[in] tex - texture to bind
3889  * @param[in] devPtr - Memory area on device
3890  * @param[in] size - Size of the memory area pointed to by devPtr
3891  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3892  **/
3893 #if !__HIP_ROCclr__
3894 template <class T, int dim, enum hipTextureReadMode readMode>
3895 DEPRECATED(DEPRECATED_MSG)
3896 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3897  size_t size = UINT_MAX) {
3898  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
3899 }
3900 #endif
3901 
3902 // C API
3903 #if !__HIP_ROCclr__
3904 DEPRECATED(DEPRECATED_MSG)
3905 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
3906  const hipChannelFormatDesc* desc, size_t width, size_t height,
3907  size_t pitch);
3908 #endif
3909 
3910 #if !__HIP_ROCclr__
3911 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3912  const void* devPtr, const struct hipChannelFormatDesc* desc,
3913  size_t width, size_t height, textureReference* tex, size_t pitch);
3914 #endif
3915 
3916 #if !__HIP_ROCclr__
3917 template <class T, int dim, enum hipTextureReadMode readMode>
3918 DEPRECATED(DEPRECATED_MSG)
3919 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3920  const void* devPtr, size_t width, size_t height, size_t pitch) {
3921  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
3922  &tex);
3923 }
3924 #endif
3925 
3926 #if !__HIP_ROCclr__
3927 template <class T, int dim, enum hipTextureReadMode readMode>
3928 DEPRECATED(DEPRECATED_MSG)
3929 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3930  const void* devPtr, const struct hipChannelFormatDesc& desc,
3931  size_t width, size_t height, size_t pitch) {
3932  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
3933 }
3934 #endif
3935 
3936 // C API
3937 #if !__HIP_ROCclr__
3938 DEPRECATED(DEPRECATED_MSG)
3939 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
3940  const hipChannelFormatDesc* desc);
3941 #endif
3942 
3943 #if !__HIP_ROCclr__
3944 hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode,
3945  hipArray_const_t array,
3946  const struct hipChannelFormatDesc& desc,
3947  textureReference* tex);
3948 #endif
3949 
3950 #if !__HIP_ROCclr__
3951 template <class T, int dim, enum hipTextureReadMode readMode>
3952 DEPRECATED(DEPRECATED_MSG)
3953 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
3954  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, tex.channelDesc, &tex);
3955 }
3956 #endif
3957 
3958 #if !__HIP_ROCclr__
3959 template <class T, int dim, enum hipTextureReadMode readMode>
3960 DEPRECATED(DEPRECATED_MSG)
3961 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
3962  const struct hipChannelFormatDesc& desc) {
3963  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, desc, &tex);
3964 }
3965 #endif
3966 
3967 #if !__HIP_ROCclr__
3968 template <class T, int dim, enum hipTextureReadMode readMode>
3969 DEPRECATED(DEPRECATED_MSG)
3970 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
3971  hipArray_const_t array,
3972  const struct hipChannelFormatDesc* desc) {
3973  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, *desc, tex);
3974 }
3975 #endif
3976 
3977 // C API
3978 #if !__HIP_ROCclr__
3979 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
3980  hipMipmappedArray_const_t mipmappedArray,
3981  const hipChannelFormatDesc* desc);
3982 #endif
3983 
3984 #if !__HIP_ROCclr__
3985 template <class T, int dim, enum hipTextureReadMode readMode>
3986 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3987  hipMipmappedArray_const_t mipmappedArray) {
3988  return hipSuccess;
3989 }
3990 #endif
3991 
3992 #if !__HIP_ROCclr__
3993 template <class T, int dim, enum hipTextureReadMode readMode>
3994 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3995  hipMipmappedArray_const_t mipmappedArray,
3996  const hipChannelFormatDesc& desc) {
3997  return hipSuccess;
3998 }
3999 #endif
4000 
4001 #if __HIP_ROCclr__ && !defined(__HCC__)
4002 
4003 template <typename F>
4004 inline hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
4005  F kernel, size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
4006 return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize,(hipFunction_t)kernel, dynSharedMemPerBlk, blockSizeLimit);
4007 }
4008 
4009 template <class T>
4010 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
4011  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
4012  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
4013  blockDim, kernelParams, sharedMemBytes, stream);
4014 }
4015 
4016 template <class T>
4017 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
4018  unsigned int numDevices, unsigned int flags = 0) {
4019  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
4020 }
4021 
4022 
4023 template <class T>
4024 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
4025  unsigned int numDevices, unsigned int flags = 0) {
4026  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
4027 }
4028 
4029 #endif
4030 
4031 /*
4032  * @brief Unbinds the textuer bound to @p tex
4033  *
4034  * @param[in] tex - texture to unbind
4035  *
4036  * @return #hipSuccess
4037  **/
4038 #if !__HIP_ROCclr__
4039 DEPRECATED(DEPRECATED_MSG)
4040 hipError_t hipUnbindTexture(const textureReference* tex);
4041 #endif
4042 
4043 #if !__HIP_ROCclr__
4044 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
4045 #endif
4046 
4047 #if !__HIP_ROCclr__
4048 template <class T, int dim, enum hipTextureReadMode readMode>
4049 DEPRECATED(DEPRECATED_MSG)
4050 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
4051  return ihipUnbindTextureImpl(tex.textureObject);
4052 }
4053 #endif
4054 
4055 #if !__HIP_ROCclr__
4056 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
4057 
4058 DEPRECATED(DEPRECATED_MSG)
4059 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
4060 
4061 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
4062 
4063 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
4064  const hipTextureDesc* pTexDesc,
4065  const hipResourceViewDesc* pResViewDesc);
4066 
4067 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
4068 
4069 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
4070  hipTextureObject_t textureObject);
4071 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
4072  hipTextureObject_t textureObject);
4073 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
4074  hipTextureObject_t textureObject);
4075 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
4076 
4077 hipError_t hipTexRefGetArray(hipArray_t* array, textureReference tex);
4078 
4079 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
4080 
4081 hipError_t hipTexRefGetAddressMode(hipTextureAddressMode* am, textureReference tex, int dim);
4082 
4083 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
4084 
4085 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
4086 
4087 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
4088 
4089 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
4090  size_t size);
4091 
4092 hipError_t hipTexRefGetAddress(hipDeviceptr_t* dev_ptr, textureReference tex);
4093 
4094 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
4095  hipDeviceptr_t devPtr, size_t pitch);
4096 #endif
4097 
4098 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
4099 
4100 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
4101 
4102 #if __HIP_ROCclr__
4103 template <class T, int dim, enum hipTextureReadMode readMode>
4104 DEPRECATED(DEPRECATED_MSG)
4105 static inline hipError_t hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex,
4106  const void* devPtr, size_t size = UINT_MAX) {
4107  return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
4108 }
4109 
4110 template <class T, int dim, enum hipTextureReadMode readMode>
4111 DEPRECATED(DEPRECATED_MSG)
4112 static inline hipError_t
4113  hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex, const void* devPtr,
4114  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
4115  return hipBindTexture(offset, &tex, devPtr, &desc, size);
4116 }
4117 
4118 template<class T, int dim, enum hipTextureReadMode readMode>
4119 DEPRECATED(DEPRECATED_MSG)
4120 static inline hipError_t hipBindTexture2D(
4121  size_t *offset,
4122  const struct texture<T, dim, readMode> &tex,
4123  const void *devPtr,
4124  size_t width,
4125  size_t height,
4126  size_t pitch)
4127 {
4128  return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
4129 }
4130 
4131 template<class T, int dim, enum hipTextureReadMode readMode>
4132 DEPRECATED(DEPRECATED_MSG)
4133 static inline hipError_t hipBindTexture2D(
4134  size_t *offset,
4135  const struct texture<T, dim, readMode> &tex,
4136  const void *devPtr,
4137  const struct hipChannelFormatDesc &desc,
4138  size_t width,
4139  size_t height,
4140  size_t pitch)
4141 {
4142  return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
4143 }
4144 
4145 template<class T, int dim, enum hipTextureReadMode readMode>
4146 DEPRECATED(DEPRECATED_MSG)
4147 static inline hipError_t hipBindTextureToArray(
4148  const struct texture<T, dim, readMode> &tex,
4149  hipArray_const_t array)
4150 {
4151  struct hipChannelFormatDesc desc;
4152  hipError_t err = hipGetChannelDesc(&desc, array);
4153  return (err == hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
4154 }
4155 
4156 template<class T, int dim, enum hipTextureReadMode readMode>
4157 DEPRECATED(DEPRECATED_MSG)
4158 static inline hipError_t hipBindTextureToArray(
4159  const struct texture<T, dim, readMode> &tex,
4160  hipArray_const_t array,
4161  const struct hipChannelFormatDesc &desc)
4162 {
4163  return hipBindTextureToArray(&tex, array, &desc);
4164 }
4165 
4166 template<class T, int dim, enum hipTextureReadMode readMode>
4167 static inline hipError_t hipBindTextureToMipmappedArray(
4168  const struct texture<T, dim, readMode> &tex,
4169  hipMipmappedArray_const_t mipmappedArray)
4170 {
4171  struct hipChannelFormatDesc desc;
4172  hipArray_t levelArray;
4173  hipError_t err = hipGetMipmappedArrayLevel(&levelArray, mipmappedArray, 0);
4174  if (err != hipSuccess) {
4175  return err;
4176  }
4177  err = hipGetChannelDesc(&desc, levelArray);
4178  return (err == hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
4179 }
4180 
4181 template<class T, int dim, enum hipTextureReadMode readMode>
4182 static inline hipError_t hipBindTextureToMipmappedArray(
4183  const struct texture<T, dim, readMode> &tex,
4184  hipMipmappedArray_const_t mipmappedArray,
4185  const struct hipChannelFormatDesc &desc)
4186 {
4187  return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
4188 }
4189 
4190 template<class T, int dim, enum hipTextureReadMode readMode>
4191 DEPRECATED(DEPRECATED_MSG)
4192 static inline hipError_t hipUnbindTexture(
4193  const struct texture<T, dim, readMode> &tex)
4194 {
4195  return hipUnbindTexture(&tex);
4196 }
4197 #endif
4198 
4199 // doxygen end Texture
4205 #endif
4206 
4207 #ifdef __GNUC__
4208 #pragma GCC visibility pop
4209 #endif
4210 
4228 // end-group HCC_Specific
4234 // doxygen end HIP API
4239 #endif
hipFuncAttributes
Definition: hip_runtime_api.h:128
hipCtxSynchronize
hipError_t hipCtxSynchronize(void)
Blocks until the default context has completed all preceding requested tasks.
Definition: hip_context.cpp:249
hipPointerGetAttributes
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
Definition: hip_memory.cpp:617
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.
hipMemcpy3D
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
Definition: hip_memory.cpp:1712
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.
hipCtxGetCurrent
hipError_t hipCtxGetCurrent(hipCtx_t *ctx)
Get the handle of the current/ default context.
Definition: hip_context.cpp:167
hipMallocPitch
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
Definition: hip_memory.cpp:851
hipSetDevice
hipError_t hipSetDevice(int deviceId)
Set default device to be used for subsequent hip API calls from this thread.
Definition: hip_device.cpp:132
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.
Definition: hip_error.cpp:54
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.
Definition: hip_device.cpp:492
hipMalloc3DArray
hipError_t hipMalloc3DArray(hipArray **array, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int flags)
Allocate an array on the device.
Definition: hip_memory.cpp:1091
hipChooseDevice
hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop)
Device which matches hipDeviceProp_t is returned.
Definition: hip_device.cpp:518
hipIpcCloseMemHandle
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
Definition: hip_memory.cpp:2539
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...
Definition: hip_memory.cpp:2281
ihipIpcEventHandle_t
Definition: hip_hcc_internal.h:408
hipStreamCreate
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
Definition: hip_stream.cpp:106
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.
hipDeviceGetStreamPriorityRange
hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priority.
Definition: hip_stream.cpp:122
hipIpcEventHandle_st
Definition: hip_runtime_api.h:120
hipMemAdviseSetPreferredLocation
@ hipMemAdviseSetPreferredLocation
Definition: hip_runtime_api.h:244
hipStreamCreateWithPriority
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
Definition: hip_stream.cpp:113
hipCtxPushCurrent
hipError_t hipCtxPushCurrent(hipCtx_t ctx)
Push the context to be set as current/ default context.
Definition: hip_context.cpp:154
hipCtxGetDevice
hipError_t hipCtxGetDevice(hipDevice_t *device)
Get the handle of the device associated with current/default context.
Definition: hip_context.cpp:191
hipFuncCache_t
hipFuncCache_t
Definition: hip_runtime_api.h:297
TlsData
Definition: hip_hcc_internal.h:185
hipPeekAtLastError
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
Definition: hip_error.cpp:41
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.
Definition: hip_device.cpp:460
hipHostGetFlags
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
Definition: hip_memory.cpp:1133
hipMemGetAddressRange
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
Definition: hip_memory.cpp:2437
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...
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.
Definition: hip_stream.cpp:130
hipFuncCachePreferEqual
@ hipFuncCachePreferEqual
prefer equal size L1 cache and shared memory
Definition: hip_runtime_api.h:301
hipGetDevice
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
Definition: hip_device.cpp:32
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
Definition: hip_module.cpp:1656
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.
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.
Definition: hip_memory.cpp:1494
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.
Definition: hip_module.cpp:1492
HIP_MEMCPY3D
Definition: driver_types.h:394
hipMemcpyDtoDAsync
hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Device asynchronously.
Definition: hip_memory.cpp:1429
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...
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.
Definition: hip_memory.cpp:2154
hipDevicePrimaryCtxRelease
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
Definition: hip_context.cpp:285
hipCtxGetApiVersion
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion)
Returns the approximate HIP api version.
Definition: hip_context.cpp:207
hipHostMalloc
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
Definition: hip_memory.cpp:762
dim3::y
uint32_t y
y
Definition: hip_runtime_api.h:322
hipDeviceGetName
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
Definition: hip_device.cpp:446
hipMemcpyParam2DAsync
hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D *pCopy, hipStream_t stream __dparm(0))
Copies memory for 2D arrays.
hipModuleUnload
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
Definition: hip_module.cpp:1244
hipDeviceEnablePeerAccess
hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags)
Enable direct access from current device's virtual address space to memory allocations physically loc...
Definition: hip_peer.cpp:200
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.
hipSharedMemConfig
hipSharedMemConfig
Definition: hip_runtime_api.h:308
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:321
hipFuncGetAttribute
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
Definition: hip_module.cpp:1411
hipDeviceComputeCapability
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
Definition: hip_device.cpp:434
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
Definition: hip_module.cpp:1646
hipStreamCallback_t
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:924
hipMemoryAdvise
hipMemoryAdvise
Definition: hip_runtime_api.h:240
hip_Memcpy2D
Definition: driver_types.h:91
hipGetMipmappedArrayLevel
hipError_t hipGetMipmappedArrayLevel(hipArray_t *levelArray, hipMipmappedArray_const_t mipmappedArray, unsigned int level)
Gets a mipmap level of a HIP mipmapped array.
hipCtxGetFlags
hipError_t hipCtxGetFlags(unsigned int *flags)
Return flags used for creating default context.
Definition: hip_context.cpp:254
__hipPushCallConfiguration
hipError_t __hipPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Push configuration of a kernel launch.
hipDevicePrimaryCtxGetState
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
Definition: hip_context.cpp:263
hipDeviceSetCacheConfig
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_device.cpp:74
hipCtxDestroy
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
Definition: hip_context.cpp:109
hipCtxEnablePeerAccess
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
Definition: hip_peer.cpp:221
hipMemcpyAtoH
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1544
hipGetDeviceCount
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
Definition: hip_device.cpp:69
hipSuccess
hipSuccess
Successful completion.
Definition: hip_runtime_api.h:196
hipSetupArgument
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
Definition: hip_clang.cpp:467
hipHostUnregister
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
Definition: hip_memory.cpp:1233
hipStreamGetFlags
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
Definition: hip_stream.cpp:223
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.
hipStreamSynchronize
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
Definition: hip_stream.cpp:184
hipGetErrorName
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
Definition: hip_error.cpp:48
dim3
struct dim3 dim3
hipDeviceGet
hipError_t hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
Definition: hip_context.cpp:70
__host__
#define __host__
Definition: host_defines.h:41
hipMemcpyDtoD
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
Definition: hip_memory.cpp:1390
hipMemcpy3DParms
Definition: driver_types.h:383
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.
hipMemcpyHtoD
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
Definition: hip_memory.cpp:1374
hipDriverGetVersion
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
Definition: hip_context.cpp:85
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.
Definition: hip_memory.cpp:1444
hipMemAllocPitch
hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes)
Definition: hip_memory.cpp:862
hipDeviceProp_t
Definition: hip_runtime_api.h:83
hipMemAllocHost
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:765
hipMallocHost
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:759
hipFuncSetCacheConfig
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
Definition: hip_device.cpp:108
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...
hipRuntimeGetVersion
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
Definition: hip_context.cpp:97
hipConfigureCall
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Configure a kernel launch.
hipEventQuery
hipError_t hipEventQuery(hipEvent_t event)
Query event status.
Definition: hip_event.cpp:394
ihipCtx_t
Definition: hip_hcc_internal.h:938
hipStreamGetPriority
hipError_t hipStreamGetPriority(hipStream_t stream, int *priority)
Query the priority of a stream.
Definition: hip_stream.cpp:238
hipSharedMemBankSizeFourByte
@ hipSharedMemBankSizeFourByte
Definition: hip_runtime_api.h:310
hipEventSynchronize
hipError_t hipEventSynchronize(hipEvent_t event)
Wait for an event to complete.
Definition: hip_event.cpp:300
hipFuncCachePreferNone
@ hipFuncCachePreferNone
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:298
hipOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1667
hipHostFree
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
Definition: hip_memory.cpp:2396
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...
Definition: hip_memory.cpp:2494
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...
Definition: hip_memory.cpp:2271
hipMipmappedArray
Definition: driver_types.h:116
ihipEvent_t
Definition: hip_hcc_internal.h:759
hipMemRangeAttributeAccessedBy
@ hipMemRangeAttributeAccessedBy
Definition: hip_runtime_api.h:262
hipDeviceGetLimit
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
Definition: hip_device.cpp:94
hipLaunchParams_t::args
void ** args
Arguments.
Definition: hip_runtime_api.h:333
hipMalloc
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:695
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.
hipIpcMemHandle_st
Definition: hip_runtime_api.h:111
hipEventElapsedTime
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
Definition: hip_event.cpp:344
hipInit
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
Definition: hip_context.cpp:39
hipGetLastError
hipError_t hipGetLastError(void)
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess...
Definition: hip_error.cpp:32
ihipStream_t
Definition: hip_hcc_internal.h:580
HIP_TEXTURE_DESC_st
Definition: driver_types.h:166
hipArray
Definition: driver_types.h:78
hipIpcGetMemHandle
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
Definition: hip_memory.cpp:2458
hipCtxDisablePeerAccess
hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx)
Disable direct access from current context's virtual address space to memory allocations physically l...
Definition: hip_peer.cpp:227
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.
Definition: hip_memory.cpp:2296
hipEventDestroy
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
Definition: hip_event.cpp:278
hipDeviceSetSharedMemConfig
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
Definition: hip_device.cpp:116
hipDeviceReset
hipError_t hipDeviceReset(void)
The state of current device is discarded and updated to a fresh state.
Definition: hip_device.cpp:148
hipSetDeviceFlags
hipError_t hipSetDeviceFlags(unsigned flags)
The current device behavior is changed according the flags passed.
HIP_ARRAY3D_DESCRIPTOR
Definition: driver_types.h:69
hipMemAdviseUnsetReadMostly
@ hipMemAdviseUnsetReadMostly
Undo the effect of hipMemAdviseSetReadMostly.
Definition: hip_runtime_api.h:243
dim3
Definition: hip_runtime_api.h:320
hipStreamQuery
hipError_t hipStreamQuery(hipStream_t stream)
Return hipSuccess if all of the operations in the specified stream have completed,...
Definition: hip_stream.cpp:161
hipLaunchByPtr
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
Definition: hip_clang.cpp:485
hipExtMallocWithFlags
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:723
hipDevicePrimaryCtxSetFlags
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
Definition: hip_context.cpp:321
hipPointerAttribute_t
Definition: hip_runtime_api.h:161
hipFree
hipError_t hipFree(void *ptr)
Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSy...
Definition: hip_memory.cpp:2344
hipLaunchParams_t::func
void * func
Device function symbol.
Definition: hip_runtime_api.h:330
hipArrayDefault
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:221
hipDevicePrimaryCtxRetain
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
Definition: hip_context.cpp:296
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
hipModuleLoad
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
Definition: hip_module.cpp:1497
hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
Definition: hip_module.cpp:1698
hipFreeHost
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_runtime_api.h:816
hipMemcpyHtoA
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1528
hipModuleGetFunction
hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname)
Function with kname will be extracted if present in module.
Definition: hip_module.cpp:1309
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...
Definition: hip_stream.cpp:258
hipLaunchParams_t::stream
hipStream_t stream
Stream identifier.
Definition: hip_runtime_api.h:335
hipMemcpyDtoHAsync
hipError_t hipMemcpyDtoHAsync(void *dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Host asynchronously.
Definition: hip_memory.cpp:1437
hipMemRangeAttributeReadMostly
@ hipMemRangeAttributeReadMostly
Definition: hip_runtime_api.h:259
hipMemRangeAttributeLastPrefetchLocation
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:264
hipFuncGetAttributes
hipError_t hipFuncGetAttributes(struct hipFuncAttributes *attr, const void *func)
Find out attributes for a given function.
Definition: hip_module.cpp:1393
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.
Definition: hip_event.cpp:213
hipLaunchParams_t::gridDim
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:331
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.
Definition: hip_memory.cpp:2020
hipExtent
Definition: driver_types.h:370
hipPitchedPtr
Definition: driver_types.h:363
hipModuleGetGlobal
hipError_t hipModuleGetGlobal(void **, size_t *, hipModule_t, const char *)
returns device memory pointer and size of the kernel present in the module with symbol name
Definition: hip_module.cpp:1113
hipSharedMemBankSizeDefault
@ hipSharedMemBankSizeDefault
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:309
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.
Definition: hip_memory.cpp:2251
hipMemset3D
hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent)
Fills synchronously the memory area pointed to by pitchedDevPtr with the constant value.
Definition: hip_memory.cpp:2286
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.
hipStreamCreateWithFlags
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
Definition: hip_stream.cpp:97
hipDeviceGetAttribute
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
Definition: hip_device.cpp:354
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.
Definition: hip_memory.cpp:1511
ihipModuleSymbol_t
Definition: hip_module.cpp:108
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.
hipMemcpyHtoDAsync
hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void *src, size_t sizeBytes, hipStream_t stream)
Copy data from Host to Device asynchronously.
Definition: hip_memory.cpp:1422
hipMemcpyDtoH
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
Definition: hip_memory.cpp:1382
hipDeviceGetCacheConfig
hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
Definition: hip_device.cpp:82
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.
Definition: hip_peer.cpp:207
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.
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)
Definition: hip_intercept.cpp:33
hipGetDeviceProperties
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
Definition: hip_device.cpp:381
hipMemcpy
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
Definition: hip_memory.cpp:1367
hipEventCreateWithFlags
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
Definition: hip_event.cpp:201
hipMemAdviseUnsetAccessedBy
@ hipMemAdviseUnsetAccessedBy
Definition: hip_runtime_api.h:249
hipCtxGetSharedMemConfig
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
Definition: hip_context.cpp:241
hipDeviceTotalMem
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
Definition: hip_device.cpp:480
hipFreeArray
hipError_t hipFreeArray(hipArray *array)
Frees an array on the device.
Definition: hip_memory.cpp:2409
hip_texture_types.h
Defines the different newt vector types for HIP runtime.
textureReference
Definition: texture_types.h:74
hipCtxPopCurrent
hipError_t hipCtxPopCurrent(hipCtx_t *ctx)
Pop the current/default context and return the popped context.
Definition: hip_context.cpp:133
hipDeviceCanAccessPeer
hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer's memory.
Definition: hip_peer.cpp:186
hipMemAdviseUnsetPreferredLocation
@ hipMemAdviseUnsetPreferredLocation
Clear the preferred location for the data.
Definition: hip_runtime_api.h:246
hipCtxSetCurrent
hipError_t hipCtxSetCurrent(hipCtx_t ctx)
Set the passed context as current/default.
Definition: hip_context.cpp:178
HIP_RESOURCE_DESC_st
Definition: driver_types.h:288
hipTextureDesc
Definition: texture_types.h:95
hipResourceViewDesc
Definition: driver_types.h:323
dim3::z
uint32_t z
z
Definition: hip_runtime_api.h:323
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...
Definition: hip_memory.cpp:2261
hipCtxSetCacheConfig
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_context.cpp:225
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:62
hipCtxCreate
hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device)
Create a context and set it as current/ default context.
Definition: hip_context.cpp:52
hipLaunchParams_t::blockDim
dim3 blockDim
Block dimentions.
Definition: hip_runtime_api.h:332
hipMemAttachGlobal
#define hipMemAttachGlobal
Memory can be accessed by any stream on any device.
Definition: hip_runtime_api.h:191
hipLaunchParams_t
Definition: hip_runtime_api.h:329
hipFuncCachePreferShared
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:299
hipMemRangeAttributePreferredLocation
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:261
hipMemAdviseSetReadMostly
@ hipMemAdviseSetReadMostly
Definition: hip_runtime_api.h:241
hipCtxSetSharedMemConfig
hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config)
Set Shared memory bank configuration.
Definition: hip_context.cpp:233
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.
hipSharedMemBankSizeEightByte
@ hipSharedMemBankSizeEightByte
Definition: hip_runtime_api.h:312
hipModuleOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1677
hipDeviceAttribute_t
hipDeviceAttribute_t
Definition: hip_runtime_api.h:289
hipExtGetLinkTypeAndHopCount
hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t *linktype, uint32_t *hopcount)
Returns the link type and hop count between two devices.
Definition: hip_device.cpp:605
hipMemAdviseSetAccessedBy
@ hipMemAdviseSetAccessedBy
Definition: hip_runtime_api.h:247
hipResourceDesc
Definition: driver_types.h:262
ihipModule_t
Definition: hip_hcc_internal.h:415
hipDeviceSynchronize
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
Definition: hip_device.cpp:143
hipLaunchParams_t::sharedMem
size_t sharedMem
Shared memory.
Definition: hip_runtime_api.h:334
hipProfilerStart
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2496
hipDeviceGetSharedMemConfig
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current device.
Definition: hip_device.cpp:124
hipMemcpyAsync
hipError_t hipMemcpyAsync(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset...
hipStreamDestroy
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
Definition: hip_stream.cpp:195
hipHostRegister
hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
Register host memory so it can be accessed from the current device.
Definition: hip_memory.cpp:1158
hipProfilerStop
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2502
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....
Definition: hip_module.cpp:1511
hipEventCreate
hipError_t hipEventCreate(hipEvent_t *event)
Definition: hip_event.cpp:207
HIP_RESOURCE_VIEW_DESC_st
Definition: driver_types.h:338
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...
hipCtxGetCacheConfig
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
Definition: hip_context.cpp:217
hipFuncCachePreferL1
@ hipFuncCachePreferL1
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:300
hipMemAttachSingle
#define hipMemAttachSingle
the associated device
Definition: hip_runtime_api.h:193
hipMemcpyParam2D
hipError_t hipMemcpyParam2D(const hip_Memcpy2D *pCopy)
Copies memory for 2D arrays.
Definition: hip_memory.cpp:2144
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:771
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...
Definition: hip_memory.cpp:2220
hipDeviceDisablePeerAccess
hipError_t hipDeviceDisablePeerAccess(int peerDeviceId)
Disable direct access from current device's virtual address space to memory allocations physically lo...
Definition: hip_peer.cpp:193
__hipPopCallConfiguration
hipError_t __hipPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, hipStream_t *stream)
Pop configuration of a kernel launch.
Definition: hip_clang.cpp:409
hipDevicePrimaryCtxReset
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
Definition: hip_context.cpp:308
hipChannelFormatDesc
Definition: driver_types.h:38
hipMemRangeAttribute
hipMemRangeAttribute
Definition: hip_runtime_api.h:258