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 // Flags that can be used with hipExtLaunch Set of APIs
236 #define hipExtAnyOrderLaunch 0x01
237 
238 /*
239  * @brief HIP Memory Advise values
240  * @enum
241  * @ingroup Enumerations
242  */
243 typedef enum hipMemoryAdvise {
255 
256 /*
257  * @brief HIP range attributes
258  * @enum
259  * @ingroup Enumerations
260  */
261 typedef enum hipMemRangeAttribute {
269 
270 /*
271  * @brief hipJitOption
272  * @enum
273  * @ingroup Enumerations
274  */
275 typedef enum hipJitOption {
276  hipJitOptionMaxRegisters = 0,
277  hipJitOptionThreadsPerBlock,
278  hipJitOptionWallTime,
279  hipJitOptionInfoLogBuffer,
280  hipJitOptionInfoLogBufferSizeBytes,
281  hipJitOptionErrorLogBuffer,
282  hipJitOptionErrorLogBufferSizeBytes,
283  hipJitOptionOptimizationLevel,
284  hipJitOptionTargetFromContext,
285  hipJitOptionTarget,
286  hipJitOptionFallbackStrategy,
287  hipJitOptionGenerateDebugInfo,
288  hipJitOptionLogVerbose,
289  hipJitOptionGenerateLineInfo,
290  hipJitOptionCacheMode,
291  hipJitOptionSm3xOpt,
292  hipJitOptionFastCompile,
293  hipJitOptionNumOptions
294 } hipJitOption;
295 
299 typedef enum hipFuncAttribute {
300  hipFuncAttributeMaxDynamicSharedMemorySize = 8,
301  hipFuncAttributePreferredSharedMemoryCarveout = 9,
302  hipFuncAttributeMax
304 
308 typedef enum hipFuncCache_t {
314 
318 typedef enum hipSharedMemConfig {
325 
330 typedef struct dim3 {
331  uint32_t x;
332  uint32_t y;
333  uint32_t z;
334 #ifdef __cplusplus
335  __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
336 #endif
338 
339 typedef struct hipLaunchParams_t {
340  void* func;
343  void **args;
344  size_t sharedMem;
347 
348 #if __HIP_HAS_GET_PCH
349 
354  void __hipGetPCH(const char** pch, unsigned int*size);
355 #endif
356 
357 
358 // Doxygen end group GlobalDefs
362 //-------------------------------------------------------------------------------------------------
363 
364 
365 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
366 // out-of-scope.
367 // typedef class ihipStream_t * hipStream_t;
368 
369 
370 /*
371  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
372  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
373  * out-of-scope but the true event is being written by some async queue or device */
374 // typedef struct hipEvent_t {
375 // struct ihipEvent_t *_handle;
376 //} hipEvent_t;
377 
378 
404 hipError_t hipDeviceSynchronize(void);
405 
406 
418 hipError_t hipDeviceReset(void);
419 
420 
452 hipError_t hipSetDevice(int deviceId);
453 
454 
468 hipError_t hipGetDevice(int* deviceId);
469 
470 
483 hipError_t hipGetDeviceCount(int* count);
484 
494 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
495 
509 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
510 
511 
522 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
523 
524 
535 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
536 
547 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
548 
549 
563 hipError_t hipFuncSetAttribute(const void* func, hipFuncAttribute attr, int value);
564 
575 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
576 
589 hipError_t hipFuncSetSharedMemConfig(const void* func, hipSharedMemConfig config);
590 
603 
611 hipError_t hipGetDeviceFlags(unsigned int* flags);
612 
625 
650 hipError_t hipSetDeviceFlags(unsigned flags);
651 
660 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
661 
674 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
675 
676 // end doxygen Device
699 hipError_t hipGetLastError(void);
700 
701 
712 hipError_t hipPeekAtLastError(void);
713 
714 
723 const char* hipGetErrorName(hipError_t hip_error);
724 
725 
736 const char* hipGetErrorString(hipError_t hipError);
737 
738 // end doxygen Error
771 hipError_t hipStreamCreate(hipStream_t* stream);
772 
773 
791 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
792 
793 
812 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
813 
814 
829 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
830 
831 
850 hipError_t hipStreamDestroy(hipStream_t stream);
851 
852 
868 hipError_t hipStreamQuery(hipStream_t stream);
869 
870 
890 hipError_t hipStreamSynchronize(hipStream_t stream);
891 
892 
912 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
913 
914 
928 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
929 
930 
944 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
945 
946 
966 hipError_t hipExtStreamCreateWithCUMask(hipStream_t* stream, uint32_t cuMaskSize, const uint32_t* cuMask);
967 
968 
972 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
973 
989 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
990  unsigned int flags);
991 
992 
993 // end doxygen Stream
1030 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
1031 
1032 
1044 hipError_t hipEventCreate(hipEvent_t* event);
1045 
1046 
1074 #ifdef __cplusplus
1075 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1076 #else
1077 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
1078 #endif
1079 
1096 hipError_t hipEventDestroy(hipEvent_t event);
1097 
1098 
1116 hipError_t hipEventSynchronize(hipEvent_t event);
1117 
1118 
1147 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1148 
1149 
1165 hipError_t hipEventQuery(hipEvent_t event);
1166 
1167 
1168 // end doxygen Events
1199 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1200 
1214 hipError_t hipMalloc(void** ptr, size_t size);
1215 
1230 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1231 
1244 DEPRECATED("use hipHostMalloc instead")
1245 hipError_t hipMallocHost(void** ptr, size_t size);
1246 
1259 DEPRECATED("use hipHostMalloc instead")
1260 hipError_t hipMemAllocHost(void** ptr, size_t size);
1261 
1275 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1276 
1287 hipError_t hipMallocManaged(void** dev_ptr,
1288  size_t size,
1289  unsigned int flags __dparm(hipMemAttachGlobal));
1290 
1304 DEPRECATED("use hipHostMalloc instead")
1305 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1306 
1318 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1319 
1329 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1330 
1367 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1368 
1377 hipError_t hipHostUnregister(void* hostPtr);
1378 
1398 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1399 
1422 hipError_t hipMemAllocPitch(hipDeviceptr_t* dptr, size_t* pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes);
1423 
1437 hipError_t hipFree(void* ptr);
1438 
1449 DEPRECATED("use hipHostFree instead")
1450 hipError_t hipFreeHost(void* ptr);
1451 
1465 hipError_t hipHostFree(void* ptr);
1466 
1496 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1497 
1498 // TODO: Add description
1499 hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
1500  hipMemcpyKind kind, hipStream_t stream);
1518 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1519 
1537 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1538 
1556 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1557 
1575 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1576 
1594 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1595 
1613 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1614  hipStream_t stream);
1615 
1616 #if __HIP_ROCclr__
1617 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1618  hipModule_t hmod, const char* name);
1619 
1620 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol);
1621 hipError_t hipGetSymbolSize(size_t* size, const void* symbol);
1622 hipError_t hipMemcpyToSymbol(const void* symbol, const void* src,
1623  size_t sizeBytes, size_t offset __dparm(0),
1624  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1625 hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src,
1626  size_t sizeBytes, size_t offset,
1627  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1628 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbol,
1629  size_t sizeBytes, size_t offset __dparm(0),
1630  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1631 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbol,
1632  size_t sizeBytes, size_t offset,
1633  hipMemcpyKind kind,
1634  hipStream_t stream __dparm(0));
1635 #else
1636 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1637 
1638 #ifdef __cplusplus //Start : Not supported in gcc
1639 namespace hip_impl {
1640 inline
1641 __attribute__((visibility("hidden")))
1642 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1643  const char* name);
1644 } // Namespace hip_impl.
1645 
1646 
1657 inline
1658 __attribute__((visibility("hidden")))
1659 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
1660  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
1661  hip_impl::hip_init();
1662  size_t size = 0;
1663  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
1664 }
1665 
1666 
1677 inline
1678 __attribute__((visibility("hidden")))
1679 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
1680  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
1681  hip_impl::hip_init();
1682  void* devPtr = nullptr;
1683  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
1684 }
1685 #endif // End : Not supported in gcc
1686 
1687 #if defined(__cplusplus)
1688 } // extern "C"
1689 #endif
1690 
1691 #ifdef __cplusplus
1692 namespace hip_impl {
1693 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
1694  const char*);
1695 } // Namespace hip_impl.
1696 #endif
1697 
1698 #if defined(__cplusplus)
1699 extern "C" {
1700 #endif
1701 
1725 #ifdef __cplusplus
1726 inline
1727 __attribute__((visibility("hidden")))
1728 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1729  size_t sizeBytes, size_t offset __dparm(0),
1730  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
1731  if (!symbolName) return hipErrorInvalidSymbol;
1732 
1733  hipDeviceptr_t dst = NULL;
1734  hipGetSymbolAddress(&dst, (const char*)symbolName);
1735 
1736  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
1737  (const char*)symbolName);
1738 }
1739 #endif
1740 
1741 #if defined(__cplusplus)
1742 } // extern "C"
1743 #endif
1744 
1745 #ifdef __cplusplus
1746 namespace hip_impl {
1747 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
1748  hipMemcpyKind, hipStream_t, const char*);
1749 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
1750  hipMemcpyKind, const char*);
1751 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
1752  hipMemcpyKind, hipStream_t, const char*);
1753 } // Namespace hip_impl.
1754 #endif
1755 
1756 #if defined(__cplusplus)
1757 extern "C" {
1758 #endif
1759 
1786 #ifdef __cplusplus //Start : Not supported in gcc
1787 inline
1788 __attribute__((visibility("hidden")))
1789 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1790  size_t sizeBytes, size_t offset,
1791  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
1792  if (!symbolName) return hipErrorInvalidSymbol;
1793 
1794  hipDeviceptr_t dst = NULL;
1795  hipGetSymbolAddress(&dst, symbolName);
1796 
1797  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
1798  stream,
1799  (const char*)symbolName);
1800 }
1801 
1802 inline
1803 __attribute__((visibility("hidden")))
1804 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1805  size_t sizeBytes, size_t offset __dparm(0),
1806  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
1807  if (!symbolName) return hipErrorInvalidSymbol;
1808 
1809  hipDeviceptr_t src = NULL;
1810  hipGetSymbolAddress(&src, symbolName);
1811 
1812  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
1813  (const char*)symbolName);
1814 }
1815 
1816 inline
1817 __attribute__((visibility("hidden")))
1818 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1819  size_t sizeBytes, size_t offset,
1820  hipMemcpyKind kind,
1821  hipStream_t stream __dparm(0)) {
1822  if (!symbolName) return hipErrorInvalidSymbol;
1823 
1824  hipDeviceptr_t src = NULL;
1825  hipGetSymbolAddress(&src, symbolName);
1826 
1827  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
1828  stream,
1829  (const char*)symbolName);
1830 }
1831 #endif // End : Not supported in gcc
1832 
1833 #endif // __HIP_ROCclr__
1834 
1862 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
1863  hipStream_t stream __dparm(0));
1864 
1874 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
1875 
1885 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count);
1886 
1902 hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0));
1903 
1913 hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count);
1914 
1930 hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0));
1931 
1941 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
1942 
1958 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
1959 
1975 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
1976  hipStream_t stream __dparm(0));
1977 
1989 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
1990 
2003 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
2004 
2013 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
2014 
2024 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
2025 
2035 hipError_t hipMemGetInfo(size_t* free, size_t* total);
2036 
2037 
2038 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
2039 
2040 
2053 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
2054  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
2055 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
2056 
2057 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
2058 
2059 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
2060 
2069 hipError_t hipFreeArray(hipArray* array);
2070 
2078 hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray);
2079 
2092 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
2093  struct hipExtent extent, unsigned int flags);
2094 
2107  hipMipmappedArray_t *mipmappedArray,
2108  const struct hipChannelFormatDesc* desc,
2109  struct hipExtent extent,
2110  unsigned int numLevels,
2111  unsigned int flags __dparm(0));
2112 
2123  hipArray_t *levelArray,
2124  hipMipmappedArray_const_t mipmappedArray,
2125  unsigned int level);
2126 
2143 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2144  size_t height, hipMemcpyKind kind);
2145 
2155 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
2156 
2167 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
2168 
2186 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2187  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2188 
2206 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2207  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
2208 
2224 DEPRECATED(DEPRECATED_MSG)
2225 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2226  size_t count, hipMemcpyKind kind);
2227 
2243 DEPRECATED(DEPRECATED_MSG)
2244 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
2245  size_t count, hipMemcpyKind kind);
2246 
2264 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);
2265 
2284 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));
2285 
2299 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
2300 
2314 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2315 
2326 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2327 
2339 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2340 
2351 hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D* pCopy);
2352 
2364 hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D* pCopy, hipStream_t stream);
2365 
2366 // doxygen end Memory
2398 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2399 
2400 
2417 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2418 
2419 
2431 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2432 
2445 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2446 
2447 #ifndef USE_PEER_NON_UNIFIED
2448 #define USE_PEER_NON_UNIFIED 1
2449 #endif
2450 
2451 #if USE_PEER_NON_UNIFIED == 1
2452 
2463 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2464  size_t sizeBytes);
2465 
2478 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2479  size_t sizeBytes, hipStream_t stream __dparm(0));
2480 #endif
2481 
2482 
2483 // doxygen end PeerToPeer
2502 // TODO-ctx - more description on error codes.
2503 hipError_t hipInit(unsigned int flags);
2504 
2505 
2525 DEPRECATED(DEPRECATED_MSG)
2526 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2527 
2538 DEPRECATED(DEPRECATED_MSG)
2539 hipError_t hipCtxDestroy(hipCtx_t ctx);
2540 
2551 DEPRECATED(DEPRECATED_MSG)
2552 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2553 
2564 DEPRECATED(DEPRECATED_MSG)
2565 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2566 
2577 DEPRECATED(DEPRECATED_MSG)
2578 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2579 
2590 DEPRECATED(DEPRECATED_MSG)
2591 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2592 
2604 DEPRECATED(DEPRECATED_MSG)
2605 hipError_t hipCtxGetDevice(hipDevice_t* device);
2606 
2624 DEPRECATED(DEPRECATED_MSG)
2625 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2626 
2640 DEPRECATED(DEPRECATED_MSG)
2641 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2642 
2656 DEPRECATED(DEPRECATED_MSG)
2657 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2658 
2672 DEPRECATED(DEPRECATED_MSG)
2673 hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config);
2674 
2688 DEPRECATED(DEPRECATED_MSG)
2689 hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig);
2690 
2702 DEPRECATED(DEPRECATED_MSG)
2703 hipError_t hipCtxSynchronize(void);
2704 
2715 DEPRECATED(DEPRECATED_MSG)
2716 hipError_t hipCtxGetFlags(unsigned int* flags);
2717 
2737 DEPRECATED(DEPRECATED_MSG)
2738 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2739 
2756 DEPRECATED(DEPRECATED_MSG)
2757 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
2758 
2771 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
2772 
2785 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
2786 
2798 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
2799 
2810 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
2811 
2823 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
2824 
2825 // doxygen end Context Management
2837 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
2838 
2847 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
2848 
2857 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
2858 
2859 
2869 hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr,
2870  int srcDevice, int dstDevice);
2871 
2880 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
2881 
2882 
2890 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
2891 
2892 
2900 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
2901 
2917 hipError_t hipDriverGetVersion(int* driverVersion);
2918 
2931 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
2932 
2944 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
2945 
2956 hipError_t hipModuleUnload(hipModule_t module);
2957 
2968 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
2969 
2979 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
2980 
2990 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
2991 
2992 #if !__HIP_ROCclr__
2993 #if defined(__cplusplus)
2994 } // extern "C"
2995 #endif
2996 
2997 #ifdef __cplusplus
2998 namespace hip_impl {
2999  class agent_globals_impl;
3000  class agent_globals {
3001  public:
3002  agent_globals();
3003  ~agent_globals();
3004  agent_globals(const agent_globals&) = delete;
3005 
3006  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
3007  hipModule_t hmod, const char* name);
3008  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
3009  const char* name);
3010  private:
3011  agent_globals_impl* impl;
3012  };
3013 
3014  inline
3015  __attribute__((visibility("hidden")))
3016  agent_globals& get_agent_globals() {
3017  static agent_globals ag;
3018  return ag;
3019  }
3020 
3021  extern "C"
3022  inline
3023  __attribute__((visibility("hidden")))
3024  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
3025  const char* name) {
3026  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
3027  }
3028 } // Namespace hip_impl.
3029 #endif
3030 
3031 #if defined(__cplusplus)
3032 extern "C" {
3033 #endif
3034 
3045 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
3046  hipModule_t hmod, const char* name);
3047 #endif // __HIP_ROCclr__
3048 
3049 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
3050 
3060 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
3061 
3074 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
3075  hipJitOption* options, void** optionValues);
3076 
3101 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
3102  unsigned int gridDimZ, unsigned int blockDimX,
3103  unsigned int blockDimY, unsigned int blockDimZ,
3104  unsigned int sharedMemBytes, hipStream_t stream,
3105  void** kernelParams, void** extra);
3106 
3107 
3108 #if __HIP_ROCclr__ && !defined(__HCC__)
3109 
3124 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
3125  void** kernelParams, unsigned int sharedMemBytes,
3126  hipStream_t stream);
3127 
3138 hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3139  int numDevices, unsigned int flags);
3140 
3141 #endif
3142 
3155 //TODO - Match CUoccupancyB2DSize
3156 hipError_t hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3157  hipFunction_t f, size_t dynSharedMemPerBlk,
3158  int blockSizeLimit);
3159 
3172 //TODO - Match CUoccupancyB2DSize
3173 hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3174  hipFunction_t f, size_t dynSharedMemPerBlk,
3175  int blockSizeLimit, unsigned int flags);
3176 
3186  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk);
3187 
3198  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
3199 
3209  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk);
3210 
3221  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
3222 
3234 hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3235  const void* f, size_t dynSharedMemPerBlk,
3236  int blockSizeLimit);
3237 
3250  int numDevices, unsigned int flags);
3251 
3252 
3253 // doxygen end Version Management
3271 // TODO - expand descriptions:
3277 DEPRECATED("use roctracer/rocTX instead")
3278 hipError_t hipProfilerStart();
3279 
3280 
3286 DEPRECATED("use roctracer/rocTX instead")
3287 hipError_t hipProfilerStop();
3288 
3289 
3294 // TODO: implement IPC apis
3295 
3321 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
3322 
3359 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
3360 
3379 hipError_t hipIpcCloseMemHandle(void* devPtr);
3380 
3381 
3382 hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event);
3383 hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
3384 
3385 
3406 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3407 
3408 
3419 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3420 
3421 
3430 hipError_t hipLaunchByPtr(const void* func);
3431 
3432 
3448  dim3 blockDim,
3449  size_t sharedMem __dparm(0),
3450  hipStream_t stream __dparm(0));
3451 
3465 hipError_t __hipPopCallConfiguration(dim3 *gridDim,
3466  dim3 *blockDim,
3467  size_t *sharedMem,
3468  hipStream_t *stream);
3469 
3485 hipError_t hipLaunchKernel(const void* function_address,
3486  dim3 numBlocks,
3487  dim3 dimBlocks,
3488  void** args,
3489  size_t sharedMemBytes __dparm(0),
3490  hipStream_t stream __dparm(0));
3491 
3502 hipError_t hipMemPrefetchAsync(const void* dev_ptr,
3503  size_t count,
3504  int device,
3505  hipStream_t stream __dparm(0));
3506 
3517 hipError_t hipMemAdvise(const void* dev_ptr,
3518  size_t count,
3519  hipMemoryAdvise advice,
3520  int device);
3521 
3534 hipError_t hipMemRangeGetAttribute(void* data,
3535  size_t data_size,
3536  hipMemRangeAttribute attribute,
3537  const void* dev_ptr,
3538  size_t count);
3539 
3554 hipError_t hipMemRangeGetAttributes(void** data,
3555  size_t* data_sizes,
3556  hipMemRangeAttribute* attributes,
3557  size_t num_attributes,
3558  const void* dev_ptr,
3559  size_t count);
3560 
3574  hipDeviceptr_t* dev_ptr,
3575  size_t length __dparm(0),
3576  unsigned int flags __dparm(hipMemAttachSingle));
3577 
3578 #if __HIP_ROCclr__ || !defined(__HCC__)
3579 //TODO: Move this to hip_ext.h
3580 hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks, dim3 dimBlocks,
3581  void** args, size_t sharedMemBytes, hipStream_t stream,
3582  hipEvent_t startEvent, hipEvent_t stopEvent, int flags);
3583 
3584 DEPRECATED(DEPRECATED_MSG)
3585 hipError_t hipBindTexture(
3586  size_t* offset,
3587  const textureReference* tex,
3588  const void* devPtr,
3589  const hipChannelFormatDesc* desc,
3590  size_t size __dparm(UINT_MAX));
3591 
3592 DEPRECATED(DEPRECATED_MSG)
3593 hipError_t hipBindTexture2D(
3594  size_t* offset,
3595  const textureReference* tex,
3596  const void* devPtr,
3597  const hipChannelFormatDesc* desc,
3598  size_t width,
3599  size_t height,
3600  size_t pitch);
3601 
3602 DEPRECATED(DEPRECATED_MSG)
3603 hipError_t hipBindTextureToArray(
3604  const textureReference* tex,
3605  hipArray_const_t array,
3606  const hipChannelFormatDesc* desc);
3607 
3608 hipError_t hipBindTextureToMipmappedArray(
3609  const textureReference* tex,
3610  hipMipmappedArray_const_t mipmappedArray,
3611  const hipChannelFormatDesc* desc);
3612 
3613 DEPRECATED(DEPRECATED_MSG)
3614 hipError_t hipGetTextureAlignmentOffset(
3615  size_t* offset,
3616  const textureReference* texref);
3617 
3618 hipError_t hipGetTextureReference(
3619  const textureReference** texref,
3620  const void* symbol);
3621 
3622 DEPRECATED(DEPRECATED_MSG)
3623 hipError_t hipUnbindTexture(const textureReference* tex);
3624 
3625 hipError_t hipCreateTextureObject(
3626  hipTextureObject_t* pTexObject,
3627  const hipResourceDesc* pResDesc,
3628  const hipTextureDesc* pTexDesc,
3629  const struct hipResourceViewDesc* pResViewDesc);
3630 
3631 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3632 
3633 hipError_t hipGetChannelDesc(
3634  hipChannelFormatDesc* desc,
3635  hipArray_const_t array);
3636 
3637 hipError_t hipGetTextureObjectResourceDesc(
3638  hipResourceDesc* pResDesc,
3639  hipTextureObject_t textureObject);
3640 
3641 hipError_t hipGetTextureObjectResourceViewDesc(
3642  struct hipResourceViewDesc* pResViewDesc,
3643  hipTextureObject_t textureObject);
3644 
3645 hipError_t hipGetTextureObjectTextureDesc(
3646  hipTextureDesc* pTexDesc,
3647  hipTextureObject_t textureObject);
3648 
3649 hipError_t hipTexRefGetAddress(
3650  hipDeviceptr_t* dev_ptr,
3651  const textureReference* texRef);
3652 
3653 hipError_t hipTexRefGetAddressMode(
3654  enum hipTextureAddressMode* pam,
3655  const textureReference* texRef,
3656  int dim);
3657 
3658 hipError_t hipTexRefGetFilterMode(
3659  enum hipTextureFilterMode* pfm,
3660  const textureReference* texRef);
3661 
3662 hipError_t hipTexRefGetFlags(
3663  unsigned int* pFlags,
3664  const textureReference* texRef);
3665 
3666 hipError_t hipTexRefGetFormat(
3667  hipArray_Format* pFormat,
3668  int* pNumChannels,
3669  const textureReference* texRef);
3670 
3671 hipError_t hipTexRefGetMaxAnisotropy(
3672  int* pmaxAnsio,
3673  const textureReference* texRef);
3674 
3675 hipError_t hipTexRefGetMipmapFilterMode(
3676  enum hipTextureFilterMode* pfm,
3677  const textureReference* texRef);
3678 
3679 hipError_t hipTexRefGetMipmapLevelBias(
3680  float* pbias,
3681  const textureReference* texRef);
3682 
3683 hipError_t hipTexRefGetMipmapLevelClamp(
3684  float* pminMipmapLevelClamp,
3685  float* pmaxMipmapLevelClamp,
3686  const textureReference* texRef);
3687 
3688 hipError_t hipTexRefGetMipMappedArray(
3689  hipMipmappedArray_t* pArray,
3690  const textureReference* texRef);
3691 
3692 hipError_t hipTexRefSetAddress(
3693  size_t* ByteOffset,
3694  textureReference* texRef,
3695  hipDeviceptr_t dptr,
3696  size_t bytes);
3697 
3698 hipError_t hipTexRefSetAddress2D(
3699  textureReference* texRef,
3700  const HIP_ARRAY_DESCRIPTOR* desc,
3701  hipDeviceptr_t dptr,
3702  size_t Pitch);
3703 
3704 hipError_t hipTexRefSetAddressMode(
3705  textureReference* texRef,
3706  int dim,
3707  enum hipTextureAddressMode am);
3708 
3709 hipError_t hipTexRefSetArray(
3710  textureReference* tex,
3711  hipArray_const_t array,
3712  unsigned int flags);
3713 
3714 hipError_t hipTexRefSetBorderColor(
3715  textureReference* texRef,
3716  float* pBorderColor);
3717 
3718 hipError_t hipTexRefSetFilterMode(
3719  textureReference* texRef,
3720  enum hipTextureFilterMode fm);
3721 
3722 hipError_t hipTexRefSetFlags(
3723  textureReference* texRef,
3724  unsigned int Flags);
3725 
3726 hipError_t hipTexRefSetFormat(
3727  textureReference* texRef,
3728  hipArray_Format fmt,
3729  int NumPackedComponents);
3730 
3731 hipError_t hipTexRefSetMaxAnisotropy(
3732  textureReference* texRef,
3733  unsigned int maxAniso);
3734 
3735 hipError_t hipTexRefSetMipmapFilterMode(
3736  textureReference* texRef,
3737  enum hipTextureFilterMode fm);
3738 
3739 hipError_t hipTexRefSetMipmapLevelBias(
3740  textureReference* texRef,
3741  float bias);
3742 
3743 hipError_t hipTexRefSetMipmapLevelClamp(
3744  textureReference* texRef,
3745  float minMipMapLevelClamp,
3746  float maxMipMapLevelClamp);
3747 
3748 hipError_t hipTexRefSetMipmappedArray(
3749  textureReference* texRef,
3750  struct hipMipmappedArray* mipmappedArray,
3751  unsigned int Flags);
3752 
3753 hipError_t hipMipmappedArrayCreate(
3754  hipMipmappedArray_t* pHandle,
3755  HIP_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc,
3756  unsigned int numMipmapLevels);
3757 
3758 hipError_t hipMipmappedArrayDestroy(
3759  hipMipmappedArray_t hMipmappedArray);
3760 
3761 hipError_t hipMipmappedArrayGetLevel(
3762  hipArray_t* pLevelArray,
3763  hipMipmappedArray_t hMipMappedArray,
3764  unsigned int level);
3765 
3766 hipError_t hipTexObjectCreate(
3767  hipTextureObject_t* pTexObject,
3768  const HIP_RESOURCE_DESC* pResDesc,
3769  const HIP_TEXTURE_DESC* pTexDesc,
3770  const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
3771 
3772 hipError_t hipTexObjectDestroy(
3773  hipTextureObject_t texObject);
3774 
3775 hipError_t hipTexObjectGetResourceDesc(
3776  HIP_RESOURCE_DESC* pResDesc,
3777  hipTextureObject_t texObject);
3778 
3779 hipError_t hipTexObjectGetResourceViewDesc(
3780  HIP_RESOURCE_VIEW_DESC* pResViewDesc,
3781  hipTextureObject_t texObject);
3782 
3783 hipError_t hipTexObjectGetTextureDesc(
3784  HIP_TEXTURE_DESC* pTexDesc,
3785  hipTextureObject_t texObject);
3786 #endif
3787 
3793 #ifdef __cplusplus
3794 } /* extern "c" */
3795 #endif
3796 
3797 #if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3798 template <typename T>
3799 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3800  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0) {
3801  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3802 }
3803 
3804 template <typename T>
3805 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3806  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0, unsigned int flags = 0 ) {
3807  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3808 }
3809 #endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3810 
3811 #if defined(__cplusplus) && !defined(__HCC__)
3812 
3813 template <typename T>
3814 hipError_t hipGetSymbolAddress(void** devPtr, const T &symbol) {
3815  return ::hipGetSymbolAddress(devPtr, (const void *)&symbol);
3816 }
3817 
3818 template <typename T>
3819 hipError_t hipGetSymbolSize(size_t* size, const T &symbol) {
3820  return ::hipGetSymbolSize(size, (const void *)&symbol);
3821 }
3822 
3823 template <typename T>
3824 hipError_t hipMemcpyToSymbol(const T& symbol, const void* src, size_t sizeBytes,
3825  size_t offset __dparm(0),
3826  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
3827  return ::hipMemcpyToSymbol((const void*)&symbol, src, sizeBytes, offset, kind);
3828 }
3829 
3830 template <typename T>
3831 hipError_t hipMemcpyToSymbolAsync(const T& symbol, const void* src, size_t sizeBytes, size_t offset,
3832  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3833  return ::hipMemcpyToSymbolAsync((const void*)&symbol, src, sizeBytes, offset, kind, stream);
3834 }
3835 
3836 template <typename T>
3837 hipError_t hipMemcpyFromSymbol(void* dst, const T &symbol,
3838  size_t sizeBytes, size_t offset __dparm(0),
3839  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
3840  return ::hipMemcpyFromSymbol(dst, (const void*)&symbol, sizeBytes, offset, kind);
3841 }
3842 
3843 template <typename T>
3844 hipError_t hipMemcpyFromSymbolAsync(void* dst, const T& symbol, size_t sizeBytes, size_t offset,
3845  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3846  return ::hipMemcpyFromSymbolAsync(dst, (const void*)&symbol, sizeBytes, offset, kind, stream);
3847 }
3848 
3849 #endif
3850 
3851 #if USE_PROF_API
3852 #include <hip/hcc_detail/hip_prof_str.h>
3853 #endif
3854 
3855 #ifdef __cplusplus
3856 extern "C" {
3857 #endif
3858 
3861 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3862 hipError_t hipRemoveApiCallback(uint32_t id);
3863 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3864 hipError_t hipRemoveActivityCallback(uint32_t id);
3865 const char* hipApiName(uint32_t id);
3866 const char* hipKernelNameRef(const hipFunction_t f);
3867 const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream);
3868 int hipGetStreamDeviceId(hipStream_t stream);
3869 #ifdef __cplusplus
3870 } /* extern "C" */
3871 #endif
3872 
3873 #ifdef __cplusplus
3874 
3875 template <class T>
3877  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk) {
3879  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk);
3880 }
3881 
3882 template <class T>
3884  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
3886  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk, flags);
3887 }
3888 
3889 class TlsData;
3890 
3891 #if !__HIP_ROCclr__
3892 DEPRECATED(DEPRECATED_MSG)
3893 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3894  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3895 #endif
3896 
3897 #if !__HIP_ROCclr__
3898 hipError_t ihipBindTextureImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, size_t* offset,
3899  const void* devPtr, const struct hipChannelFormatDesc* desc,
3900  size_t size, textureReference* tex);
3901 #endif
3902 
3903 /*
3904  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3905  *reference tex.
3906  *
3907  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3908  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3909  *memory previously bound to tex is unbound.
3910  *
3911  * @param[in] offset - Offset in bytes
3912  * @param[out] tex - texture to bind
3913  * @param[in] devPtr - Memory area on device
3914  * @param[in] desc - Channel format
3915  * @param[in] size - Size of the memory area pointed to by devPtr
3916  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3917  **/
3918 #if !__HIP_ROCclr__
3919 template <class T, int dim, enum hipTextureReadMode readMode>
3920 DEPRECATED(DEPRECATED_MSG)
3921 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3922  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3923  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
3924 }
3925 #endif
3926 
3927 /*
3928  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3929  *reference tex.
3930  *
3931  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3932  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3933  *memory previously bound to tex is unbound.
3934  *
3935  * @param[in] offset - Offset in bytes
3936  * @param[in] tex - texture to bind
3937  * @param[in] devPtr - Memory area on device
3938  * @param[in] size - Size of the memory area pointed to by devPtr
3939  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3940  **/
3941 #if !__HIP_ROCclr__
3942 template <class T, int dim, enum hipTextureReadMode readMode>
3943 DEPRECATED(DEPRECATED_MSG)
3944 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3945  size_t size = UINT_MAX) {
3946  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
3947 }
3948 #endif
3949 
3950 // C API
3951 #if !__HIP_ROCclr__
3952 DEPRECATED(DEPRECATED_MSG)
3953 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
3954  const hipChannelFormatDesc* desc, size_t width, size_t height,
3955  size_t pitch);
3956 #endif
3957 
3958 #if !__HIP_ROCclr__
3959 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3960  const void* devPtr, const struct hipChannelFormatDesc* desc,
3961  size_t width, size_t height, textureReference* tex, size_t pitch);
3962 #endif
3963 
3964 #if !__HIP_ROCclr__
3965 template <class T, int dim, enum hipTextureReadMode readMode>
3966 DEPRECATED(DEPRECATED_MSG)
3967 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3968  const void* devPtr, size_t width, size_t height, size_t pitch) {
3969  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
3970  &tex);
3971 }
3972 #endif
3973 
3974 #if !__HIP_ROCclr__
3975 template <class T, int dim, enum hipTextureReadMode readMode>
3976 DEPRECATED(DEPRECATED_MSG)
3977 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3978  const void* devPtr, const struct hipChannelFormatDesc& desc,
3979  size_t width, size_t height, size_t pitch) {
3980  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
3981 }
3982 #endif
3983 
3984 // C API
3985 #if !__HIP_ROCclr__
3986 DEPRECATED(DEPRECATED_MSG)
3987 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
3988  const hipChannelFormatDesc* desc);
3989 #endif
3990 
3991 #if !__HIP_ROCclr__
3992 hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode,
3993  hipArray_const_t array,
3994  const struct hipChannelFormatDesc& desc,
3995  textureReference* tex);
3996 #endif
3997 
3998 #if !__HIP_ROCclr__
3999 template <class T, int dim, enum hipTextureReadMode readMode>
4000 DEPRECATED(DEPRECATED_MSG)
4001 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
4002  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, tex.channelDesc, &tex);
4003 }
4004 #endif
4005 
4006 #if !__HIP_ROCclr__
4007 template <class T, int dim, enum hipTextureReadMode readMode>
4008 DEPRECATED(DEPRECATED_MSG)
4009 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
4010  const struct hipChannelFormatDesc& desc) {
4011  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, desc, &tex);
4012 }
4013 #endif
4014 
4015 #if !__HIP_ROCclr__
4016 template <class T, int dim, enum hipTextureReadMode readMode>
4017 DEPRECATED(DEPRECATED_MSG)
4018 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
4019  hipArray_const_t array,
4020  const struct hipChannelFormatDesc* desc) {
4021  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, *desc, tex);
4022 }
4023 #endif
4024 
4025 // C API
4026 #if !__HIP_ROCclr__
4027 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
4028  hipMipmappedArray_const_t mipmappedArray,
4029  const hipChannelFormatDesc* desc);
4030 #endif
4031 
4032 #if !__HIP_ROCclr__
4033 template <class T, int dim, enum hipTextureReadMode readMode>
4034 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
4035  hipMipmappedArray_const_t mipmappedArray) {
4036  return hipSuccess;
4037 }
4038 #endif
4039 
4040 #if !__HIP_ROCclr__
4041 template <class T, int dim, enum hipTextureReadMode readMode>
4042 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
4043  hipMipmappedArray_const_t mipmappedArray,
4044  const hipChannelFormatDesc& desc) {
4045  return hipSuccess;
4046 }
4047 #endif
4048 
4049 #if __HIP_ROCclr__ && !defined(__HCC__)
4050 
4051 template <typename F>
4052 inline hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
4053  F kernel, size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
4054 return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize,(hipFunction_t)kernel, dynSharedMemPerBlk, blockSizeLimit);
4055 }
4056 
4057 template <class T>
4058 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
4059  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
4060  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
4061  blockDim, kernelParams, sharedMemBytes, stream);
4062 }
4063 
4064 template <class T>
4065 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
4066  unsigned int numDevices, unsigned int flags = 0) {
4067  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
4068 }
4069 
4070 
4071 template <class T>
4072 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
4073  unsigned int numDevices, unsigned int flags = 0) {
4074  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
4075 }
4076 
4077 #endif
4078 
4079 /*
4080  * @brief Unbinds the textuer bound to @p tex
4081  *
4082  * @param[in] tex - texture to unbind
4083  *
4084  * @return #hipSuccess
4085  **/
4086 #if !__HIP_ROCclr__
4087 DEPRECATED(DEPRECATED_MSG)
4088 hipError_t hipUnbindTexture(const textureReference* tex);
4089 #endif
4090 
4091 #if !__HIP_ROCclr__
4092 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
4093 #endif
4094 
4095 #if !__HIP_ROCclr__
4096 template <class T, int dim, enum hipTextureReadMode readMode>
4097 DEPRECATED(DEPRECATED_MSG)
4098 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
4099  return ihipUnbindTextureImpl(tex.textureObject);
4100 }
4101 #endif
4102 
4103 #if !__HIP_ROCclr__
4104 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
4105 
4106 DEPRECATED(DEPRECATED_MSG)
4107 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
4108 
4109 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
4110 
4111 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
4112  const hipTextureDesc* pTexDesc,
4113  const hipResourceViewDesc* pResViewDesc);
4114 
4115 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
4116 
4117 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
4118  hipTextureObject_t textureObject);
4119 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
4120  hipTextureObject_t textureObject);
4121 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
4122  hipTextureObject_t textureObject);
4123 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
4124 
4125 hipError_t hipTexRefGetArray(hipArray_t* array, textureReference tex);
4126 
4127 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
4128 
4129 hipError_t hipTexRefGetAddressMode(hipTextureAddressMode* am, textureReference tex, int dim);
4130 
4131 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
4132 
4133 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
4134 
4135 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
4136 
4137 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
4138  size_t size);
4139 
4140 hipError_t hipTexRefGetAddress(hipDeviceptr_t* dev_ptr, textureReference tex);
4141 
4142 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
4143  hipDeviceptr_t devPtr, size_t pitch);
4144 #endif
4145 
4146 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
4147 
4148 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
4149 
4150 #if __HIP_ROCclr__
4151 template <class T, int dim, enum hipTextureReadMode readMode>
4152 DEPRECATED(DEPRECATED_MSG)
4153 static inline hipError_t hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex,
4154  const void* devPtr, size_t size = UINT_MAX) {
4155  return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
4156 }
4157 
4158 template <class T, int dim, enum hipTextureReadMode readMode>
4159 DEPRECATED(DEPRECATED_MSG)
4160 static inline hipError_t
4161  hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex, const void* devPtr,
4162  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
4163  return hipBindTexture(offset, &tex, devPtr, &desc, size);
4164 }
4165 
4166 template<class T, int dim, enum hipTextureReadMode readMode>
4167 DEPRECATED(DEPRECATED_MSG)
4168 static inline hipError_t hipBindTexture2D(
4169  size_t *offset,
4170  const struct texture<T, dim, readMode> &tex,
4171  const void *devPtr,
4172  size_t width,
4173  size_t height,
4174  size_t pitch)
4175 {
4176  return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
4177 }
4178 
4179 template<class T, int dim, enum hipTextureReadMode readMode>
4180 DEPRECATED(DEPRECATED_MSG)
4181 static inline hipError_t hipBindTexture2D(
4182  size_t *offset,
4183  const struct texture<T, dim, readMode> &tex,
4184  const void *devPtr,
4185  const struct hipChannelFormatDesc &desc,
4186  size_t width,
4187  size_t height,
4188  size_t pitch)
4189 {
4190  return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
4191 }
4192 
4193 template<class T, int dim, enum hipTextureReadMode readMode>
4194 DEPRECATED(DEPRECATED_MSG)
4195 static inline hipError_t hipBindTextureToArray(
4196  const struct texture<T, dim, readMode> &tex,
4197  hipArray_const_t array)
4198 {
4199  struct hipChannelFormatDesc desc;
4200  hipError_t err = hipGetChannelDesc(&desc, array);
4201  return (err == hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
4202 }
4203 
4204 template<class T, int dim, enum hipTextureReadMode readMode>
4205 DEPRECATED(DEPRECATED_MSG)
4206 static inline hipError_t hipBindTextureToArray(
4207  const struct texture<T, dim, readMode> &tex,
4208  hipArray_const_t array,
4209  const struct hipChannelFormatDesc &desc)
4210 {
4211  return hipBindTextureToArray(&tex, array, &desc);
4212 }
4213 
4214 template<class T, int dim, enum hipTextureReadMode readMode>
4215 static inline hipError_t hipBindTextureToMipmappedArray(
4216  const struct texture<T, dim, readMode> &tex,
4217  hipMipmappedArray_const_t mipmappedArray)
4218 {
4219  struct hipChannelFormatDesc desc;
4220  hipArray_t levelArray;
4221  hipError_t err = hipGetMipmappedArrayLevel(&levelArray, mipmappedArray, 0);
4222  if (err != hipSuccess) {
4223  return err;
4224  }
4225  err = hipGetChannelDesc(&desc, levelArray);
4226  return (err == hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
4227 }
4228 
4229 template<class T, int dim, enum hipTextureReadMode readMode>
4230 static inline hipError_t hipBindTextureToMipmappedArray(
4231  const struct texture<T, dim, readMode> &tex,
4232  hipMipmappedArray_const_t mipmappedArray,
4233  const struct hipChannelFormatDesc &desc)
4234 {
4235  return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
4236 }
4237 
4238 template<class T, int dim, enum hipTextureReadMode readMode>
4239 DEPRECATED(DEPRECATED_MSG)
4240 static inline hipError_t hipUnbindTexture(
4241  const struct texture<T, dim, readMode> &tex)
4242 {
4243  return hipUnbindTexture(&tex);
4244 }
4245 #endif
4246 
4247 // doxygen end Texture
4253 #endif
4254 
4255 #ifdef __GNUC__
4256 #pragma GCC visibility pop
4257 #endif
4258 
4276 // end-group HCC_Specific
4282 // doxygen end HIP API
4287 #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:247
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:308
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:312
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:1672
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:1508
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:332
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:318
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:331
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:1427
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:1662
hipStreamCallback_t
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:972
hipMemoryAdvise
hipMemoryAdvise
Definition: hip_runtime_api.h:243
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:197
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:84
hipMemAllocHost
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:766
hipMallocHost
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:760
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:320
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:309
hipOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1683
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:265
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:343
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:246
dim3
Definition: hip_runtime_api.h:330
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:162
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:340
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:1513
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:1714
hipFreeHost
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_runtime_api.h:817
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:345
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:262
hipMemRangeAttributeLastPrefetchLocation
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:267
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:341
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:319
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:252
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:249
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:333
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:342
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:339
hipFuncCachePreferShared
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:310
hipMemRangeAttributePreferredLocation
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:264
hipMemAdviseSetReadMostly
@ hipMemAdviseSetReadMostly
Definition: hip_runtime_api.h:244
hipFuncAttribute
hipFuncAttribute
Definition: hip_runtime_api.h:299
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:322
hipModuleOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1693
hipDeviceAttribute_t
hipDeviceAttribute_t
Definition: hip_runtime_api.h:290
hipFuncSetSharedMemConfig
hipError_t hipFuncSetSharedMemConfig(const void *func, hipSharedMemConfig config)
Set shared memory configuation for a specific function.
Definition: hip_module.cpp:1419
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:250
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:344
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
hipFuncSetAttribute
hipError_t hipFuncSetAttribute(const void *func, hipFuncAttribute attr, int value)
Set attribute for a specific function.
Definition: hip_module.cpp:1411
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:1527
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:311
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:772
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:261