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_VDI__
39 #define __HIP_VDI__ 0
40 #endif
41 
43 #include <hip/hcc_detail/driver_types.h>
46 
47 #if !__HIP_VDI__ && 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/tree/master/docs/markdown/hip_deprecated_api_list"
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 // TODO: IPC implementation
101 
102 #define hipIpcMemLazyEnablePeerAccess 0
103 
104 #define HIP_IPC_HANDLE_SIZE 64
105 
106 typedef struct hipIpcMemHandle_st {
107  char reserved[HIP_IPC_HANDLE_SIZE];
109 
110 // TODO: IPC event handle currently unsupported
111 struct ihipIpcEventHandle_t;
112 typedef struct ihipIpcEventHandle_t* hipIpcEventHandle_t;
113 
114 
115 // END TODO
116 
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 hipHostMallocCoherent \
175  0x40000000
176 #define hipHostMallocNonCoherent \
178  0x80000000
179 
181 #define hipMemAttachGlobal 0x0
182 #define hipMemAttachHost 0x1
183 
184 #define hipDeviceMallocDefault 0x0
185 #define hipDeviceMallocFinegrained 0x1
186 
187 #define hipHostRegisterDefault 0x0
189 #define hipHostRegisterPortable 0x1
190 #define hipHostRegisterMapped \
191  0x2
192 #define hipHostRegisterIoMemory 0x4
194 #define hipExtHostRegisterCoarseGrained 0x8
195 
196 #define hipDeviceScheduleAuto 0x0
197 #define hipDeviceScheduleSpin \
198  0x1
199 #define hipDeviceScheduleYield \
201  0x2
202 #define hipDeviceScheduleBlockingSync 0x4
204 #define hipDeviceScheduleMask 0x7
205 
206 #define hipDeviceMapHost 0x8
207 #define hipDeviceLmemResizeToMax 0x16
208 
209 #define hipArrayDefault 0x00
210 #define hipArrayLayered 0x01
211 #define hipArraySurfaceLoadStore 0x02
212 #define hipArrayCubemap 0x04
213 #define hipArrayTextureGather 0x08
214 
215 #define hipOccupancyDefault 0x00
216 
217 #define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
218 #define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
219 
220 /*
221  * @brief hipJitOption
222  * @enum
223  * @ingroup Enumerations
224  */
225 typedef enum hipJitOption {
226  hipJitOptionMaxRegisters = 0,
227  hipJitOptionThreadsPerBlock,
228  hipJitOptionWallTime,
229  hipJitOptionInfoLogBuffer,
230  hipJitOptionInfoLogBufferSizeBytes,
231  hipJitOptionErrorLogBuffer,
232  hipJitOptionErrorLogBufferSizeBytes,
233  hipJitOptionOptimizationLevel,
234  hipJitOptionTargetFromContext,
235  hipJitOptionTarget,
236  hipJitOptionFallbackStrategy,
237  hipJitOptionGenerateDebugInfo,
238  hipJitOptionLogVerbose,
239  hipJitOptionGenerateLineInfo,
240  hipJitOptionCacheMode,
241  hipJitOptionSm3xOpt,
242  hipJitOptionFastCompile,
243  hipJitOptionNumOptions
244 } hipJitOption;
245 
246 
250 typedef enum hipFuncCache_t {
256 
257 
261 typedef enum hipSharedMemConfig {
268 
269 
274 typedef struct dim3 {
275  uint32_t x;
276  uint32_t y;
277  uint32_t z;
278 #ifdef __cplusplus
279  __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
280 #endif
281 } dim3;
282 
283 typedef struct hipLaunchParams_t {
284  void* func;
287  void **args;
288  size_t sharedMem;
289  hipStream_t stream;
291 
292 
293 // Doxygen end group GlobalDefs
297 //-------------------------------------------------------------------------------------------------
298 
299 
300 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
301 // out-of-scope.
302 // typedef class ihipStream_t * hipStream_t;
303 
304 
305 /*
306  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
307  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
308  * out-of-scope but the true event is being written by some async queue or device */
309 // typedef struct hipEvent_t {
310 // struct ihipEvent_t *_handle;
311 //} hipEvent_t;
312 
313 
339 hipError_t hipDeviceSynchronize(void);
340 
341 
353 hipError_t hipDeviceReset(void);
354 
355 
387 hipError_t hipSetDevice(int deviceId);
388 
389 
403 hipError_t hipGetDevice(int* deviceId);
404 
405 
418 hipError_t hipGetDeviceCount(int* count);
419 
429 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
430 
444 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
445 
446 
457 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
458 
459 
470 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
471 
482 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
483 
484 
495 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
496 
508 hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig);
509 
510 
522 hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config);
523 
548 hipError_t hipSetDeviceFlags(unsigned flags);
549 
558 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
559 
572 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
573 
574 // end doxygen Device
597 hipError_t hipGetLastError(void);
598 
599 
610 hipError_t hipPeekAtLastError(void);
611 
612 
621 const char* hipGetErrorName(hipError_t hip_error);
622 
623 
634 const char* hipGetErrorString(hipError_t hipError);
635 
636 // end doxygen Error
669 hipError_t hipStreamCreate(hipStream_t* stream);
670 
671 
689 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
690 
691 
710 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
711 
712 
727 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
728 
729 
748 hipError_t hipStreamDestroy(hipStream_t stream);
749 
750 
766 hipError_t hipStreamQuery(hipStream_t stream);
767 
768 
788 hipError_t hipStreamSynchronize(hipStream_t stream);
789 
790 
810 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
811 
812 
826 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
827 
828 
842 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
843 
844 
848 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
849 
865 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
866  unsigned int flags);
867 
868 
869 // end doxygen Stream
906 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
907 
908 
920 hipError_t hipEventCreate(hipEvent_t* event);
921 
922 
950 #ifdef __cplusplus
951 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
952 #else
953 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
954 #endif
955 
972 hipError_t hipEventDestroy(hipEvent_t event);
973 
974 
992 hipError_t hipEventSynchronize(hipEvent_t event);
993 
994 
1023 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1024 
1025 
1041 hipError_t hipEventQuery(hipEvent_t event);
1042 
1043 
1044 // end doxygen Events
1075 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1076 
1090 hipError_t hipMalloc(void** ptr, size_t size);
1091 
1106 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1107 
1120 DEPRECATED("use hipHostMalloc instead")
1121 hipError_t hipMallocHost(void** ptr, size_t size);
1122 
1135 DEPRECATED("use hipHostMalloc instead")
1136 hipError_t hipMemAllocHost(void** ptr, size_t size);
1137 
1151 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1152 
1162 hipError_t hipMallocManaged(void** devPtr, size_t size, unsigned int flags __dparm(0));
1163 
1177 DEPRECATED("use hipHostMalloc instead")
1178 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1179 
1191 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1192 
1202 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1203 
1240 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1241 
1250 hipError_t hipHostUnregister(void* hostPtr);
1251 
1271 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1272 
1295 hipError_t hipMemAllocPitch(hipDeviceptr_t* dptr, size_t* pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes);
1296 
1310 hipError_t hipFree(void* ptr);
1311 
1322 DEPRECATED("use hipHostFree instead")
1323 hipError_t hipFreeHost(void* ptr);
1324 
1338 hipError_t hipHostFree(void* ptr);
1339 
1367 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1368 
1369 // TODO: Add description
1370 hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
1371  hipMemcpyKind kind, hipStream_t stream);
1389 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1390 
1408 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1409 
1427 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1428 
1446 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1447 
1465 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1466 
1484 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1485  hipStream_t stream);
1486 
1487 #if __HIP_VDI__
1488 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1489  hipModule_t hmod, const char* name);
1490 
1491 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName);
1492 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName);
1493 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1494  size_t sizeBytes, size_t offset __dparm(0),
1495  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1496 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1497  size_t sizeBytes, size_t offset,
1498  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1499 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1500  size_t sizeBytes, size_t offset __dparm(0),
1501  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1502 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1503  size_t sizeBytes, size_t offset,
1504  hipMemcpyKind kind,
1505  hipStream_t stream __dparm(0));
1506 #else
1507 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1508 
1509 #ifdef __cplusplus //Start : Not supported in gcc
1510 namespace hip_impl {
1511 inline
1512 __attribute__((visibility("hidden")))
1513 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1514  const char* name);
1515 } // Namespace hip_impl.
1516 
1517 
1528 inline
1529 __attribute__((visibility("hidden")))
1530 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
1531  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
1532  hip_impl::hip_init();
1533  size_t size = 0;
1534  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
1535 }
1536 
1537 
1548 inline
1549 __attribute__((visibility("hidden")))
1550 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
1551  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
1552  hip_impl::hip_init();
1553  void* devPtr = nullptr;
1554  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
1555 }
1556 #endif // End : Not supported in gcc
1557 
1558 #if defined(__cplusplus)
1559 } // extern "C"
1560 #endif
1561 
1562 #ifdef __cplusplus
1563 namespace hip_impl {
1564 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
1565  const char*);
1566 } // Namespace hip_impl.
1567 #endif
1568 
1569 #if defined(__cplusplus)
1570 extern "C" {
1571 #endif
1572 
1596 #ifdef __cplusplus
1597 inline
1598 __attribute__((visibility("hidden")))
1599 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1600  size_t sizeBytes, size_t offset __dparm(0),
1601  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
1602  if (!symbolName) return hipErrorInvalidSymbol;
1603 
1604  hipDeviceptr_t dst = NULL;
1605  hipGetSymbolAddress(&dst, (const char*)symbolName);
1606 
1607  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
1608  (const char*)symbolName);
1609 }
1610 #endif
1611 
1612 #if defined(__cplusplus)
1613 } // extern "C"
1614 #endif
1615 
1616 #ifdef __cplusplus
1617 namespace hip_impl {
1618 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
1619  hipMemcpyKind, hipStream_t, const char*);
1620 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
1621  hipMemcpyKind, const char*);
1622 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
1623  hipMemcpyKind, hipStream_t, const char*);
1624 } // Namespace hip_impl.
1625 #endif
1626 
1627 #if defined(__cplusplus)
1628 extern "C" {
1629 #endif
1630 
1657 #ifdef __cplusplus //Start : Not supported in gcc
1658 inline
1659 __attribute__((visibility("hidden")))
1660 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1661  size_t sizeBytes, size_t offset,
1662  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
1663  if (!symbolName) return hipErrorInvalidSymbol;
1664 
1665  hipDeviceptr_t dst = NULL;
1666  hipGetSymbolAddress(&dst, symbolName);
1667 
1668  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
1669  stream,
1670  (const char*)symbolName);
1671 }
1672 
1673 inline
1674 __attribute__((visibility("hidden")))
1675 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1676  size_t sizeBytes, size_t offset __dparm(0),
1677  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
1678  if (!symbolName) return hipErrorInvalidSymbol;
1679 
1680  hipDeviceptr_t src = NULL;
1681  hipGetSymbolAddress(&src, symbolName);
1682 
1683  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
1684  (const char*)symbolName);
1685 }
1686 
1687 inline
1688 __attribute__((visibility("hidden")))
1689 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1690  size_t sizeBytes, size_t offset,
1691  hipMemcpyKind kind,
1692  hipStream_t stream __dparm(0)) {
1693  if (!symbolName) return hipErrorInvalidSymbol;
1694 
1695  hipDeviceptr_t src = NULL;
1696  hipGetSymbolAddress(&src, symbolName);
1697 
1698  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
1699  stream,
1700  (const char*)symbolName);
1701 }
1702 #endif // End : Not supported in gcc
1703 
1704 #endif // __HIP_VDI__
1705 
1733 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
1734  hipStream_t stream __dparm(0));
1735 
1745 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
1746 
1756 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count);
1757 
1773 hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0));
1774 
1784 hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count);
1785 
1801 hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0));
1802 
1812 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
1813 
1829 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
1830 
1846 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
1847  hipStream_t stream __dparm(0));
1848 
1860 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
1861 
1874 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
1875 
1884 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
1885 
1895 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
1896 
1906 hipError_t hipMemGetInfo(size_t* free, size_t* total);
1907 
1908 
1909 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
1910 
1911 
1924 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
1925  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
1926 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
1927 
1928 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
1929 
1930 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
1931 
1940 hipError_t hipFreeArray(hipArray* array);
1941 
1954 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
1955  struct hipExtent extent, unsigned int flags);
1972 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
1973  size_t height, hipMemcpyKind kind);
1974 
1984 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
1985 
1996 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
1997 
2015 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2016  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2017 
2034 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2035  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
2036 
2053 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2054  size_t count, hipMemcpyKind kind);
2055 
2071 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
2072  size_t count, hipMemcpyKind kind);
2073 
2091 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);
2092 
2111 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));
2112 
2126 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
2127 
2141 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2142 
2153 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2154 
2166 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2167 
2168 // doxygen end Memory
2200 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2201 
2202 
2219 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2220 
2221 
2233 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2234 
2247 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2248 
2249 #ifndef USE_PEER_NON_UNIFIED
2250 #define USE_PEER_NON_UNIFIED 1
2251 #endif
2252 
2253 #if USE_PEER_NON_UNIFIED == 1
2254 
2265 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2266  size_t sizeBytes);
2267 
2280 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2281  size_t sizeBytes, hipStream_t stream __dparm(0));
2282 #endif
2283 
2284 
2285 // doxygen end PeerToPeer
2304 // TODO-ctx - more description on error codes.
2305 hipError_t hipInit(unsigned int flags);
2306 
2307 
2327 DEPRECATED(DEPRECATED_MSG)
2328 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2329 
2340 DEPRECATED(DEPRECATED_MSG)
2341 hipError_t hipCtxDestroy(hipCtx_t ctx);
2342 
2353 DEPRECATED(DEPRECATED_MSG)
2354 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2355 
2366 DEPRECATED(DEPRECATED_MSG)
2367 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2368 
2379 DEPRECATED(DEPRECATED_MSG)
2380 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2381 
2392 DEPRECATED(DEPRECATED_MSG)
2393 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2394 
2406 DEPRECATED(DEPRECATED_MSG)
2407 hipError_t hipCtxGetDevice(hipDevice_t* device);
2408 
2426 DEPRECATED(DEPRECATED_MSG)
2427 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2428 
2442 DEPRECATED(DEPRECATED_MSG)
2443 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2444 
2458 DEPRECATED(DEPRECATED_MSG)
2459 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2460 
2474 DEPRECATED(DEPRECATED_MSG)
2475 hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config);
2476 
2490 DEPRECATED(DEPRECATED_MSG)
2491 hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig);
2492 
2504 DEPRECATED(DEPRECATED_MSG)
2505 hipError_t hipCtxSynchronize(void);
2506 
2517 DEPRECATED(DEPRECATED_MSG)
2518 hipError_t hipCtxGetFlags(unsigned int* flags);
2519 
2539 DEPRECATED(DEPRECATED_MSG)
2540 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2541 
2558 DEPRECATED(DEPRECATED_MSG)
2559 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
2560 
2573 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
2574 
2587 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
2588 
2600 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
2601 
2612 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
2613 
2625 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
2626 
2627 // doxygen end Context Management
2639 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
2640 
2649 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
2650 
2659 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
2660 
2669 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
2670 
2671 
2679 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
2680 
2681 
2689 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
2690 
2706 hipError_t hipDriverGetVersion(int* driverVersion);
2707 
2720 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
2721 
2733 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
2734 
2745 hipError_t hipModuleUnload(hipModule_t module);
2746 
2757 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
2758 
2768 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
2769 
2779 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
2780 
2781 #if !__HIP_VDI__
2782 #if defined(__cplusplus)
2783 } // extern "C"
2784 #endif
2785 
2786 #ifdef __cplusplus
2787 namespace hip_impl {
2788  class agent_globals_impl;
2789  class agent_globals {
2790  public:
2791  agent_globals();
2792  ~agent_globals();
2793  agent_globals(const agent_globals&) = delete;
2794 
2795  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
2796  hipModule_t hmod, const char* name);
2797  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2798  const char* name);
2799  private:
2800  agent_globals_impl* impl;
2801  };
2802 
2803  inline
2804  __attribute__((visibility("hidden")))
2805  agent_globals& get_agent_globals() {
2806  static agent_globals ag;
2807  return ag;
2808  }
2809 
2810  extern "C"
2811  inline
2812  __attribute__((visibility("hidden")))
2813  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2814  const char* name) {
2815  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
2816  }
2817 } // Namespace hip_impl.
2818 #endif
2819 
2820 #if defined(__cplusplus)
2821 extern "C" {
2822 #endif
2823 
2834 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
2835  hipModule_t hmod, const char* name);
2836 #endif // __HIP_VDI__
2837 
2838 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
2839 
2849 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
2850 
2863 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
2864  hipJitOption* options, void** optionValues);
2865 
2890 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
2891  unsigned int gridDimZ, unsigned int blockDimX,
2892  unsigned int blockDimY, unsigned int blockDimZ,
2893  unsigned int sharedMemBytes, hipStream_t stream,
2894  void** kernelParams, void** extra);
2895 
2896 
2897 #if __HIP_VDI__ && !defined(__HCC__)
2898 
2913 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
2914  void** kernelParams, unsigned int sharedMemBytes,
2915  hipStream_t stream);
2916 
2927 hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
2928  int numDevices, unsigned int flags);
2929 
2930 #endif
2931 
2943 hipError_t hipOccupancyMaxPotentialBlockSize(uint32_t* gridSize, uint32_t* blockSize,
2944  hipFunction_t f, size_t dynSharedMemPerBlk,
2945  uint32_t blockSizeLimit);
2946 
2956  uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk);
2957 
2967  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk);
2968 
2979  uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
2980 
2991  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
2992 
2993 #if __HIP_VDI__ && !defined(__HCC__)
2994 
3005 hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
3006  int numDevices, unsigned int flags);
3007 
3008 #endif
3009 
3010 // doxygen end Version Management
3028 // TODO - expand descriptions:
3034 DEPRECATED("use roctracer/rocTX instead")
3035 hipError_t hipProfilerStart();
3036 
3037 
3043 DEPRECATED("use roctracer/rocTX instead")
3044 hipError_t hipProfilerStop();
3045 
3046 
3051 // TODO: implement IPC apis
3052 
3078 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
3079 
3116 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
3117 
3136 hipError_t hipIpcCloseMemHandle(void* devPtr);
3137 
3138 
3139 // hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
3140 // hipError_t hipIpcCloseMemHandle(void *devPtr);
3141 // // hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
3142 // hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
3143 
3144 
3165 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3166 
3167 
3178 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3179 
3180 
3189 hipError_t hipLaunchByPtr(const void* func);
3190 
3191 
3206 hipError_t __hipPushCallConfiguration(dim3 gridDim,
3207  dim3 blockDim,
3208  size_t sharedMem __dparm(0),
3209  hipStream_t stream __dparm(0));
3210 
3224 hipError_t __hipPopCallConfiguration(dim3 *gridDim,
3225  dim3 *blockDim,
3226  size_t *sharedMem,
3227  hipStream_t *stream);
3228 
3245 hipError_t hipLaunchKernel(const void* function_address,
3246  dim3 numBlocks,
3247  dim3 dimBlocks,
3248  void** args,
3249  size_t sharedMemBytes __dparm(0),
3250  hipStream_t stream __dparm(0));
3251 
3257 #ifdef __cplusplus
3258 } /* extern "c" */
3259 #endif
3260 
3261 #if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3262 template <typename F>
3264  uint32_t* numBlocks, F func, uint32_t blockSize, size_t dynSharedMemPerBlk) {
3265  return ::hipOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, (hipFunction_t)func, blockSize,
3266  dynSharedMemPerBlk);
3267 }
3268 template <typename F>
3270  uint32_t* numBlocks, F func, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
3272  numBlocks, (hipFunction_t)func, blockSize, dynSharedMemPerBlk, flags);
3273 }
3274 #endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3275 
3276 #if USE_PROF_API
3277 #include <hip/hcc_detail/hip_prof_str.h>
3278 #endif
3279 
3280 #ifdef __cplusplus
3281 extern "C" {
3282 #endif
3283 
3286 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3287 hipError_t hipRemoveApiCallback(uint32_t id);
3288 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3289 hipError_t hipRemoveActivityCallback(uint32_t id);
3290 const char* hipApiName(uint32_t id);
3291 const char* hipKernelNameRef(const hipFunction_t f);
3292 #ifdef __cplusplus
3293 } /* extern "C" */
3294 #endif
3295 
3296 #ifdef __cplusplus
3297 
3298 class TlsData;
3299 
3300 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3301  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3302 
3303 hipError_t ihipBindTextureImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, size_t* offset,
3304  const void* devPtr, const struct hipChannelFormatDesc* desc,
3305  size_t size, textureReference* tex);
3306 
3307 /*
3308  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3309  *reference tex.
3310  *
3311  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3312  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3313  *memory previously bound to tex is unbound.
3314  *
3315  * @param[in] offset - Offset in bytes
3316  * @param[out] tex - texture to bind
3317  * @param[in] devPtr - Memory area on device
3318  * @param[in] desc - Channel format
3319  * @param[in] size - Size of the memory area pointed to by devPtr
3320  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3321  **/
3322 template <class T, int dim, enum hipTextureReadMode readMode>
3323 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3324  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3325  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
3326 }
3327 
3328 /*
3329  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3330  *reference tex.
3331  *
3332  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3333  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3334  *memory previously bound to tex is unbound.
3335  *
3336  * @param[in] offset - Offset in bytes
3337  * @param[in] tex - texture to bind
3338  * @param[in] devPtr - Memory area on device
3339  * @param[in] size - Size of the memory area pointed to by devPtr
3340  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3341  **/
3342 template <class T, int dim, enum hipTextureReadMode readMode>
3343 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3344  size_t size = UINT_MAX) {
3345  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
3346 }
3347 
3348 // C API
3349 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
3350  const hipChannelFormatDesc* desc, size_t width, size_t height,
3351  size_t pitch);
3352 
3353 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3354  const void* devPtr, const struct hipChannelFormatDesc* desc,
3355  size_t width, size_t height, textureReference* tex, size_t pitch);
3356 
3357 template <class T, int dim, enum hipTextureReadMode readMode>
3358 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3359  const void* devPtr, size_t width, size_t height, size_t pitch) {
3360  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
3361  &tex);
3362 }
3363 
3364 template <class T, int dim, enum hipTextureReadMode readMode>
3365 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3366  const void* devPtr, const struct hipChannelFormatDesc& desc,
3367  size_t width, size_t height, size_t pitch) {
3368  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
3369 }
3370 
3371 // C API
3372 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
3373  const hipChannelFormatDesc* desc);
3374 
3375 hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode,
3376  hipArray_const_t array,
3377  const struct hipChannelFormatDesc& desc,
3378  textureReference* tex);
3379 
3380 template <class T, int dim, enum hipTextureReadMode readMode>
3381 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
3382  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, tex.channelDesc, &tex);
3383 }
3384 
3385 template <class T, int dim, enum hipTextureReadMode readMode>
3386 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
3387  const struct hipChannelFormatDesc& desc) {
3388  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, desc, &tex);
3389 }
3390 
3391 template <class T, int dim, enum hipTextureReadMode readMode>
3392 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
3393  hipArray_const_t array,
3394  const struct hipChannelFormatDesc* desc) {
3395  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, *desc, tex);
3396 }
3397 
3398 // C API
3399 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
3400  hipMipmappedArray_const_t mipmappedArray,
3401  const hipChannelFormatDesc* desc);
3402 
3403 template <class T, int dim, enum hipTextureReadMode readMode>
3404 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3405  hipMipmappedArray_const_t mipmappedArray) {
3406  return hipSuccess;
3407 }
3408 
3409 template <class T, int dim, enum hipTextureReadMode readMode>
3410 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3411  hipMipmappedArray_const_t mipmappedArray,
3412  const hipChannelFormatDesc& desc) {
3413  return hipSuccess;
3414 }
3415 
3416 #if __HIP_VDI__ && !defined(__HCC__)
3417 template <class T>
3418 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
3419  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
3420  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
3421  blockDim, kernelParams, sharedMemBytes, stream);
3422 }
3423 
3424 template <class T>
3425 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3426  unsigned int numDevices, unsigned int flags = 0) {
3427  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
3428 }
3429 
3430 
3431 template <class T>
3432 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
3433  unsigned int numDevices, unsigned int flags = 0) {
3434  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
3435 }
3436 
3437 #endif
3438 
3439 /*
3440  * @brief Unbinds the textuer bound to @p tex
3441  *
3442  * @param[in] tex - texture to unbind
3443  *
3444  * @return #hipSuccess
3445  **/
3446 hipError_t hipUnbindTexture(const textureReference* tex);
3447 
3448 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
3449 
3450 template <class T, int dim, enum hipTextureReadMode readMode>
3451 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
3452  return ihipUnbindTextureImpl(tex.textureObject);
3453 }
3454 
3455 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
3456 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
3457 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
3458 
3459 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
3460  const hipTextureDesc* pTexDesc,
3461  const hipResourceViewDesc* pResViewDesc);
3462 
3463 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3464 
3465 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
3466  hipTextureObject_t textureObject);
3467 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
3468  hipTextureObject_t textureObject);
3469 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
3470  hipTextureObject_t textureObject);
3471 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
3472 
3473 hipError_t hipTexRefGetArray(hipArray_t* array, textureReference tex);
3474 
3475 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
3476 
3477 hipError_t hipTexRefGetAddressMode(hipTextureAddressMode* am, textureReference tex, int dim);
3478 
3479 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
3480 
3481 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
3482 
3483 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
3484 
3485 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
3486  size_t size);
3487 
3488 hipError_t hipTexRefGetAddress(hipDeviceptr_t* dev_ptr, textureReference tex);
3489 
3490 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
3491  hipDeviceptr_t devPtr, size_t pitch);
3492 
3493 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
3494 
3495 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
3496 
3497 // doxygen end Texture
3503 #endif
3504 
3505 #ifdef __GNUC__
3506 #pragma GCC visibility pop
3507 #endif
3508 
3526 // end-group HCC_Specific
3532 // doxygen end HIP API
3537 #endif
hipError_t hipMemcpy2DFromArrayAsync(void *dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
Definition: hip_memory.cpp:2326
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:253
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:1076
hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx)
Disable direct access from current context&#39;s virtual address space to memory allocations physically l...
Definition: hip_peer.cpp:227
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:2221
hipError_t hipStreamGetPriority(hipStream_t stream, int *priority)
Query the priority of a stream.
Definition: hip_stream.cpp:237
hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
Definition: hip_device.cpp:82
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
Definition: hip_context.cpp:85
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.
Definition: hip_runtime_api.h:283
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
Definition: hip_error.cpp:41
hipError_t hipMemcpyParam2D(const hip_Memcpy2D *pCopy)
Copies memory for 2D arrays.
Definition: hip_memory.cpp:2104
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
Definition: hip_context.cpp:321
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
Definition: hip_context.cpp:296
struct dim3 dim3
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
Definition: hip_device.cpp:421
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
Definition: hip_device.cpp:479
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:699
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
Definition: hip_memory.cpp:2367
TODO-doc.
hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant short value v...
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_memory.cpp:2337
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:1459
unsigned long long hipSurfaceObject_t
Definition: hip_surface_types.h:36
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:1244
Definition: driver_types.h:241
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
Definition: hip_memory.cpp:820
hipError_t hipMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device.
hipError_t 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:2206
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:1983
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(uint32_t *numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault))
Returns occupancy for a device function.
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:257
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:1476
uint32_t x
x
Definition: hip_runtime_api.h:275
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1509
hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags)
Enable direct access from current device&#39;s virtual address space to memory allocations physically loc...
Definition: hip_peer.cpp:200
hipError_t hipCtxPopCurrent(hipCtx_t *ctx)
Pop the current/default context and return the popped context.
Definition: hip_context.cpp:133
const char * hipGetErrorString(hipError_t hipError)
Return handy text string message to explain the error which occurred.
Definition: hip_error.cpp:54
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current device.
Definition: hip_device.cpp:123
Definition: hip_runtime_api.h:151
hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priority.
Definition: hip_stream.cpp:122
prefer equal size L1 cache and shared memory
Definition: hip_runtime_api.h:254
hipError_t hipHostGetDevicePointer(void **devPtr, void *hstPtr, unsigned int flags)
Get Device pointer from Host Pointer allocated through hipHostMalloc.
hipError_t hipFreeArray(hipArray *array)
Frees an array on the device.
Definition: hip_memory.cpp:2339
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
Definition: hip_stream.cpp:113
hipError_t hipMemsetAsync(void *dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value val...
hipError_t hipEventSynchronize(hipEvent_t event)
Wait for an event to complete.
Definition: hip_event.cpp:143
Definition: driver_types.h:182
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
Definition: hip_memory.cpp:1339
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
Definition: hip_module.cpp:1026
Definition: hip_module.cpp:108
hipError_t hipSetDeviceFlags(unsigned flags)
The current device behavior is changed according the flags passed.
hipError_t hipEventQuery(hipEvent_t event)
Query event status.
Definition: hip_event.cpp:222
hipError_t hipDeviceDisablePeerAccess(int peerDeviceId)
Disable direct access from current device&#39;s virtual address space to memory allocations physically lo...
Definition: hip_peer.cpp:193
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
Definition: hip_context.cpp:241
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:2114
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(uint32_t *numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1465
Definition: hip_hcc_internal.h:185
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
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:209
hipError_t hipMallocArray(hipArray **array, const hipChannelFormatDesc *desc, size_t width, size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault))
Allocate an array on the device.
hipError_t hipDrvOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
Definition: hip_module.cpp:1493
hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config)
Set Shared memory bank configuration.
Definition: hip_context.cpp:233
hipError_t hipCtxSetCurrent(hipCtx_t ctx)
Set the passed context as current/default.
Definition: hip_context.cpp:178
hipError_t __hipPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, hipStream_t *stream)
Pop configuration of a kernel launch.
Definition: hip_clang.cpp:207
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
Definition: hip_memory.cpp:2388
Definition: hip_runtime_api.h:121
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.
Definition: driver_types.h:116
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
Definition: hip_memory.cpp:737
Definition: hip_hcc_internal.h:910
Definition: texture_types.h:74
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
Definition: hip_device.cpp:94
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:1225
Definition: driver_types.h:78
hipDeviceAttribute_t
Definition: hip_runtime_api.h:279
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
Definition: hip_event.cpp:131
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
Definition: hip_stream.cpp:97
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Configure a kernel launch.
hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop)
Device which matches hipDeviceProp_t is returned.
Definition: hip_device.cpp:505
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_context.cpp:225
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...
Definition: hip_runtime_api.h:274
uint32_t y
y
Definition: hip_runtime_api.h:276
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:848
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
Definition: hip_module.cpp:1230
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
Definition: hip_context.cpp:308
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
Definition: hip_event.cpp:91
#define __host__
Definition: host_defines.h:41
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory [Deprecated].
Definition: hip_memory.cpp:763
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_memory.cpp:757
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
Definition: hip_event.cpp:174
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_device.cpp:74
hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer&#39;s memory.
Definition: hip_peer.cpp:186
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
Definition: hip_device.cpp:69
Definition: driver_types.h:69
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:2179
Definition: driver_types.h:254
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
Definition: hip_module.cpp:1144
hipError_t hipOccupancyMaxPotentialBlockSize(uint32_t *gridSize, uint32_t *blockSize, hipFunction_t f, size_t dynSharedMemPerBlk, uint32_t blockSizeLimit)
determine the grid and block sizes to achieves maximum occupancy for a kernel
Definition: hip_module.cpp:1402
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
Definition: hip_stream.cpp:194
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
Definition: hip_memory.cpp:1102
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
Definition: hip_stream.cpp:183
hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes)
Definition: hip_memory.cpp:831
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:2424
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
Definition: hip_context.cpp:217
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
Definition: hip_memory.cpp:1355
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...
Definition: hip_runtime_api.h:263
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:285
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:251
hipError_t hipMallocManaged(void **devPtr, size_t size, unsigned int flags __dparm(0))
Allocates memory that will be automatically managed by the Unified Memory system. ...
hipError_t hipCtxSynchronize(void)
Blocks until the default context has completed all preceding requested tasks.
Definition: hip_context.cpp:249
hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count, hipStream_t stream __dparm(0))
Fills the memory area pointed to by dev with the constant integer value for specified number of times...
hipError_t hipCtxGetCurrent(hipCtx_t *ctx)
Get the handle of the current/ default context.
Definition: hip_context.cpp:167
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:1060
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:1402
void * func
Device function symbol.
Definition: hip_runtime_api.h:284
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
Definition: hip_device.cpp:142
hipError_t hipCtxPushCurrent(hipCtx_t ctx)
Push the context to be set as current/ default context.
Definition: hip_context.cpp:154
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
Definition: hip_memory.cpp:1347
Defines the different newt vector types for HIP runtime.
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...
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
Definition: hip_device.cpp:433
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
Definition: hip_device.cpp:368
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:1127
Definition: driver_types.h:62
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:672
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
Definition: hip_error.cpp:48
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:2184
Definition: driver_types.h:234
dim3 blockDim
Block dimentions.
Definition: hip_runtime_api.h:286
hipFuncCache_t
Definition: hip_runtime_api.h:250
hipError_t hipGetLastError(void)
Return last error returned by any HIP runtime API call and resets the stored error code to #hipSucces...
Definition: hip_error.cpp:32
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
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
Definition: hip_stream.cpp:222
Defines surface types for HIP runtime.
hipStream_t stream
Stream identifier.
Definition: hip_runtime_api.h:289
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:2233
hipError_t __hipPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Push configuration of a kernel launch.
hipError_t hipCtxGetDevice(hipDevice_t *device)
Get the handle of the device associated with current/default context.
Definition: hip_context.cpp:191
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
Definition: hip_context.cpp:285
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:2274
uint32_t z
z
Definition: hip_runtime_api.h:277
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion)
Returns the approximate HIP api version.
Definition: hip_context.cpp:207
hipError_t hipDeviceReset(void)
The state of current device is discarded and updated to a fresh state.
Definition: hip_device.cpp:147
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
Definition: hip_context.cpp:39
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
Definition: hip_memory.cpp:1676
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
Definition: hip_context.cpp:97
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1493
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
Definition: hip_clang.cpp:230
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:1394
Definition: hip_runtime_api.h:83
hipError_t hipSetDevice(int deviceId)
Set default device to be used for subsequent hip API calls from this thread.
Definition: hip_device.cpp:131
hipError_t hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
Definition: hip_context.cpp:70
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
Definition: hip_device.cpp:467
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_memory.cpp:760
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
Definition: hip_device.cpp:107
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:262
Definition: hip_runtime.h:202
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.
hipError_t hipCtxGetFlags(unsigned int *flags)
Return flags used for creating default context.
Definition: hip_context.cpp:254
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:592
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
Definition: hip_context.cpp:109
hipError_t hipRegisterApiCallback(uint32_t id, void *fun, void *arg)
Definition: hip_intercept.cpp:33
hipSharedMemConfig
Definition: hip_runtime_api.h:261
Definition: driver_types.h:38
Definition: hip_hcc_internal.h:732
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
Definition: hip_device.cpp:341
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:1387
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
Definition: hip_memory.cpp:1202
Definition: hip_hcc_internal.h:556
hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipError_t 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
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
Definition: hip_stream.cpp:106
hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms *p, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
Definition: hip_memory.cpp:1332
hipError_t hipEventCreate(hipEvent_t *event)
Definition: hip_event.cpp:97
Definition: driver_types.h:91
Definition: hip_runtime_api.h:106
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
Definition: hip_context.cpp:263
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
Definition: hip_peer.cpp:221
Definition: driver_types.h:210
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
Definition: hip_device.cpp:115
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
Definition: hip_device.cpp:32
hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
Record an event in the specified stream.
Definition: hip_event.cpp:104
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:879
Definition: hip_hcc_internal.h:405
hipError_t hipDrvOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
Definition: hip_module.cpp:1474
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:447
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:252
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:1409
void ** args
Arguments.
Definition: hip_runtime_api.h:287
hipError_t hipStreamQuery(hipStream_t stream)
Return #hipSuccess if all of the operations in the specified stream have completed, or #hipErrorNotReady if not.
Definition: hip_stream.cpp:160
hipError_t hipFuncGetAttributes(struct hipFuncAttributes *attr, const void *func)
Find out attributes for a given function.
Definition: hip_module.cpp:1126
Definition: hip_runtime_api.h:265
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
Definition: hip_memory.cpp:2469
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
Definition: hip_memory.cpp:594
hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D *pCopy, hipStream_t stream __dparm(0))
Copies memory for 2D arrays.
size_t sharedMem
Shared memory.
Definition: hip_runtime_api.h:288
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:2196
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2454
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:2216
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2448
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
Definition: hip_clang.cpp:248
Definition: texture_types.h:95