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 struct ihipStream_t* hipStream_t;
99 
100 #define hipIpcMemLazyEnablePeerAccess 0
101 
102 #define HIP_IPC_HANDLE_SIZE 64
103 
104 typedef struct hipIpcMemHandle_st {
105  char reserved[HIP_IPC_HANDLE_SIZE];
107 
108 #if __HIP_ROCclr__
109 // TODO: IPC event handle currently unsupported
110 struct ihipIpcEventHandle_t;
112 #else
113 typedef struct hipIpcEventHandle_st {
114  char reserved[HIP_IPC_HANDLE_SIZE];
116 #endif
117 typedef struct ihipModule_t* hipModule_t;
118 
119 typedef struct ihipModuleSymbol_t* hipFunction_t;
120 
121 typedef struct hipFuncAttributes {
122  int binaryVersion;
123  int cacheModeCA;
124  size_t constSizeBytes;
125  size_t localSizeBytes;
126  int maxDynamicSharedSizeBytes;
127  int maxThreadsPerBlock;
128  int numRegs;
129  int preferredShmemCarveout;
130  int ptxVersion;
131  size_t sharedSizeBytes;
133 
134 typedef struct ihipEvent_t* hipEvent_t;
135 
136 enum hipLimit_t {
137  hipLimitMallocHeapSize = 0x02,
138 };
139 
144 #define hipStreamDefault \
146  0x00
147 #define hipStreamNonBlocking 0x01
148 
149 
151 #define hipEventDefault 0x0
152 #define hipEventBlockingSync \
153  0x1
154 #define hipEventDisableTiming \
155  0x2
156 #define hipEventInterprocess 0x4
157 #define hipEventReleaseToDevice \
158  0x40000000
159 #define hipEventReleaseToSystem \
162  0x80000000
163 
166 
168 #define hipHostMallocDefault 0x0
169 #define hipHostMallocPortable 0x1
170 #define hipHostMallocMapped \
171  0x2
172 #define hipHostMallocWriteCombined 0x4
174 #define hipHostMallocNumaUser \
175  0x20000000
176 
177 #define hipHostMallocCoherent \
178  0x40000000
179 #define hipHostMallocNonCoherent \
181  0x80000000
182 
184 #define hipMemAttachGlobal 0x01
185 #define hipMemAttachHost 0x02
186 #define hipMemAttachSingle 0x04
187 
189 #define hipDeviceMallocDefault 0x0
190 #define hipDeviceMallocFinegrained 0x1
191 
192 #define hipHostRegisterDefault 0x0
194 #define hipHostRegisterPortable 0x1
195 #define hipHostRegisterMapped \
196  0x2
197 #define hipHostRegisterIoMemory 0x4
199 #define hipExtHostRegisterCoarseGrained 0x8
200 
201 #define hipDeviceScheduleAuto 0x0
202 #define hipDeviceScheduleSpin \
203  0x1
204 #define hipDeviceScheduleYield \
206  0x2
207 #define hipDeviceScheduleBlockingSync 0x4
209 #define hipDeviceScheduleMask 0x7
210 
211 #define hipDeviceMapHost 0x8
212 #define hipDeviceLmemResizeToMax 0x16
213 
214 #define hipArrayDefault 0x00
215 #define hipArrayLayered 0x01
216 #define hipArraySurfaceLoadStore 0x02
217 #define hipArrayCubemap 0x04
218 #define hipArrayTextureGather 0x08
219 
220 #define hipOccupancyDefault 0x00
221 
222 #define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
223 #define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
224 
225 #define hipCpuDeviceId ((int)-1)
226 #define hipInvalidDeviceId ((int)-2)
227 
228 /*
229  * @brief HIP Memory Advise values
230  * @enum
231  * @ingroup Enumerations
232  */
233 typedef enum hipMemoryAdvise {
245 
246 /*
247  * @brief HIP range attributes
248  * @enum
249  * @ingroup Enumerations
250  */
251 typedef enum hipMemRangeAttribute {
259 
260 /*
261  * @brief hipJitOption
262  * @enum
263  * @ingroup Enumerations
264  */
265 typedef enum hipJitOption {
266  hipJitOptionMaxRegisters = 0,
267  hipJitOptionThreadsPerBlock,
268  hipJitOptionWallTime,
269  hipJitOptionInfoLogBuffer,
270  hipJitOptionInfoLogBufferSizeBytes,
271  hipJitOptionErrorLogBuffer,
272  hipJitOptionErrorLogBufferSizeBytes,
273  hipJitOptionOptimizationLevel,
274  hipJitOptionTargetFromContext,
275  hipJitOptionTarget,
276  hipJitOptionFallbackStrategy,
277  hipJitOptionGenerateDebugInfo,
278  hipJitOptionLogVerbose,
279  hipJitOptionGenerateLineInfo,
280  hipJitOptionCacheMode,
281  hipJitOptionSm3xOpt,
282  hipJitOptionFastCompile,
283  hipJitOptionNumOptions
284 } hipJitOption;
285 
286 
290 typedef enum hipFuncCache_t {
296 
297 
301 typedef enum hipSharedMemConfig {
308 
313 typedef struct dim3 {
314  uint32_t x;
315  uint32_t y;
316  uint32_t z;
317 #ifdef __cplusplus
318  __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
319 #endif
321 
322 typedef struct hipLaunchParams_t {
323  void* func;
326  void **args;
327  size_t sharedMem;
330 
331 
332 // Doxygen end group GlobalDefs
336 //-------------------------------------------------------------------------------------------------
337 
338 
339 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
340 // out-of-scope.
341 // typedef class ihipStream_t * hipStream_t;
342 
343 
344 /*
345  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
346  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
347  * out-of-scope but the true event is being written by some async queue or device */
348 // typedef struct hipEvent_t {
349 // struct ihipEvent_t *_handle;
350 //} hipEvent_t;
351 
352 
378 hipError_t hipDeviceSynchronize(void);
379 
380 
392 hipError_t hipDeviceReset(void);
393 
394 
426 hipError_t hipSetDevice(int deviceId);
427 
428 
442 hipError_t hipGetDevice(int* deviceId);
443 
444 
457 hipError_t hipGetDeviceCount(int* count);
458 
468 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
469 
483 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
484 
485 
496 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
497 
498 
509 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
510 
521 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
522 
523 
534 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
535 
548 
556 hipError_t hipGetDeviceFlags(unsigned int* flags);
557 
570 
595 hipError_t hipSetDeviceFlags(unsigned flags);
596 
605 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
606 
619 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
620 
621 // end doxygen Device
644 hipError_t hipGetLastError(void);
645 
646 
657 hipError_t hipPeekAtLastError(void);
658 
659 
668 const char* hipGetErrorName(hipError_t hip_error);
669 
670 
681 const char* hipGetErrorString(hipError_t hipError);
682 
683 // end doxygen Error
716 hipError_t hipStreamCreate(hipStream_t* stream);
717 
718 
736 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
737 
738 
757 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
758 
759 
774 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
775 
776 
795 hipError_t hipStreamDestroy(hipStream_t stream);
796 
797 
813 hipError_t hipStreamQuery(hipStream_t stream);
814 
815 
835 hipError_t hipStreamSynchronize(hipStream_t stream);
836 
837 
857 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
858 
859 
873 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
874 
875 
889 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
890 
891 
911 hipError_t hipExtStreamCreateWithCUMask(hipStream_t* stream, uint32_t cuMaskSize, const uint32_t* cuMask);
912 
913 
917 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
918 
934 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
935  unsigned int flags);
936 
937 
938 // end doxygen Stream
975 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
976 
977 
989 hipError_t hipEventCreate(hipEvent_t* event);
990 
991 
1019 #ifdef __cplusplus
1020 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1021 #else
1022 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
1023 #endif
1024 
1041 hipError_t hipEventDestroy(hipEvent_t event);
1042 
1043 
1061 hipError_t hipEventSynchronize(hipEvent_t event);
1062 
1063 
1092 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1093 
1094 
1110 hipError_t hipEventQuery(hipEvent_t event);
1111 
1112 
1113 // end doxygen Events
1144 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1145 
1159 hipError_t hipMalloc(void** ptr, size_t size);
1160 
1175 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1176 
1189 DEPRECATED("use hipHostMalloc instead")
1190 hipError_t hipMallocHost(void** ptr, size_t size);
1191 
1204 DEPRECATED("use hipHostMalloc instead")
1205 hipError_t hipMemAllocHost(void** ptr, size_t size);
1206 
1220 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1221 
1232 hipError_t hipMallocManaged(void** dev_ptr,
1233  size_t size,
1234  unsigned int flags __dparm(hipMemAttachGlobal));
1235 
1249 DEPRECATED("use hipHostMalloc instead")
1250 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1251 
1263 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1264 
1274 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1275 
1312 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1313 
1322 hipError_t hipHostUnregister(void* hostPtr);
1323 
1343 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1344 
1367 hipError_t hipMemAllocPitch(hipDeviceptr_t* dptr, size_t* pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes);
1368 
1382 hipError_t hipFree(void* ptr);
1383 
1394 DEPRECATED("use hipHostFree instead")
1395 hipError_t hipFreeHost(void* ptr);
1396 
1410 hipError_t hipHostFree(void* ptr);
1411 
1441 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1442 
1443 // TODO: Add description
1444 hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
1445  hipMemcpyKind kind, hipStream_t stream);
1463 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1464 
1482 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1483 
1501 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1502 
1520 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1521 
1539 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1540 
1558 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1559  hipStream_t stream);
1560 
1561 #if __HIP_ROCclr__
1562 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1563  hipModule_t hmod, const char* name);
1564 
1565 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol);
1566 hipError_t hipGetSymbolSize(size_t* size, const void* symbol);
1567 hipError_t hipMemcpyToSymbol(const void* symbol, const void* src,
1568  size_t sizeBytes, size_t offset __dparm(0),
1569  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1570 hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src,
1571  size_t sizeBytes, size_t offset,
1572  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1573 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbol,
1574  size_t sizeBytes, size_t offset __dparm(0),
1575  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1576 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbol,
1577  size_t sizeBytes, size_t offset,
1578  hipMemcpyKind kind,
1579  hipStream_t stream __dparm(0));
1580 #else
1581 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1582 
1583 #ifdef __cplusplus //Start : Not supported in gcc
1584 namespace hip_impl {
1585 inline
1586 __attribute__((visibility("hidden")))
1587 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1588  const char* name);
1589 } // Namespace hip_impl.
1590 
1591 
1602 inline
1603 __attribute__((visibility("hidden")))
1604 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
1605  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
1606  hip_impl::hip_init();
1607  size_t size = 0;
1608  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
1609 }
1610 
1611 
1622 inline
1623 __attribute__((visibility("hidden")))
1624 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
1625  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
1626  hip_impl::hip_init();
1627  void* devPtr = nullptr;
1628  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
1629 }
1630 #endif // End : Not supported in gcc
1631 
1632 #if defined(__cplusplus)
1633 } // extern "C"
1634 #endif
1635 
1636 #ifdef __cplusplus
1637 namespace hip_impl {
1638 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
1639  const char*);
1640 } // Namespace hip_impl.
1641 #endif
1642 
1643 #if defined(__cplusplus)
1644 extern "C" {
1645 #endif
1646 
1670 #ifdef __cplusplus
1671 inline
1672 __attribute__((visibility("hidden")))
1673 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1674  size_t sizeBytes, size_t offset __dparm(0),
1675  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
1676  if (!symbolName) return hipErrorInvalidSymbol;
1677 
1678  hipDeviceptr_t dst = NULL;
1679  hipGetSymbolAddress(&dst, (const char*)symbolName);
1680 
1681  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
1682  (const char*)symbolName);
1683 }
1684 #endif
1685 
1686 #if defined(__cplusplus)
1687 } // extern "C"
1688 #endif
1689 
1690 #ifdef __cplusplus
1691 namespace hip_impl {
1692 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
1693  hipMemcpyKind, hipStream_t, const char*);
1694 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
1695  hipMemcpyKind, const char*);
1696 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
1697  hipMemcpyKind, hipStream_t, const char*);
1698 } // Namespace hip_impl.
1699 #endif
1700 
1701 #if defined(__cplusplus)
1702 extern "C" {
1703 #endif
1704 
1731 #ifdef __cplusplus //Start : Not supported in gcc
1732 inline
1733 __attribute__((visibility("hidden")))
1734 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1735  size_t sizeBytes, size_t offset,
1736  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
1737  if (!symbolName) return hipErrorInvalidSymbol;
1738 
1739  hipDeviceptr_t dst = NULL;
1740  hipGetSymbolAddress(&dst, symbolName);
1741 
1742  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
1743  stream,
1744  (const char*)symbolName);
1745 }
1746 
1747 inline
1748 __attribute__((visibility("hidden")))
1749 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1750  size_t sizeBytes, size_t offset __dparm(0),
1751  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
1752  if (!symbolName) return hipErrorInvalidSymbol;
1753 
1754  hipDeviceptr_t src = NULL;
1755  hipGetSymbolAddress(&src, symbolName);
1756 
1757  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
1758  (const char*)symbolName);
1759 }
1760 
1761 inline
1762 __attribute__((visibility("hidden")))
1763 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1764  size_t sizeBytes, size_t offset,
1765  hipMemcpyKind kind,
1766  hipStream_t stream __dparm(0)) {
1767  if (!symbolName) return hipErrorInvalidSymbol;
1768 
1769  hipDeviceptr_t src = NULL;
1770  hipGetSymbolAddress(&src, symbolName);
1771 
1772  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
1773  stream,
1774  (const char*)symbolName);
1775 }
1776 #endif // End : Not supported in gcc
1777 
1778 #endif // __HIP_ROCclr__
1779 
1807 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
1808  hipStream_t stream __dparm(0));
1809 
1819 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
1820 
1830 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count);
1831 
1847 hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0));
1848 
1858 hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count);
1859 
1875 hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0));
1876 
1886 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
1887 
1903 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
1904 
1920 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
1921  hipStream_t stream __dparm(0));
1922 
1934 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
1935 
1948 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
1949 
1958 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
1959 
1969 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
1970 
1980 hipError_t hipMemGetInfo(size_t* free, size_t* total);
1981 
1982 
1983 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
1984 
1985 
1998 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
1999  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
2000 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
2001 
2002 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
2003 
2004 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
2005 
2014 hipError_t hipFreeArray(hipArray* array);
2015 
2023 hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray);
2024 
2037 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
2038  struct hipExtent extent, unsigned int flags);
2039 
2052  hipMipmappedArray_t *mipmappedArray,
2053  const struct hipChannelFormatDesc* desc,
2054  struct hipExtent extent,
2055  unsigned int numLevels,
2056  unsigned int flags __dparm(0));
2057 
2068  hipArray_t *levelArray,
2069  hipMipmappedArray_const_t mipmappedArray,
2070  unsigned int level);
2071 
2088 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2089  size_t height, hipMemcpyKind kind);
2090 
2100 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
2101 
2112 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
2113 
2131 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2132  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2133 
2151 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2152  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
2153 
2169 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2170  size_t count, hipMemcpyKind kind);
2171 
2187 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
2188  size_t count, hipMemcpyKind kind);
2189 
2207 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);
2208 
2227 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));
2228 
2242 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
2243 
2257 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2258 
2269 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2270 
2282 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2283 
2294 hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D* pCopy);
2295 
2307 hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D* pCopy, hipStream_t stream);
2308 
2309 // doxygen end Memory
2341 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2342 
2343 
2360 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2361 
2362 
2374 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2375 
2388 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2389 
2390 #ifndef USE_PEER_NON_UNIFIED
2391 #define USE_PEER_NON_UNIFIED 1
2392 #endif
2393 
2394 #if USE_PEER_NON_UNIFIED == 1
2395 
2406 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2407  size_t sizeBytes);
2408 
2421 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2422  size_t sizeBytes, hipStream_t stream __dparm(0));
2423 #endif
2424 
2425 
2426 // doxygen end PeerToPeer
2445 // TODO-ctx - more description on error codes.
2446 hipError_t hipInit(unsigned int flags);
2447 
2448 
2468 DEPRECATED(DEPRECATED_MSG)
2469 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2470 
2481 DEPRECATED(DEPRECATED_MSG)
2482 hipError_t hipCtxDestroy(hipCtx_t ctx);
2483 
2494 DEPRECATED(DEPRECATED_MSG)
2495 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2496 
2507 DEPRECATED(DEPRECATED_MSG)
2508 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2509 
2520 DEPRECATED(DEPRECATED_MSG)
2521 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2522 
2533 DEPRECATED(DEPRECATED_MSG)
2534 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2535 
2547 DEPRECATED(DEPRECATED_MSG)
2548 hipError_t hipCtxGetDevice(hipDevice_t* device);
2549 
2567 DEPRECATED(DEPRECATED_MSG)
2568 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2569 
2583 DEPRECATED(DEPRECATED_MSG)
2584 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2585 
2599 DEPRECATED(DEPRECATED_MSG)
2600 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2601 
2615 DEPRECATED(DEPRECATED_MSG)
2616 hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config);
2617 
2631 DEPRECATED(DEPRECATED_MSG)
2632 hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig);
2633 
2645 DEPRECATED(DEPRECATED_MSG)
2646 hipError_t hipCtxSynchronize(void);
2647 
2658 DEPRECATED(DEPRECATED_MSG)
2659 hipError_t hipCtxGetFlags(unsigned int* flags);
2660 
2680 DEPRECATED(DEPRECATED_MSG)
2681 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2682 
2699 DEPRECATED(DEPRECATED_MSG)
2700 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
2701 
2714 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
2715 
2728 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
2729 
2741 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
2742 
2753 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
2754 
2766 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
2767 
2768 // doxygen end Context Management
2780 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
2781 
2790 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
2791 
2800 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
2801 
2810 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
2811 
2812 
2820 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
2821 
2822 
2830 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
2831 
2847 hipError_t hipDriverGetVersion(int* driverVersion);
2848 
2861 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
2862 
2874 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
2875 
2886 hipError_t hipModuleUnload(hipModule_t module);
2887 
2898 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
2899 
2909 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
2910 
2920 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
2921 
2922 #if !__HIP_ROCclr__
2923 #if defined(__cplusplus)
2924 } // extern "C"
2925 #endif
2926 
2927 #ifdef __cplusplus
2928 namespace hip_impl {
2929  class agent_globals_impl;
2930  class agent_globals {
2931  public:
2932  agent_globals();
2933  ~agent_globals();
2934  agent_globals(const agent_globals&) = delete;
2935 
2936  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
2937  hipModule_t hmod, const char* name);
2938  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2939  const char* name);
2940  private:
2941  agent_globals_impl* impl;
2942  };
2943 
2944  inline
2945  __attribute__((visibility("hidden")))
2946  agent_globals& get_agent_globals() {
2947  static agent_globals ag;
2948  return ag;
2949  }
2950 
2951  extern "C"
2952  inline
2953  __attribute__((visibility("hidden")))
2954  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2955  const char* name) {
2956  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
2957  }
2958 } // Namespace hip_impl.
2959 #endif
2960 
2961 #if defined(__cplusplus)
2962 extern "C" {
2963 #endif
2964 
2975 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
2976  hipModule_t hmod, const char* name);
2977 #endif // __HIP_ROCclr__
2978 
2979 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
2980 
2990 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
2991 
3004 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
3005  hipJitOption* options, void** optionValues);
3006 
3031 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
3032  unsigned int gridDimZ, unsigned int blockDimX,
3033  unsigned int blockDimY, unsigned int blockDimZ,
3034  unsigned int sharedMemBytes, hipStream_t stream,
3035  void** kernelParams, void** extra);
3036 
3037 
3038 #if __HIP_ROCclr__ && !defined(__HCC__)
3039 
3054 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
3055  void** kernelParams, unsigned int sharedMemBytes,
3056  hipStream_t stream);
3057 
3068 hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3069  int numDevices, unsigned int flags);
3070 
3071 #endif
3072 
3085 //TODO - Match CUoccupancyB2DSize
3086 hipError_t hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3087  hipFunction_t f, size_t dynSharedMemPerBlk,
3088  int blockSizeLimit);
3089 
3102 //TODO - Match CUoccupancyB2DSize
3103 hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3104  hipFunction_t f, size_t dynSharedMemPerBlk,
3105  int blockSizeLimit, unsigned int flags);
3106 
3116  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk);
3117 
3128  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
3129 
3139  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk);
3140 
3151  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
3152 
3164 hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3165  const void* f, size_t dynSharedMemPerBlk,
3166  int blockSizeLimit);
3167 
3180  int numDevices, unsigned int flags);
3181 
3182 
3183 // doxygen end Version Management
3201 // TODO - expand descriptions:
3207 DEPRECATED("use roctracer/rocTX instead")
3208 hipError_t hipProfilerStart();
3209 
3210 
3216 DEPRECATED("use roctracer/rocTX instead")
3217 hipError_t hipProfilerStop();
3218 
3219 
3224 // TODO: implement IPC apis
3225 
3251 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
3252 
3289 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
3290 
3309 hipError_t hipIpcCloseMemHandle(void* devPtr);
3310 
3311 
3312 hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event);
3313 hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
3314 
3315 
3336 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3337 
3338 
3349 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3350 
3351 
3360 hipError_t hipLaunchByPtr(const void* func);
3361 
3362 
3378  dim3 blockDim,
3379  size_t sharedMem __dparm(0),
3380  hipStream_t stream __dparm(0));
3381 
3395 hipError_t __hipPopCallConfiguration(dim3 *gridDim,
3396  dim3 *blockDim,
3397  size_t *sharedMem,
3398  hipStream_t *stream);
3399 
3415 hipError_t hipLaunchKernel(const void* function_address,
3416  dim3 numBlocks,
3417  dim3 dimBlocks,
3418  void** args,
3419  size_t sharedMemBytes __dparm(0),
3420  hipStream_t stream __dparm(0));
3421 
3432 hipError_t hipMemPrefetchAsync(const void* dev_ptr,
3433  size_t count,
3434  int device,
3435  hipStream_t stream __dparm(0));
3436 
3447 hipError_t hipMemAdvise(const void* dev_ptr,
3448  size_t count,
3449  hipMemoryAdvise advice,
3450  int device);
3451 
3464 hipError_t hipMemRangeGetAttribute(void* data,
3465  size_t data_size,
3466  hipMemRangeAttribute attribute,
3467  const void* dev_ptr,
3468  size_t count);
3469 
3484 hipError_t hipMemRangeGetAttributes(void** data,
3485  size_t* data_sizes,
3486  hipMemRangeAttribute* attributes,
3487  size_t num_attributes,
3488  const void* dev_ptr,
3489  size_t count);
3490 
3504  hipDeviceptr_t* dev_ptr,
3505  size_t length __dparm(0),
3506  unsigned int flags __dparm(hipMemAttachSingle));
3507 
3508 #if __HIP_ROCclr__ || !defined(__HCC__)
3509 //TODO: Move this to hip_ext.h
3510 hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks, dim3 dimBlocks,
3511  void** args, size_t sharedMemBytes, hipStream_t stream,
3512  hipEvent_t startEvent, hipEvent_t stopEvent, int flags);
3513 
3514 hipError_t hipBindTexture(
3515  size_t* offset,
3516  const textureReference* tex,
3517  const void* devPtr,
3518  const hipChannelFormatDesc* desc,
3519  size_t size __dparm(UINT_MAX));
3520 
3521 hipError_t hipBindTexture2D(
3522  size_t* offset,
3523  const textureReference* tex,
3524  const void* devPtr,
3525  const hipChannelFormatDesc* desc,
3526  size_t width,
3527  size_t height,
3528  size_t pitch);
3529 
3530 hipError_t hipBindTextureToArray(
3531  const textureReference* tex,
3532  hipArray_const_t array,
3533  const hipChannelFormatDesc* desc);
3534 
3535 hipError_t hipBindTextureToMipmappedArray(
3536  const textureReference* tex,
3537  hipMipmappedArray_const_t mipmappedArray,
3538  const hipChannelFormatDesc* desc);
3539 
3540 hipError_t hipGetTextureAlignmentOffset(
3541  size_t* offset,
3542  const textureReference* texref);
3543 
3544 hipError_t hipGetTextureReference(
3545  const textureReference** texref,
3546  const void* symbol);
3547 
3548 hipError_t hipUnbindTexture(const textureReference* tex);
3549 
3550 hipError_t hipCreateTextureObject(
3551  hipTextureObject_t* pTexObject,
3552  const hipResourceDesc* pResDesc,
3553  const hipTextureDesc* pTexDesc,
3554  const struct hipResourceViewDesc* pResViewDesc);
3555 
3556 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3557 
3558 hipError_t hipGetChannelDesc(
3559  hipChannelFormatDesc* desc,
3560  hipArray_const_t array);
3561 
3562 hipError_t hipGetTextureObjectResourceDesc(
3563  hipResourceDesc* pResDesc,
3564  hipTextureObject_t textureObject);
3565 
3566 hipError_t hipGetTextureObjectResourceViewDesc(
3567  struct hipResourceViewDesc* pResViewDesc,
3568  hipTextureObject_t textureObject);
3569 
3570 hipError_t hipGetTextureObjectTextureDesc(
3571  hipTextureDesc* pTexDesc,
3572  hipTextureObject_t textureObject);
3573 
3574 hipError_t hipTexRefGetAddress(
3575  hipDeviceptr_t* dev_ptr,
3576  const textureReference* texRef);
3577 
3578 hipError_t hipTexRefGetAddressMode(
3579  enum hipTextureAddressMode* pam,
3580  const textureReference* texRef,
3581  int dim);
3582 
3583 hipError_t hipTexRefGetFilterMode(
3584  enum hipTextureFilterMode* pfm,
3585  const textureReference* texRef);
3586 
3587 hipError_t hipTexRefGetFlags(
3588  unsigned int* pFlags,
3589  const textureReference* texRef);
3590 
3591 hipError_t hipTexRefGetFormat(
3592  hipArray_Format* pFormat,
3593  int* pNumChannels,
3594  const textureReference* texRef);
3595 
3596 hipError_t hipTexRefGetMaxAnisotropy(
3597  int* pmaxAnsio,
3598  const textureReference* texRef);
3599 
3600 hipError_t hipTexRefGetMipmapFilterMode(
3601  enum hipTextureFilterMode* pfm,
3602  const textureReference* texRef);
3603 
3604 hipError_t hipTexRefGetMipmapLevelBias(
3605  float* pbias,
3606  const textureReference* texRef);
3607 
3608 hipError_t hipTexRefGetMipmapLevelClamp(
3609  float* pminMipmapLevelClamp,
3610  float* pmaxMipmapLevelClamp,
3611  const textureReference* texRef);
3612 
3613 hipError_t hipTexRefGetMipMappedArray(
3614  hipMipmappedArray_t* pArray,
3615  const textureReference* texRef);
3616 
3617 hipError_t hipTexRefSetAddress(
3618  size_t* ByteOffset,
3619  textureReference* texRef,
3620  hipDeviceptr_t dptr,
3621  size_t bytes);
3622 
3623 hipError_t hipTexRefSetAddress2D(
3624  textureReference* texRef,
3625  const HIP_ARRAY_DESCRIPTOR* desc,
3626  hipDeviceptr_t dptr,
3627  size_t Pitch);
3628 
3629 hipError_t hipTexRefSetAddressMode(
3630  textureReference* texRef,
3631  int dim,
3632  enum hipTextureAddressMode am);
3633 
3634 hipError_t hipTexRefSetArray(
3635  textureReference* tex,
3636  hipArray_const_t array,
3637  unsigned int flags);
3638 
3639 hipError_t hipTexRefSetBorderColor(
3640  textureReference* texRef,
3641  float* pBorderColor);
3642 
3643 hipError_t hipTexRefSetFilterMode(
3644  textureReference* texRef,
3645  enum hipTextureFilterMode fm);
3646 
3647 hipError_t hipTexRefSetFlags(
3648  textureReference* texRef,
3649  unsigned int Flags);
3650 
3651 hipError_t hipTexRefSetFormat(
3652  textureReference* texRef,
3653  hipArray_Format fmt,
3654  int NumPackedComponents);
3655 
3656 hipError_t hipTexRefSetMaxAnisotropy(
3657  textureReference* texRef,
3658  unsigned int maxAniso);
3659 
3660 hipError_t hipTexRefSetMipmapFilterMode(
3661  textureReference* texRef,
3662  enum hipTextureFilterMode fm);
3663 
3664 hipError_t hipTexRefSetMipmapLevelBias(
3665  textureReference* texRef,
3666  float bias);
3667 
3668 hipError_t hipTexRefSetMipmapLevelClamp(
3669  textureReference* texRef,
3670  float minMipMapLevelClamp,
3671  float maxMipMapLevelClamp);
3672 
3673 hipError_t hipTexRefSetMipmappedArray(
3674  textureReference* texRef,
3675  struct hipMipmappedArray* mipmappedArray,
3676  unsigned int Flags);
3677 
3678 hipError_t hipMipmappedArrayCreate(
3679  hipMipmappedArray_t* pHandle,
3680  HIP_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc,
3681  unsigned int numMipmapLevels);
3682 
3683 hipError_t hipMipmappedArrayDestroy(
3684  hipMipmappedArray_t hMipmappedArray);
3685 
3686 hipError_t hipMipmappedArrayGetLevel(
3687  hipArray_t* pLevelArray,
3688  hipMipmappedArray_t hMipMappedArray,
3689  unsigned int level);
3690 
3691 hipError_t hipTexObjectCreate(
3692  hipTextureObject_t* pTexObject,
3693  const HIP_RESOURCE_DESC* pResDesc,
3694  const HIP_TEXTURE_DESC* pTexDesc,
3695  const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
3696 
3697 hipError_t hipTexObjectDestroy(
3698  hipTextureObject_t texObject);
3699 
3700 hipError_t hipTexObjectGetResourceDesc(
3701  HIP_RESOURCE_DESC* pResDesc,
3702  hipTextureObject_t texObject);
3703 
3704 hipError_t hipTexObjectGetResourceViewDesc(
3705  HIP_RESOURCE_VIEW_DESC* pResViewDesc,
3706  hipTextureObject_t texObject);
3707 
3708 hipError_t hipTexObjectGetTextureDesc(
3709  HIP_TEXTURE_DESC* pTexDesc,
3710  hipTextureObject_t texObject);
3711 #endif
3712 
3718 #ifdef __cplusplus
3719 } /* extern "c" */
3720 #endif
3721 
3722 #if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3723 template <typename T>
3724 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3725  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0) {
3726  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3727 }
3728 
3729 template <typename T>
3730 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3731  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0, unsigned int flags = 0 ) {
3732  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3733 }
3734 #endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3735 
3736 #if defined(__cplusplus) && !defined(__HCC__)
3737 
3738 template <typename T>
3739 hipError_t hipGetSymbolAddress(void** devPtr, const T &symbol) {
3740  return ::hipGetSymbolAddress(devPtr, (const void *)&symbol);
3741 }
3742 
3743 template <typename T>
3744 hipError_t hipGetSymbolSize(size_t* size, const T &symbol) {
3745  return ::hipGetSymbolSize(size, (const void *)&symbol);
3746 }
3747 
3748 template <typename T>
3749 hipError_t hipMemcpyToSymbol(const T& symbol, const void* src, size_t sizeBytes,
3750  size_t offset __dparm(0),
3751  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
3752  return ::hipMemcpyToSymbol((const void*)&symbol, src, sizeBytes, offset, kind);
3753 }
3754 
3755 template <typename T>
3756 hipError_t hipMemcpyToSymbolAsync(const T& symbol, const void* src, size_t sizeBytes, size_t offset,
3757  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3758  return ::hipMemcpyToSymbolAsync((const void*)&symbol, src, sizeBytes, offset, kind, stream);
3759 }
3760 
3761 template <typename T>
3762 hipError_t hipMemcpyFromSymbol(void* dst, const T &symbol,
3763  size_t sizeBytes, size_t offset __dparm(0),
3764  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
3765  return ::hipMemcpyFromSymbol(dst, (const void*)&symbol, sizeBytes, offset, kind);
3766 }
3767 
3768 template <typename T>
3769 hipError_t hipMemcpyFromSymbolAsync(void* dst, const T& symbol, size_t sizeBytes, size_t offset,
3770  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3771  return ::hipMemcpyFromSymbolAsync(dst, (const void*)&symbol, sizeBytes, offset, kind, stream);
3772 }
3773 
3774 #endif
3775 
3776 #if USE_PROF_API
3777 #include <hip/hcc_detail/hip_prof_str.h>
3778 #endif
3779 
3780 #ifdef __cplusplus
3781 extern "C" {
3782 #endif
3783 
3786 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3787 hipError_t hipRemoveApiCallback(uint32_t id);
3788 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3789 hipError_t hipRemoveActivityCallback(uint32_t id);
3790 const char* hipApiName(uint32_t id);
3791 const char* hipKernelNameRef(const hipFunction_t f);
3792 const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream);
3793 int hipGetStreamDeviceId(hipStream_t stream);
3794 #ifdef __cplusplus
3795 } /* extern "C" */
3796 #endif
3797 
3798 #ifdef __cplusplus
3799 
3800 template <class T>
3802  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk) {
3804  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk);
3805 }
3806 
3807 template <class T>
3809  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
3811  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk, flags);
3812 }
3813 
3814 class TlsData;
3815 
3816 #if !__HIP_ROCclr__
3817 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3818  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3819 #endif
3820 
3821 #if !__HIP_ROCclr__
3822 hipError_t ihipBindTextureImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, size_t* offset,
3823  const void* devPtr, const struct hipChannelFormatDesc* desc,
3824  size_t size, textureReference* tex);
3825 #endif
3826 
3827 /*
3828  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3829  *reference tex.
3830  *
3831  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3832  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3833  *memory previously bound to tex is unbound.
3834  *
3835  * @param[in] offset - Offset in bytes
3836  * @param[out] tex - texture to bind
3837  * @param[in] devPtr - Memory area on device
3838  * @param[in] desc - Channel format
3839  * @param[in] size - Size of the memory area pointed to by devPtr
3840  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3841  **/
3842 #if !__HIP_ROCclr__
3843 template <class T, int dim, enum hipTextureReadMode readMode>
3844 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3845  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3846  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
3847 }
3848 #endif
3849 
3850 /*
3851  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3852  *reference tex.
3853  *
3854  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3855  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3856  *memory previously bound to tex is unbound.
3857  *
3858  * @param[in] offset - Offset in bytes
3859  * @param[in] tex - texture to bind
3860  * @param[in] devPtr - Memory area on device
3861  * @param[in] size - Size of the memory area pointed to by devPtr
3862  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3863  **/
3864 #if !__HIP_ROCclr__
3865 template <class T, int dim, enum hipTextureReadMode readMode>
3866 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3867  size_t size = UINT_MAX) {
3868  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
3869 }
3870 #endif
3871 
3872 // C API
3873 #if !__HIP_ROCclr__
3874 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
3875  const hipChannelFormatDesc* desc, size_t width, size_t height,
3876  size_t pitch);
3877 #endif
3878 
3879 #if !__HIP_ROCclr__
3880 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3881  const void* devPtr, const struct hipChannelFormatDesc* desc,
3882  size_t width, size_t height, textureReference* tex, size_t pitch);
3883 #endif
3884 
3885 #if !__HIP_ROCclr__
3886 template <class T, int dim, enum hipTextureReadMode readMode>
3887 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3888  const void* devPtr, size_t width, size_t height, size_t pitch) {
3889  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
3890  &tex);
3891 }
3892 #endif
3893 
3894 #if !__HIP_ROCclr__
3895 template <class T, int dim, enum hipTextureReadMode readMode>
3896 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3897  const void* devPtr, const struct hipChannelFormatDesc& desc,
3898  size_t width, size_t height, size_t pitch) {
3899  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
3900 }
3901 #endif
3902 
3903 // C API
3904 #if !__HIP_ROCclr__
3905 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
3906  const hipChannelFormatDesc* desc);
3907 #endif
3908 
3909 #if !__HIP_ROCclr__
3910 hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode,
3911  hipArray_const_t array,
3912  const struct hipChannelFormatDesc& desc,
3913  textureReference* tex);
3914 #endif
3915 
3916 #if !__HIP_ROCclr__
3917 template <class T, int dim, enum hipTextureReadMode readMode>
3918 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
3919  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, tex.channelDesc, &tex);
3920 }
3921 #endif
3922 
3923 #if !__HIP_ROCclr__
3924 template <class T, int dim, enum hipTextureReadMode readMode>
3925 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
3926  const struct hipChannelFormatDesc& desc) {
3927  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, desc, &tex);
3928 }
3929 #endif
3930 
3931 #if !__HIP_ROCclr__
3932 template <class T, int dim, enum hipTextureReadMode readMode>
3933 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
3934  hipArray_const_t array,
3935  const struct hipChannelFormatDesc* desc) {
3936  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, *desc, tex);
3937 }
3938 #endif
3939 
3940 // C API
3941 #if !__HIP_ROCclr__
3942 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
3943  hipMipmappedArray_const_t mipmappedArray,
3944  const hipChannelFormatDesc* desc);
3945 #endif
3946 
3947 #if !__HIP_ROCclr__
3948 template <class T, int dim, enum hipTextureReadMode readMode>
3949 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3950  hipMipmappedArray_const_t mipmappedArray) {
3951  return hipSuccess;
3952 }
3953 #endif
3954 
3955 #if !__HIP_ROCclr__
3956 template <class T, int dim, enum hipTextureReadMode readMode>
3957 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3958  hipMipmappedArray_const_t mipmappedArray,
3959  const hipChannelFormatDesc& desc) {
3960  return hipSuccess;
3961 }
3962 #endif
3963 
3964 #if __HIP_ROCclr__ && !defined(__HCC__)
3965 
3966 template <typename F>
3967 inline hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3968  F kernel, size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
3969 return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize,(hipFunction_t)kernel, dynSharedMemPerBlk, blockSizeLimit);
3970 }
3971 
3972 template <class T>
3973 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
3974  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
3975  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
3976  blockDim, kernelParams, sharedMemBytes, stream);
3977 }
3978 
3979 template <class T>
3980 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3981  unsigned int numDevices, unsigned int flags = 0) {
3982  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
3983 }
3984 
3985 
3986 template <class T>
3987 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
3988  unsigned int numDevices, unsigned int flags = 0) {
3989  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
3990 }
3991 
3992 #endif
3993 
3994 /*
3995  * @brief Unbinds the textuer bound to @p tex
3996  *
3997  * @param[in] tex - texture to unbind
3998  *
3999  * @return #hipSuccess
4000  **/
4001 #if !__HIP_ROCclr__
4002 hipError_t hipUnbindTexture(const textureReference* tex);
4003 #endif
4004 
4005 #if !__HIP_ROCclr__
4006 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
4007 #endif
4008 
4009 #if !__HIP_ROCclr__
4010 template <class T, int dim, enum hipTextureReadMode readMode>
4011 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
4012  return ihipUnbindTextureImpl(tex.textureObject);
4013 }
4014 #endif
4015 
4016 #if !__HIP_ROCclr__
4017 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
4018 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
4019 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
4020 
4021 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
4022  const hipTextureDesc* pTexDesc,
4023  const hipResourceViewDesc* pResViewDesc);
4024 
4025 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
4026 
4027 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
4028  hipTextureObject_t textureObject);
4029 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
4030  hipTextureObject_t textureObject);
4031 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
4032  hipTextureObject_t textureObject);
4033 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
4034 
4035 hipError_t hipTexRefGetArray(hipArray_t* array, textureReference tex);
4036 
4037 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
4038 
4039 hipError_t hipTexRefGetAddressMode(hipTextureAddressMode* am, textureReference tex, int dim);
4040 
4041 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
4042 
4043 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
4044 
4045 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
4046 
4047 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
4048  size_t size);
4049 
4050 hipError_t hipTexRefGetAddress(hipDeviceptr_t* dev_ptr, textureReference tex);
4051 
4052 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
4053  hipDeviceptr_t devPtr, size_t pitch);
4054 #endif
4055 
4056 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
4057 
4058 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
4059 
4060 #if __HIP_ROCclr__
4061 template<class T, int dim, enum hipTextureReadMode readMode>
4062 static inline hipError_t hipBindTexture(
4063  size_t *offset,
4064  const struct texture<T, dim, readMode> &tex,
4065  const void *devPtr,
4066  size_t size = UINT_MAX)
4067 {
4068  return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
4069 }
4070 
4071 template<class T, int dim, enum hipTextureReadMode readMode>
4072 static inline hipError_t hipBindTexture(
4073  size_t *offset,
4074  const struct texture<T, dim, readMode> &tex,
4075  const void *devPtr,
4076  const struct hipChannelFormatDesc &desc,
4077  size_t size = UINT_MAX)
4078 {
4079  return hipBindTexture(offset, &tex, devPtr, &desc, size);
4080 }
4081 
4082 template<class T, int dim, enum hipTextureReadMode readMode>
4083 static inline hipError_t hipBindTexture2D(
4084  size_t *offset,
4085  const struct texture<T, dim, readMode> &tex,
4086  const void *devPtr,
4087  size_t width,
4088  size_t height,
4089  size_t pitch)
4090 {
4091  return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
4092 }
4093 
4094 template<class T, int dim, enum hipTextureReadMode readMode>
4095 static inline hipError_t hipBindTexture2D(
4096  size_t *offset,
4097  const struct texture<T, dim, readMode> &tex,
4098  const void *devPtr,
4099  const struct hipChannelFormatDesc &desc,
4100  size_t width,
4101  size_t height,
4102  size_t pitch)
4103 {
4104  return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
4105 }
4106 
4107 template<class T, int dim, enum hipTextureReadMode readMode>
4108 static inline hipError_t hipBindTextureToArray(
4109  const struct texture<T, dim, readMode> &tex,
4110  hipArray_const_t array)
4111 {
4112  struct hipChannelFormatDesc desc;
4113  hipError_t err = hipGetChannelDesc(&desc, array);
4114  return (err == hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
4115 }
4116 
4117 template<class T, int dim, enum hipTextureReadMode readMode>
4118 static inline hipError_t hipBindTextureToArray(
4119  const struct texture<T, dim, readMode> &tex,
4120  hipArray_const_t array,
4121  const struct hipChannelFormatDesc &desc)
4122 {
4123  return hipBindTextureToArray(&tex, array, &desc);
4124 }
4125 
4126 template<class T, int dim, enum hipTextureReadMode readMode>
4127 static inline hipError_t hipBindTextureToMipmappedArray(
4128  const struct texture<T, dim, readMode> &tex,
4129  hipMipmappedArray_const_t mipmappedArray)
4130 {
4131  struct hipChannelFormatDesc desc;
4132  hipArray_t levelArray;
4133  hipError_t err = hipGetMipmappedArrayLevel(&levelArray, mipmappedArray, 0);
4134  if (err != hipSuccess) {
4135  return err;
4136  }
4137  err = hipGetChannelDesc(&desc, levelArray);
4138  return (err == hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
4139 }
4140 
4141 template<class T, int dim, enum hipTextureReadMode readMode>
4142 static inline hipError_t hipBindTextureToMipmappedArray(
4143  const struct texture<T, dim, readMode> &tex,
4144  hipMipmappedArray_const_t mipmappedArray,
4145  const struct hipChannelFormatDesc &desc)
4146 {
4147  return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
4148 }
4149 
4150 template<class T, int dim, enum hipTextureReadMode readMode>
4151 static inline hipError_t hipUnbindTexture(
4152  const struct texture<T, dim, readMode> &tex)
4153 {
4154  return hipUnbindTexture(&tex);
4155 }
4156 #endif
4157 
4158 // doxygen end Texture
4164 #endif
4165 
4166 #ifdef __GNUC__
4167 #pragma GCC visibility pop
4168 #endif
4169 
4187 // end-group HCC_Specific
4193 // doxygen end HIP API
4198 #endif
hipFuncAttributes
Definition: hip_runtime_api.h:121
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
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:113
hipMemAdviseSetPreferredLocation
@ hipMemAdviseSetPreferredLocation
Definition: hip_runtime_api.h:237
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:290
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:294
hipGetDevice
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
Definition: hip_device.cpp:32
hipModuleOccupancyMaxPotentialBlockSizeWithFlags
hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int *gridSize, int *blockSize, hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit, unsigned int flags)
determine the grid and block sizes to achieves maximum occupancy for a kernel
Definition: hip_module.cpp:1656
hipMallocArray
hipError_t hipMallocArray(hipArray **array, const hipChannelFormatDesc *desc, size_t width, size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault))
Allocate an array on the device.
hipMemcpyToArray
hipError_t hipMemcpyToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t count, hipMemcpyKind kind)
Copies data between host and device.
Definition: hip_memory.cpp:1494
hipModuleLoadData
hipError_t hipModuleLoadData(hipModule_t *module, const void *image)
builds module from code object which resides in host memory. Image is pointer to that location.
Definition: hip_module.cpp:1492
HIP_MEMCPY3D
Definition: driver_types.h:394
hipMemcpyDtoDAsync
hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Device asynchronously.
Definition: hip_memory.cpp:1429
hipModuleLaunchKernel
hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, hipStream_t stream, void **kernelParams, void **extra)
launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelp...
hipMemcpy2DFromArray
hipError_t hipMemcpy2DFromArray(void *dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
Definition: hip_memory.cpp:2154
hipDevicePrimaryCtxRelease
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
Definition: hip_context.cpp:285
hipCtxGetApiVersion
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion)
Returns the approximate HIP api version.
Definition: hip_context.cpp:207
hipHostMalloc
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
Definition: hip_memory.cpp:762
dim3::y
uint32_t y
y
Definition: hip_runtime_api.h:315
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:301
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:314
hipFuncGetAttribute
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
Definition: hip_module.cpp:1411
hipDeviceComputeCapability
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
Definition: hip_device.cpp:434
hipModuleOccupancyMaxPotentialBlockSize
hipError_t hipModuleOccupancyMaxPotentialBlockSize(int *gridSize, int *blockSize, hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit)
determine the grid and block sizes to achieves maximum occupancy for a kernel
Definition: hip_module.cpp:1646
hipStreamCallback_t
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:917
hipMemoryAdvise
hipMemoryAdvise
Definition: hip_runtime_api.h:233
hip_Memcpy2D
Definition: driver_types.h:91
hipGetMipmappedArrayLevel
hipError_t hipGetMipmappedArrayLevel(hipArray_t *levelArray, hipMipmappedArray_const_t mipmappedArray, unsigned int level)
Gets a mipmap level of a HIP mipmapped array.
hipCtxGetFlags
hipError_t hipCtxGetFlags(unsigned int *flags)
Return flags used for creating default context.
Definition: hip_context.cpp:254
__hipPushCallConfiguration
hipError_t __hipPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Push configuration of a kernel launch.
hipDevicePrimaryCtxGetState
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
Definition: hip_context.cpp:263
hipDeviceSetCacheConfig
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_device.cpp:74
hipCtxDestroy
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
Definition: hip_context.cpp:109
hipCtxEnablePeerAccess
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
Definition: hip_peer.cpp:221
hipMemcpyAtoH
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1544
hipGetDeviceCount
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
Definition: hip_device.cpp:69
hipSuccess
hipSuccess
Successful completion.
Definition: hip_runtime_api.h:196
hipSetupArgument
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
Definition: hip_clang.cpp:467
hipHostUnregister
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
Definition: hip_memory.cpp:1233
hipStreamGetFlags
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
Definition: hip_stream.cpp:223
hipMemsetD8Async
hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipExtStreamCreateWithCUMask
hipError_t hipExtStreamCreateWithCUMask(hipStream_t *stream, uint32_t cuMaskSize, const uint32_t *cuMask)
Create an asynchronous stream with the specified CU mask.
hipStreamSynchronize
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
Definition: hip_stream.cpp:184
hipGetErrorName
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
Definition: hip_error.cpp:48
dim3
struct dim3 dim3
hipDeviceGet
hipError_t hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
Definition: hip_context.cpp:70
__host__
#define __host__
Definition: host_defines.h:41
hipMemcpyDtoD
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
Definition: hip_memory.cpp:1390
hipMemcpy3DParms
Definition: driver_types.h:383
hipMallocManaged
hipError_t hipMallocManaged(void **dev_ptr, size_t size, unsigned int flags __dparm(hipMemAttachGlobal))
Allocates memory that will be automatically managed by AMD HMM.
hipMemcpyHtoD
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
Definition: hip_memory.cpp:1374
hipDriverGetVersion
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
Definition: hip_context.cpp:85
hipMemcpy2DToArray
hipError_t hipMemcpy2DToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
Definition: hip_memory.cpp:1444
hipMemAllocPitch
hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes)
Definition: hip_memory.cpp:862
hipDeviceProp_t
Definition: hip_runtime_api.h:83
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:303
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:291
hipOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1667
hipHostFree
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
Definition: hip_memory.cpp:2396
hipIpcOpenMemHandle
hipError_t hipIpcOpenMemHandle(void **devPtr, hipIpcMemHandle_t handle, unsigned int flags)
Opens an interprocess memory handle exported from another process and returns a device pointer usable...
Definition: hip_memory.cpp:2494
hipMemsetD16
hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant short value v...
Definition: hip_memory.cpp:2271
hipMipmappedArray
Definition: driver_types.h:116
ihipEvent_t
Definition: hip_hcc_internal.h:759
hipMemRangeAttributeAccessedBy
@ hipMemRangeAttributeAccessedBy
Definition: hip_runtime_api.h:255
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:326
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:104
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
hipHostAlloc
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory [Deprecated].
Definition: hip_memory.cpp:794
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:236
dim3
Definition: hip_runtime_api.h:313
hipStreamQuery
hipError_t hipStreamQuery(hipStream_t stream)
Return hipSuccess if all of the operations in the specified stream have completed,...
Definition: hip_stream.cpp:161
hipLaunchByPtr
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
Definition: hip_clang.cpp:485
hipExtMallocWithFlags
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:723
hipDevicePrimaryCtxSetFlags
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
Definition: hip_context.cpp:321
hipPointerAttribute_t
Definition: hip_runtime_api.h:161
hipFree
hipError_t hipFree(void *ptr)
Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSy...
Definition: hip_memory.cpp:2344
hipLaunchParams_t::func
void * func
Device function symbol.
Definition: hip_runtime_api.h:323
hipArrayDefault
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:214
hipDevicePrimaryCtxRetain
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
Definition: hip_context.cpp:296
hipOccupancyMaxPotentialBlockSize
hipError_t hipOccupancyMaxPotentialBlockSize(int *gridSize, int *blockSize, const void *f, size_t dynSharedMemPerBlk, int blockSizeLimit)
determine the grid and block sizes to achieves maximum occupancy for a kernel
hipModuleLoad
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
Definition: hip_module.cpp:1497
hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
Definition: hip_module.cpp:1698
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
hipFreeHost
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_memory.cpp:2407
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:328
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:252
hipMemRangeAttributeLastPrefetchLocation
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:257
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:324
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:302
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:242
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:239
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:316
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:325
hipMemAllocHost
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_memory.cpp:791
hipMemAttachGlobal
#define hipMemAttachGlobal
Memory can be accessed by any stream on any device.
Definition: hip_runtime_api.h:184
hipLaunchParams_t
Definition: hip_runtime_api.h:322
hipFuncCachePreferShared
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:292
hipMemRangeAttributePreferredLocation
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:254
hipMemAdviseSetReadMostly
@ hipMemAdviseSetReadMostly
Definition: hip_runtime_api.h:234
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:305
hipModuleOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1677
hipDeviceAttribute_t
hipDeviceAttribute_t
Definition: hip_runtime_api.h:289
hipExtGetLinkTypeAndHopCount
hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t *linktype, uint32_t *hopcount)
Returns the link type and hop count between two devices.
Definition: hip_device.cpp:605
hipMemAdviseSetAccessedBy
@ hipMemAdviseSetAccessedBy
Definition: hip_runtime_api.h:240
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:327
hipProfilerStart
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2496
hipDeviceGetSharedMemConfig
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current device.
Definition: hip_device.cpp:124
hipMemcpyAsync
hipError_t hipMemcpyAsync(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset...
hipStreamDestroy
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
Definition: hip_stream.cpp:195
hipHostRegister
hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
Register host memory so it can be accessed from the current device.
Definition: hip_memory.cpp:1158
hipProfilerStop
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2502
hipModuleLoadDataEx
hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned int numOptions, hipJitOption *options, void **optionValues)
builds module from code object which resides in host memory. Image is pointer to that location....
Definition: hip_module.cpp:1511
hipEventCreate
hipError_t hipEventCreate(hipEvent_t *event)
Definition: hip_event.cpp:207
HIP_RESOURCE_VIEW_DESC_st
Definition: driver_types.h:338
hipMemsetAsync
hipError_t hipMemsetAsync(void *dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value val...
hipMallocHost
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_memory.cpp:788
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:293
hipMemAttachSingle
#define hipMemAttachSingle
the associated device
Definition: hip_runtime_api.h:186
hipMemcpyParam2D
hipError_t hipMemcpyParam2D(const hip_Memcpy2D *pCopy)
Copies memory for 2D arrays.
Definition: hip_memory.cpp:2144
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:251