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 /*
216  * @brief hipJitOption
217  * @enum
218  * @ingroup Enumerations
219  */
220 typedef enum hipJitOption {
221  hipJitOptionMaxRegisters = 0,
222  hipJitOptionThreadsPerBlock,
223  hipJitOptionWallTime,
224  hipJitOptionInfoLogBuffer,
225  hipJitOptionInfoLogBufferSizeBytes,
226  hipJitOptionErrorLogBuffer,
227  hipJitOptionErrorLogBufferSizeBytes,
228  hipJitOptionOptimizationLevel,
229  hipJitOptionTargetFromContext,
230  hipJitOptionTarget,
231  hipJitOptionFallbackStrategy,
232  hipJitOptionGenerateDebugInfo,
233  hipJitOptionLogVerbose,
234  hipJitOptionGenerateLineInfo,
235  hipJitOptionCacheMode,
236  hipJitOptionSm3xOpt,
237  hipJitOptionFastCompile,
238  hipJitOptionNumOptions
239 } hipJitOption;
240 
241 
245 typedef enum hipFuncCache_t {
251 
252 
256 typedef enum hipSharedMemConfig {
263 
264 
269 typedef struct dim3 {
270  uint32_t x;
271  uint32_t y;
272  uint32_t z;
273 #ifdef __cplusplus
274  __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
275 #endif
276 } dim3;
277 
278 typedef struct hipLaunchParams_t {
279  void* func;
282  void **args;
283  size_t sharedMem;
284  hipStream_t stream;
286 
287 
288 // Doxygen end group GlobalDefs
292 //-------------------------------------------------------------------------------------------------
293 
294 
295 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
296 // out-of-scope.
297 // typedef class ihipStream_t * hipStream_t;
298 
299 
300 /*
301  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
302  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
303  * out-of-scope but the true event is being written by some async queue or device */
304 // typedef struct hipEvent_t {
305 // struct ihipEvent_t *_handle;
306 //} hipEvent_t;
307 
308 
334 hipError_t hipDeviceSynchronize(void);
335 
336 
348 hipError_t hipDeviceReset(void);
349 
350 
382 hipError_t hipSetDevice(int deviceId);
383 
384 
398 hipError_t hipGetDevice(int* deviceId);
399 
400 
413 hipError_t hipGetDeviceCount(int* count);
414 
424 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
425 
439 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
440 
441 
452 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
453 
454 
465 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
466 
477 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
478 
479 
490 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
491 
503 hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig);
504 
505 
517 hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config);
518 
543 hipError_t hipSetDeviceFlags(unsigned flags);
544 
553 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
554 
567 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
568 
569 // end doxygen Device
592 hipError_t hipGetLastError(void);
593 
594 
605 hipError_t hipPeekAtLastError(void);
606 
607 
616 const char* hipGetErrorName(hipError_t hip_error);
617 
618 
629 const char* hipGetErrorString(hipError_t hipError);
630 
631 // end doxygen Error
664 hipError_t hipStreamCreate(hipStream_t* stream);
665 
666 
684 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
685 
686 
705 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
706 
707 
722 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
723 
724 
743 hipError_t hipStreamDestroy(hipStream_t stream);
744 
745 
761 hipError_t hipStreamQuery(hipStream_t stream);
762 
763 
783 hipError_t hipStreamSynchronize(hipStream_t stream);
784 
785 
805 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
806 
807 
821 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
822 
823 
837 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
838 
839 
843 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
844 
860 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
861  unsigned int flags);
862 
863 
864 // end doxygen Stream
901 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
902 
903 
915 hipError_t hipEventCreate(hipEvent_t* event);
916 
917 
945 #ifdef __cplusplus
946 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
947 #else
948 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
949 #endif
950 
967 hipError_t hipEventDestroy(hipEvent_t event);
968 
969 
987 hipError_t hipEventSynchronize(hipEvent_t event);
988 
989 
1018 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1019 
1020 
1036 hipError_t hipEventQuery(hipEvent_t event);
1037 
1038 
1039 // end doxygen Events
1070 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1071 
1085 hipError_t hipMalloc(void** ptr, size_t size);
1086 
1101 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1102 
1115 DEPRECATED("use hipHostMalloc instead")
1116 hipError_t hipMallocHost(void** ptr, size_t size);
1117 
1131 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1132 
1142 hipError_t hipMallocManaged(void** devPtr, size_t size, unsigned int flags __dparm(0));
1143 
1157 DEPRECATED("use hipHostMalloc instead")
1158 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1159 
1171 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1172 
1182 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1183 
1220 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1221 
1230 hipError_t hipHostUnregister(void* hostPtr);
1231 
1251 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1252 
1266 hipError_t hipFree(void* ptr);
1267 
1278 DEPRECATED("use hipHostFree instead")
1279 hipError_t hipFreeHost(void* ptr);
1280 
1294 hipError_t hipHostFree(void* ptr);
1295 
1323 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1324 
1342 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1343 
1361 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1362 
1380 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1381 
1399 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1400 
1418 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1419 
1437 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1438  hipStream_t stream);
1439 
1440 #if __HIP_VDI__
1441 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1442  hipModule_t hmod, const char* name);
1443 
1444 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName);
1445 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName);
1446 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1447  size_t sizeBytes, size_t offset __dparm(0),
1448  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1449 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1450  size_t sizeBytes, size_t offset,
1451  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1452 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1453  size_t sizeBytes, size_t offset __dparm(0),
1454  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1455 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1456  size_t sizeBytes, size_t offset,
1457  hipMemcpyKind kind,
1458  hipStream_t stream __dparm(0));
1459 #else
1460 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1461 
1462 #ifdef __cplusplus //Start : Not supported in gcc
1463 namespace hip_impl {
1464 inline
1465 __attribute__((visibility("hidden")))
1466 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1467  const char* name);
1468 } // Namespace hip_impl.
1469 
1470 
1481 inline
1482 __attribute__((visibility("hidden")))
1483 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
1484  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
1485  hip_impl::hip_init();
1486  size_t size = 0;
1487  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
1488 }
1489 
1490 
1501 inline
1502 __attribute__((visibility("hidden")))
1503 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
1504  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
1505  hip_impl::hip_init();
1506  void* devPtr = nullptr;
1507  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
1508 }
1509 #endif // End : Not supported in gcc
1510 
1511 #if defined(__cplusplus)
1512 } // extern "C"
1513 #endif
1514 
1515 #ifdef __cplusplus
1516 namespace hip_impl {
1517 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
1518  const char*);
1519 } // Namespace hip_impl.
1520 #endif
1521 
1522 #if defined(__cplusplus)
1523 extern "C" {
1524 #endif
1525 
1549 #ifdef __cplusplus
1550 inline
1551 __attribute__((visibility("hidden")))
1552 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1553  size_t sizeBytes, size_t offset __dparm(0),
1554  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
1555  if (!symbolName) return hipErrorInvalidSymbol;
1556 
1557  hipDeviceptr_t dst = NULL;
1558  hipGetSymbolAddress(&dst, (const char*)symbolName);
1559 
1560  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
1561  (const char*)symbolName);
1562 }
1563 #endif
1564 
1565 #if defined(__cplusplus)
1566 } // extern "C"
1567 #endif
1568 
1569 #ifdef __cplusplus
1570 namespace hip_impl {
1571 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
1572  hipMemcpyKind, hipStream_t, const char*);
1573 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
1574  hipMemcpyKind, const char*);
1575 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
1576  hipMemcpyKind, hipStream_t, const char*);
1577 } // Namespace hip_impl.
1578 #endif
1579 
1580 #if defined(__cplusplus)
1581 extern "C" {
1582 #endif
1583 
1610 #ifdef __cplusplus //Start : Not supported in gcc
1611 inline
1612 __attribute__((visibility("hidden")))
1613 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1614  size_t sizeBytes, size_t offset,
1615  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
1616  if (!symbolName) return hipErrorInvalidSymbol;
1617 
1618  hipDeviceptr_t dst = NULL;
1619  hipGetSymbolAddress(&dst, symbolName);
1620 
1621  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
1622  stream,
1623  (const char*)symbolName);
1624 }
1625 
1626 inline
1627 __attribute__((visibility("hidden")))
1628 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1629  size_t sizeBytes, size_t offset __dparm(0),
1630  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
1631  if (!symbolName) return hipErrorInvalidSymbol;
1632 
1633  hipDeviceptr_t src = NULL;
1634  hipGetSymbolAddress(&src, symbolName);
1635 
1636  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
1637  (const char*)symbolName);
1638 }
1639 
1640 inline
1641 __attribute__((visibility("hidden")))
1642 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1643  size_t sizeBytes, size_t offset,
1644  hipMemcpyKind kind,
1645  hipStream_t stream __dparm(0)) {
1646  if (!symbolName) return hipErrorInvalidSymbol;
1647 
1648  hipDeviceptr_t src = NULL;
1649  hipGetSymbolAddress(&src, symbolName);
1650 
1651  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
1652  stream,
1653  (const char*)symbolName);
1654 }
1655 #endif // End : Not supported in gcc
1656 
1657 #endif // __HIP_VDI__
1658 
1686 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
1687  hipStream_t stream __dparm(0));
1688 
1698 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
1699 
1709 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes);
1710 
1720 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
1721 
1737 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
1738 
1754 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
1755  hipStream_t stream __dparm(0));
1756 
1768 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
1769 
1782 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
1783 
1792 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
1793 
1803 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
1804 
1814 hipError_t hipMemGetInfo(size_t* free, size_t* total);
1815 
1816 
1817 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
1818 
1819 
1832 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
1833  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
1834 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
1835 
1836 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
1837 
1838 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
1839 
1848 hipError_t hipFreeArray(hipArray* array);
1849 
1862 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
1863  struct hipExtent extent, unsigned int flags);
1880 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
1881  size_t height, hipMemcpyKind kind);
1882 
1892 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
1893 
1904 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
1905 
1923 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
1924  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
1925 
1942 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
1943  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
1944 
1961 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
1962  size_t count, hipMemcpyKind kind);
1963 
1979 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
1980  size_t count, hipMemcpyKind kind);
1981 
1995 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
1996 
2010 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2011 
2022 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2023 
2035 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2036 
2037 // doxygen end Memory
2069 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2070 
2071 
2088 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2089 
2090 
2102 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2103 
2116 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2117 
2118 #ifndef USE_PEER_NON_UNIFIED
2119 #define USE_PEER_NON_UNIFIED 1
2120 #endif
2121 
2122 #if USE_PEER_NON_UNIFIED == 1
2123 
2134 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2135  size_t sizeBytes);
2136 
2149 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2150  size_t sizeBytes, hipStream_t stream __dparm(0));
2151 #endif
2152 
2153 
2154 // doxygen end PeerToPeer
2173 // TODO-ctx - more description on error codes.
2174 hipError_t hipInit(unsigned int flags);
2175 
2176 
2196 DEPRECATED(DEPRECATED_MSG)
2197 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2198 
2209 DEPRECATED(DEPRECATED_MSG)
2210 hipError_t hipCtxDestroy(hipCtx_t ctx);
2211 
2222 DEPRECATED(DEPRECATED_MSG)
2223 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2224 
2235 DEPRECATED(DEPRECATED_MSG)
2236 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2237 
2248 DEPRECATED(DEPRECATED_MSG)
2249 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2250 
2261 DEPRECATED(DEPRECATED_MSG)
2262 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2263 
2275 DEPRECATED(DEPRECATED_MSG)
2276 hipError_t hipCtxGetDevice(hipDevice_t* device);
2277 
2295 DEPRECATED(DEPRECATED_MSG)
2296 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2297 
2311 DEPRECATED(DEPRECATED_MSG)
2312 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2313 
2327 DEPRECATED(DEPRECATED_MSG)
2328 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2329 
2343 DEPRECATED(DEPRECATED_MSG)
2344 hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config);
2345 
2359 DEPRECATED(DEPRECATED_MSG)
2360 hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig);
2361 
2373 DEPRECATED(DEPRECATED_MSG)
2374 hipError_t hipCtxSynchronize(void);
2375 
2386 DEPRECATED(DEPRECATED_MSG)
2387 hipError_t hipCtxGetFlags(unsigned int* flags);
2388 
2408 DEPRECATED(DEPRECATED_MSG)
2409 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2410 
2427 DEPRECATED(DEPRECATED_MSG)
2428 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
2429 
2442 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
2443 
2456 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
2457 
2469 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
2470 
2481 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
2482 
2494 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
2495 
2496 // doxygen end Context Management
2508 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
2509 
2518 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
2519 
2528 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
2529 
2538 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
2539 
2540 
2548 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
2549 
2550 
2558 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
2559 
2575 hipError_t hipDriverGetVersion(int* driverVersion);
2576 
2589 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
2590 
2602 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
2603 
2614 hipError_t hipModuleUnload(hipModule_t module);
2615 
2626 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
2627 
2637 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
2638 
2648 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
2649 
2650 #if !__HIP_VDI__
2651 #if defined(__cplusplus)
2652 } // extern "C"
2653 #endif
2654 
2655 #ifdef __cplusplus
2656 namespace hip_impl {
2657  class agent_globals_impl;
2658  class agent_globals {
2659  public:
2660  agent_globals();
2661  ~agent_globals();
2662  agent_globals(const agent_globals&) = delete;
2663 
2664  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
2665  hipModule_t hmod, const char* name);
2666  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2667  const char* name);
2668  private:
2669  agent_globals_impl* impl;
2670  };
2671 
2672  inline
2673  __attribute__((visibility("hidden")))
2674  agent_globals& get_agent_globals() {
2675  static agent_globals ag;
2676  return ag;
2677  }
2678 
2679  extern "C"
2680  inline
2681  __attribute__((visibility("hidden")))
2682  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2683  const char* name) {
2684  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
2685  }
2686 } // Namespace hip_impl.
2687 #endif
2688 
2689 #if defined(__cplusplus)
2690 extern "C" {
2691 #endif
2692 
2703 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
2704  hipModule_t hmod, const char* name);
2705 #endif // __HIP_VDI__
2706 
2707 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
2708 
2718 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
2719 
2732 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
2733  hipJitOption* options, void** optionValues);
2734 
2759 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
2760  unsigned int gridDimZ, unsigned int blockDimX,
2761  unsigned int blockDimY, unsigned int blockDimZ,
2762  unsigned int sharedMemBytes, hipStream_t stream,
2763  void** kernelParams, void** extra);
2764 
2780 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
2781  void** kernelParams, unsigned int sharedMemBytes,
2782  hipStream_t stream);
2783 
2794 hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
2795  int numDevices, unsigned int flags);
2796 
2808 hipError_t hipOccupancyMaxPotentialBlockSize(uint32_t* gridSize, uint32_t* blockSize,
2809  hipFunction_t f, size_t dynSharedMemPerBlk,
2810  uint32_t blockSizeLimit);
2811 
2821  uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk);
2822 
2833  uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
2834 
2846 hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
2847  int numDevices, unsigned int flags);
2848 
2849 
2850 // doxygen end Version Management
2868 // TODO - expand descriptions:
2874 hipError_t hipProfilerStart();
2875 
2876 
2882 hipError_t hipProfilerStop();
2883 
2884 
2889 // TODO: implement IPC apis
2890 
2916 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
2917 
2954 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
2955 
2974 hipError_t hipIpcCloseMemHandle(void* devPtr);
2975 
2976 
2977 // hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
2978 // hipError_t hipIpcCloseMemHandle(void *devPtr);
2979 // // hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
2980 // hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
2981 
2982 
3003 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3004 
3005 
3016 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3017 
3018 
3027 hipError_t hipLaunchByPtr(const void* func);
3028 
3029 
3044 hipError_t __hipPushCallConfiguration(dim3 gridDim,
3045  dim3 blockDim,
3046  size_t sharedMem __dparm(0),
3047  hipStream_t stream __dparm(0));
3048 
3062 hipError_t __hipPopCallConfiguration(dim3 *gridDim,
3063  dim3 *blockDim,
3064  size_t *sharedMem,
3065  hipStream_t *stream);
3066 
3083 hipError_t hipLaunchKernel(const void* function_address,
3084  dim3 numBlocks,
3085  dim3 dimBlocks,
3086  void** args,
3087  size_t sharedMemBytes __dparm(0),
3088  hipStream_t stream __dparm(0));
3089 
3095 #ifdef __cplusplus
3096 } /* extern "c" */
3097 #endif
3098 
3099 #if USE_PROF_API
3100 #include <hip/hcc_detail/hip_prof_str.h>
3101 #endif
3102 
3103 #ifdef __cplusplus
3104 extern "C" {
3105 #endif
3106 
3109 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3110 hipError_t hipRemoveApiCallback(uint32_t id);
3111 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3112 hipError_t hipRemoveActivityCallback(uint32_t id);
3113 const char* hipApiName(uint32_t id);
3114 const char* hipKernelNameRef(const hipFunction_t f);
3115 #ifdef __cplusplus
3116 } /* extern "C" */
3117 #endif
3118 
3119 #ifdef __cplusplus
3120 
3121 class TlsData;
3122 
3123 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3124  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3125 
3126 hipError_t ihipBindTextureImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, size_t* offset,
3127  const void* devPtr, const struct hipChannelFormatDesc* desc,
3128  size_t size, textureReference* tex);
3129 
3130 /*
3131  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3132  *reference tex.
3133  *
3134  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3135  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3136  *memory previously bound to tex is unbound.
3137  *
3138  * @param[in] offset - Offset in bytes
3139  * @param[out] tex - texture to bind
3140  * @param[in] devPtr - Memory area on device
3141  * @param[in] desc - Channel format
3142  * @param[in] size - Size of the memory area pointed to by devPtr
3143  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3144  **/
3145 template <class T, int dim, enum hipTextureReadMode readMode>
3146 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3147  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3148  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
3149 }
3150 
3151 /*
3152  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3153  *reference tex.
3154  *
3155  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3156  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3157  *memory previously bound to tex is unbound.
3158  *
3159  * @param[in] offset - Offset in bytes
3160  * @param[in] tex - texture to bind
3161  * @param[in] devPtr - Memory area on device
3162  * @param[in] size - Size of the memory area pointed to by devPtr
3163  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3164  **/
3165 template <class T, int dim, enum hipTextureReadMode readMode>
3166 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3167  size_t size = UINT_MAX) {
3168  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
3169 }
3170 
3171 // C API
3172 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
3173  const hipChannelFormatDesc* desc, size_t width, size_t height,
3174  size_t pitch);
3175 
3176 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3177  const void* devPtr, const struct hipChannelFormatDesc* desc,
3178  size_t width, size_t height, textureReference* tex);
3179 
3180 template <class T, int dim, enum hipTextureReadMode readMode>
3181 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3182  const void* devPtr, size_t width, size_t height, size_t pitch) {
3183  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
3184  &tex);
3185 }
3186 
3187 template <class T, int dim, enum hipTextureReadMode readMode>
3188 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3189  const void* devPtr, const struct hipChannelFormatDesc& desc,
3190  size_t width, size_t height, size_t pitch) {
3191  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
3192 }
3193 
3194 // C API
3195 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
3196  const hipChannelFormatDesc* desc);
3197 
3198 hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode,
3199  hipArray_const_t array,
3200  const struct hipChannelFormatDesc& desc,
3201  textureReference* tex);
3202 
3203 template <class T, int dim, enum hipTextureReadMode readMode>
3204 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
3205  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, tex.channelDesc, &tex);
3206 }
3207 
3208 template <class T, int dim, enum hipTextureReadMode readMode>
3209 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
3210  const struct hipChannelFormatDesc& desc) {
3211  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, desc, &tex);
3212 }
3213 
3214 template <class T, int dim, enum hipTextureReadMode readMode>
3215 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
3216  hipArray_const_t array,
3217  const struct hipChannelFormatDesc* desc) {
3218  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, *desc, tex);
3219 }
3220 
3221 // C API
3222 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
3223  hipMipmappedArray_const_t mipmappedArray,
3224  const hipChannelFormatDesc* desc);
3225 
3226 template <class T, int dim, enum hipTextureReadMode readMode>
3227 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3228  hipMipmappedArray_const_t mipmappedArray) {
3229  return hipSuccess;
3230 }
3231 
3232 template <class T, int dim, enum hipTextureReadMode readMode>
3233 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3234  hipMipmappedArray_const_t mipmappedArray,
3235  const hipChannelFormatDesc& desc) {
3236  return hipSuccess;
3237 }
3238 
3239 
3240 template <class T>
3241 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
3242  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
3243  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
3244  blockDim, kernelParams, sharedMemBytes, stream);
3245 }
3246 
3247 template <class T>
3248 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3249  unsigned int numDevices, unsigned int flags = 0) {
3250  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
3251 }
3252 
3253 template <class T>
3254 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
3255  unsigned int numDevices, unsigned int flags = 0) {
3256  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
3257 }
3258 
3259 
3260 /*
3261  * @brief Unbinds the textuer bound to @p tex
3262  *
3263  * @param[in] tex - texture to unbind
3264  *
3265  * @return #hipSuccess
3266  **/
3267 hipError_t hipUnbindTexture(const textureReference* tex);
3268 
3269 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
3270 
3271 template <class T, int dim, enum hipTextureReadMode readMode>
3272 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
3273  return ihipUnbindTextureImpl(tex.textureObject);
3274 }
3275 
3276 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
3277 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
3278 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
3279 
3280 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
3281  const hipTextureDesc* pTexDesc,
3282  const hipResourceViewDesc* pResViewDesc);
3283 
3284 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3285 
3286 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
3287  hipTextureObject_t textureObject);
3288 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
3289  hipTextureObject_t textureObject);
3290 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
3291  hipTextureObject_t textureObject);
3292 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
3293 
3294 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
3295 
3296 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
3297 
3298 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
3299 
3300 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
3301 
3302 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
3303  size_t size);
3304 
3305 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
3306  hipDeviceptr_t devPtr, size_t pitch);
3307 
3308 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
3309 
3310 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
3311 
3312 // doxygen end Texture
3318 #endif
3319 
3320 #ifdef __GNUC__
3321 #pragma GCC visibility pop
3322 #endif
3323 
3341 // end-group HCC_Specific
3347 // doxygen end HIP API
3352 #endif
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:2050
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:248
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:954
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:220
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:1921
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:84
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:278
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:1788
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:419
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
Definition: hip_device.cpp:477
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:266
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
Definition: hip_memory.cpp:2113
TODO-doc.
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_memory.cpp:2083
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:1335
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:1130
Definition: driver_types.h:240
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
Definition: hip_memory.cpp:456
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 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:1728
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:1354
uint32_t x
x
Definition: hip_runtime_api.h:270
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1391
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:193
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:125
Definition: hip_runtime_api.h:150
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:249
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:2085
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:172
Definition: driver_types.h:181
hipError_t hipLaunchCooperativeKernel(const void *f, dim3 gridDim, dim3 blockDimX, void **kernelParams, unsigned int sharedMemBytes, hipStream_t stream)
launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelp...
Definition: hip_module.cpp:383
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
Definition: hip_memory.cpp:1160
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
Definition: hip_module.cpp:904
Definition: hip_module.cpp:107
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:262
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:186
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
Definition: hip_context.cpp:241
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:1351
Definition: hip_hcc_internal.h:135
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 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.
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
Definition: hip_memory.cpp:2134
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:115
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
Definition: hip_memory.cpp:371
Definition: hip_hcc_internal.h:902
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:96
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:1111
Definition: driver_types.h:77
hipDeviceAttribute_t
Definition: hip_runtime_api.h:274
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
Definition: hip_event.cpp:160
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:503
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:269
uint32_t y
y
Definition: hip_runtime_api.h:271
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:843
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
Definition: hip_module.cpp:1116
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:97
#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:395
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_memory.cpp:391
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
Definition: hip_event.cpp:203
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_device.cpp:76
hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer&#39;s memory.
Definition: hip_peer.cpp:179
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
Definition: hip_device.cpp:71
Definition: driver_types.h:68
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:1837
Definition: driver_types.h:253
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
Definition: hip_module.cpp:1029
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:1289
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:911
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
Definition: hip_stream.cpp:183
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:2170
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:1208
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:258
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:280
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:246
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:823
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:1276
void * func
Device function symbol.
Definition: hip_runtime_api.h:279
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
Definition: hip_device.cpp:144
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:1184
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:431
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
Definition: hip_device.cpp:366
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:936
Definition: driver_types.h:61
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:239
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:1853
Definition: driver_types.h:233
dim3 blockDim
Block dimentions.
Definition: hip_runtime_api.h:281
hipFuncCache_t
Definition: hip_runtime_api.h:245
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:284
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:1957
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:1998
uint32_t z
z
Definition: hip_runtime_api.h:272
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:149
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
Definition: hip_context.cpp:39
hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams *launchParamsList, int numDevices, unsigned int flags)
Launches kernels on multiple devices where thread blocks can cooperate and synchronize as they execut...
Definition: hip_module.cpp:469
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
Definition: hip_memory.cpp:1502
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:1373
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
Definition: hip_clang.cpp:192
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:1268
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:133
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:465
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
Definition: hip_device.cpp:109
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:257
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:590
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:256
Definition: driver_types.h:38
Definition: hip_hcc_internal.h:722
hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams *launchParamsList, int numDevices, unsigned int flags)
Launches kernels on multiple devices and guarantees all specified kernels are dispatched on respectiv...
Definition: hip_module.cpp:306
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(uint32_t *numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
Definition: hip_module.cpp:1360
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
Definition: hip_device.cpp:339
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:1261
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
Definition: hip_memory.cpp:1011
Definition: hip_hcc_internal.h:544
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:200
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:1133
hipError_t hipEventCreate(hipEvent_t *event)
Definition: hip_event.cpp:103
Definition: driver_types.h:90
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:214
Definition: driver_types.h:209
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
Definition: hip_device.cpp:117
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:110
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:757
Definition: hip_hcc_internal.h:391
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:445
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:247
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:1283
void ** args
Arguments.
Definition: hip_runtime_api.h:282
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:1011
Definition: hip_runtime_api.h:260
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
Definition: hip_memory.cpp:2215
hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char 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:1889
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
Definition: hip_memory.cpp:161
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:283
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2466
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:1905
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2456
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
Definition: hip_clang.cpp:210
Definition: texture_types.h:94