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/hip_runtime_api.h>
44 #include <hip/hcc_detail/driver_types.h>
47 
48 #if !__HIP_VDI__ && defined(__cplusplus)
49 #include <hsa/hsa.h>
50 #include <hip/hcc_detail/program_state.hpp>
51 #endif
52 
53 #if defined(_MSC_VER)
54 #define DEPRECATED(msg) __declspec(deprecated(msg))
55 #else // !defined(_MSC_VER)
56 #define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
57 #endif // !defined(_MSC_VER)
58 
59 #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"
60 
61 #if defined(__HCC__) && (__hcc_workweek__ < 16155)
62 #error("This version of HIP requires a newer version of HCC.");
63 #endif
64 
65 #define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
66 #define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
67 #define HIP_LAUNCH_PARAM_END ((void*)0x03)
68 
69 #ifdef __cplusplus
70  #define __dparm(x) \
71  = x
72 #else
73  #define __dparm(x)
74 #endif
75 
76 #ifdef __GNUC__
77 #pragma GCC visibility push (default)
78 #endif
79 
80 #ifdef __cplusplus
81 
82 namespace hip_impl {
83 hipError_t hip_init();
84 } // namespace hip_impl
85 #endif
86 
87 // Structure definitions:
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 
92 //---
93 // API-visible structures
94 typedef struct ihipCtx_t* hipCtx_t;
95 
96 // Note many APIs also use integer deviceIds as an alternative to the device pointer:
97 typedef int hipDevice_t;
98 
99 typedef struct ihipStream_t* hipStream_t;
100 
101 // TODO: IPC implementation
102 
103 #define hipIpcMemLazyEnablePeerAccess 0
104 
105 #define HIP_IPC_HANDLE_SIZE 64
106 
107 typedef struct hipIpcMemHandle_st {
108  char reserved[HIP_IPC_HANDLE_SIZE];
110 
111 // TODO: IPC event handle currently unsupported
112 struct ihipIpcEventHandle_t;
113 typedef struct ihipIpcEventHandle_t* hipIpcEventHandle_t;
114 
115 
116 // END TODO
117 
118 typedef struct ihipModule_t* hipModule_t;
119 
120 typedef struct ihipModuleSymbol_t* hipFunction_t;
121 
122 typedef struct hipFuncAttributes {
123  int binaryVersion;
124  int cacheModeCA;
125  size_t constSizeBytes;
126  size_t localSizeBytes;
127  int maxDynamicSharedSizeBytes;
128  int maxThreadsPerBlock;
129  int numRegs;
130  int preferredShmemCarveout;
131  int ptxVersion;
132  size_t sharedSizeBytes;
134 
135 typedef struct ihipEvent_t* hipEvent_t;
136 
137 enum hipLimit_t {
138  hipLimitMallocHeapSize = 0x02,
139 };
140 
145 #define hipStreamDefault \
147  0x00
148 #define hipStreamNonBlocking 0x01
149 
150 
152 #define hipEventDefault 0x0
153 #define hipEventBlockingSync \
154  0x1
155 #define hipEventDisableTiming \
156  0x2
157 #define hipEventInterprocess 0x4
158 #define hipEventReleaseToDevice \
159  0x40000000
160 #define hipEventReleaseToSystem \
163  0x80000000
164 
167 
169 #define hipHostMallocDefault 0x0
170 #define hipHostMallocPortable 0x1
171 #define hipHostMallocMapped \
172  0x2
173 #define hipHostMallocWriteCombined 0x4
175 #define hipHostMallocCoherent \
176  0x40000000
177 #define hipHostMallocNonCoherent \
179  0x80000000
180 
182 #define hipMemAttachGlobal 0x0
183 #define hipMemAttachHost 0x1
184 
185 #define hipDeviceMallocDefault 0x0
186 #define hipDeviceMallocFinegrained 0x1
187 
188 #define hipHostRegisterDefault 0x0
190 #define hipHostRegisterPortable 0x1
191 #define hipHostRegisterMapped \
192  0x2
193 #define hipHostRegisterIoMemory 0x4
195 #define hipExtHostRegisterCoarseGrained 0x8
196 
197 #define hipDeviceScheduleAuto 0x0
198 #define hipDeviceScheduleSpin \
199  0x1
200 #define hipDeviceScheduleYield \
202  0x2
203 #define hipDeviceScheduleBlockingSync 0x4
205 #define hipDeviceScheduleMask 0x7
206 
207 #define hipDeviceMapHost 0x8
208 #define hipDeviceLmemResizeToMax 0x16
209 
210 #define hipArrayDefault 0x00
211 #define hipArrayLayered 0x01
212 #define hipArraySurfaceLoadStore 0x02
213 #define hipArrayCubemap 0x04
214 #define hipArrayTextureGather 0x08
215 
216 /*
217  * @brief hipJitOption
218  * @enum
219  * @ingroup Enumerations
220  */
221 typedef enum hipJitOption {
222  hipJitOptionMaxRegisters = 0,
223  hipJitOptionThreadsPerBlock,
224  hipJitOptionWallTime,
225  hipJitOptionInfoLogBuffer,
226  hipJitOptionInfoLogBufferSizeBytes,
227  hipJitOptionErrorLogBuffer,
228  hipJitOptionErrorLogBufferSizeBytes,
229  hipJitOptionOptimizationLevel,
230  hipJitOptionTargetFromContext,
231  hipJitOptionTarget,
232  hipJitOptionFallbackStrategy,
233  hipJitOptionGenerateDebugInfo,
234  hipJitOptionLogVerbose,
235  hipJitOptionGenerateLineInfo,
236  hipJitOptionCacheMode,
237  hipJitOptionSm3xOpt,
238  hipJitOptionFastCompile,
239  hipJitOptionNumOptions
240 } hipJitOption;
241 
242 
246 typedef enum hipFuncCache_t {
252 
253 
257 typedef enum hipSharedMemConfig {
264 
265 
270 typedef struct dim3 {
271  uint32_t x;
272  uint32_t y;
273  uint32_t z;
274 #ifdef __cplusplus
275  __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
276 #endif
277 } dim3;
278 
279 typedef struct hipLaunchParams_t {
280  void* func;
283  void **args;
284  size_t sharedMem;
285  hipStream_t stream;
287 
288 
289 // Doxygen end group GlobalDefs
293 //-------------------------------------------------------------------------------------------------
294 
295 
296 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
297 // out-of-scope.
298 // typedef class ihipStream_t * hipStream_t;
299 
300 
301 /*
302  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
303  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
304  * out-of-scope but the true event is being written by some async queue or device */
305 // typedef struct hipEvent_t {
306 // struct ihipEvent_t *_handle;
307 //} hipEvent_t;
308 
309 
335 hipError_t hipDeviceSynchronize(void);
336 
337 
349 hipError_t hipDeviceReset(void);
350 
351 
383 hipError_t hipSetDevice(int deviceId);
384 
385 
399 hipError_t hipGetDevice(int* deviceId);
400 
401 
414 hipError_t hipGetDeviceCount(int* count);
415 
425 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
426 
440 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
441 
442 
453 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
454 
455 
466 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
467 
478 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
479 
480 
491 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
492 
504 hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig);
505 
506 
518 hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config);
519 
544 hipError_t hipSetDeviceFlags(unsigned flags);
545 
554 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
555 
568 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
569 
570 // end doxygen Device
593 hipError_t hipGetLastError(void);
594 
595 
606 hipError_t hipPeekAtLastError(void);
607 
608 
617 const char* hipGetErrorName(hipError_t hip_error);
618 
619 
630 const char* hipGetErrorString(hipError_t hipError);
631 
632 // end doxygen Error
665 hipError_t hipStreamCreate(hipStream_t* stream);
666 
667 
685 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
686 
687 
706 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
707 
708 
723 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
724 
725 
744 hipError_t hipStreamDestroy(hipStream_t stream);
745 
746 
762 hipError_t hipStreamQuery(hipStream_t stream);
763 
764 
784 hipError_t hipStreamSynchronize(hipStream_t stream);
785 
786 
806 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
807 
808 
822 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
823 
824 
838 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
839 
840 
844 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
845 
861 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
862  unsigned int flags);
863 
864 
865 // end doxygen Stream
902 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
903 
904 
916 hipError_t hipEventCreate(hipEvent_t* event);
917 
918 
946 #ifdef __cplusplus
947 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
948 #else
949 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
950 #endif
951 
968 hipError_t hipEventDestroy(hipEvent_t event);
969 
970 
988 hipError_t hipEventSynchronize(hipEvent_t event);
989 
990 
1019 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1020 
1021 
1037 hipError_t hipEventQuery(hipEvent_t event);
1038 
1039 
1040 // end doxygen Events
1071 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1072 
1086 hipError_t hipMalloc(void** ptr, size_t size);
1087 
1102 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1103 
1116 DEPRECATED("use hipHostMalloc instead")
1117 hipError_t hipMallocHost(void** ptr, size_t size);
1118 
1132 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1133 
1143 hipError_t hipMallocManaged(void** devPtr, size_t size, unsigned int flags __dparm(0));
1144 
1158 DEPRECATED("use hipHostMalloc instead")
1159 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1160 
1172 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1173 
1183 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1184 
1221 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1222 
1231 hipError_t hipHostUnregister(void* hostPtr);
1232 
1252 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1253 
1267 hipError_t hipFree(void* ptr);
1268 
1279 DEPRECATED("use hipHostFree instead")
1280 hipError_t hipFreeHost(void* ptr);
1281 
1295 hipError_t hipHostFree(void* ptr);
1296 
1324 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1325 
1343 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1344 
1362 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1363 
1381 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1382 
1400 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1401 
1419 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1420 
1438 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1439  hipStream_t stream);
1440 
1441 #if __HIP_VDI__
1442 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1443  hipModule_t hmod, const char* name);
1444 
1445 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName);
1446 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName);
1447 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1448  size_t sizeBytes, size_t offset __dparm(0),
1449  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1450 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1451  size_t sizeBytes, size_t offset,
1452  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1453 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1454  size_t sizeBytes, size_t offset __dparm(0),
1455  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1456 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1457  size_t sizeBytes, size_t offset,
1458  hipMemcpyKind kind,
1459  hipStream_t stream __dparm(0));
1460 #else
1461 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1462 
1463 #ifdef __cplusplus //Start : Not supported in gcc
1464 namespace hip_impl {
1465 inline
1466 __attribute__((visibility("hidden")))
1467 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1468  const char* name);
1469 } // Namespace hip_impl.
1470 
1471 
1482 inline
1483 __attribute__((visibility("hidden")))
1484 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
1485  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
1486  hip_impl::hip_init();
1487  size_t size = 0;
1488  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
1489 }
1490 
1491 
1502 inline
1503 __attribute__((visibility("hidden")))
1504 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
1505  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
1506  hip_impl::hip_init();
1507  void* devPtr = nullptr;
1508  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
1509 }
1510 #endif // End : Not supported in gcc
1511 
1512 #if defined(__cplusplus)
1513 } // extern "C"
1514 #endif
1515 
1516 #ifdef __cplusplus
1517 namespace hip_impl {
1518 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
1519  const char*);
1520 } // Namespace hip_impl.
1521 #endif
1522 
1523 #ifdef __cplusplus
1524 extern "C" {
1525 #endif
1526 
1543 hipError_t hipLaunchKernel(const void* function_address,
1544  dim3 numBlocks, dim3 dimBlocks, void** args,
1545  size_t sharedMemBytes, hipStream_t stream);
1546 
1547 #ifdef __cplusplus
1548 }
1549 #endif
1550 
1551 #if defined(__cplusplus)
1552 extern "C" {
1553 #endif
1554 
1578 #ifdef __cplusplus
1579 inline
1580 __attribute__((visibility("hidden")))
1581 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1582  size_t sizeBytes, size_t offset __dparm(0),
1583  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
1584  if (!symbolName) return hipErrorInvalidSymbol;
1585 
1586  hipDeviceptr_t dst = NULL;
1587  hipGetSymbolAddress(&dst, (const char*)symbolName);
1588 
1589  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
1590  (const char*)symbolName);
1591 }
1592 #endif
1593 
1594 #if defined(__cplusplus)
1595 } // extern "C"
1596 #endif
1597 
1598 #ifdef __cplusplus
1599 namespace hip_impl {
1600 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
1601  hipMemcpyKind, hipStream_t, const char*);
1602 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
1603  hipMemcpyKind, const char*);
1604 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
1605  hipMemcpyKind, hipStream_t, const char*);
1606 } // Namespace hip_impl.
1607 #endif
1608 
1609 #if defined(__cplusplus)
1610 extern "C" {
1611 #endif
1612 
1639 #ifdef __cplusplus //Start : Not supported in gcc
1640 inline
1641 __attribute__((visibility("hidden")))
1642 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1643  size_t sizeBytes, size_t offset,
1644  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
1645  if (!symbolName) return hipErrorInvalidSymbol;
1646 
1647  hipDeviceptr_t dst = NULL;
1648  hipGetSymbolAddress(&dst, symbolName);
1649 
1650  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
1651  stream,
1652  (const char*)symbolName);
1653 }
1654 
1655 inline
1656 __attribute__((visibility("hidden")))
1657 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1658  size_t sizeBytes, size_t offset __dparm(0),
1659  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
1660  if (!symbolName) return hipErrorInvalidSymbol;
1661 
1662  hipDeviceptr_t src = NULL;
1663  hipGetSymbolAddress(&src, symbolName);
1664 
1665  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
1666  (const char*)symbolName);
1667 }
1668 
1669 inline
1670 __attribute__((visibility("hidden")))
1671 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1672  size_t sizeBytes, size_t offset,
1673  hipMemcpyKind kind,
1674  hipStream_t stream __dparm(0)) {
1675  if (!symbolName) return hipErrorInvalidSymbol;
1676 
1677  hipDeviceptr_t src = NULL;
1678  hipGetSymbolAddress(&src, symbolName);
1679 
1680  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
1681  stream,
1682  (const char*)symbolName);
1683 }
1684 #endif // End : Not supported in gcc
1685 
1686 #endif // __HIP_VDI__
1687 
1715 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
1716  hipStream_t stream __dparm(0));
1717 
1727 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
1728 
1738 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes);
1739 
1749 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
1750 
1766 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
1767 
1783 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
1784  hipStream_t stream __dparm(0));
1785 
1797 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
1798 
1811 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
1812 
1821 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
1822 
1832 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
1833 
1843 hipError_t hipMemGetInfo(size_t* free, size_t* total);
1844 
1845 
1846 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
1847 
1848 
1861 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
1862  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
1863 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
1864 
1865 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
1866 
1867 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
1868 
1877 hipError_t hipFreeArray(hipArray* array);
1878 
1891 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
1892  struct hipExtent extent, unsigned int flags);
1909 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
1910  size_t height, hipMemcpyKind kind);
1911 
1921 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
1922 
1933 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
1934 
1952 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
1953  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
1954 
1971 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
1972  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
1973 
1990 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
1991  size_t count, hipMemcpyKind kind);
1992 
2008 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
2009  size_t count, hipMemcpyKind kind);
2010 
2024 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
2025 
2039 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2040 
2051 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2052 
2064 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2065 
2066 // doxygen end Memory
2098 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2099 
2100 
2117 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2118 
2119 
2131 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2132 
2145 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2146 
2147 #ifndef USE_PEER_NON_UNIFIED
2148 #define USE_PEER_NON_UNIFIED 1
2149 #endif
2150 
2151 #if USE_PEER_NON_UNIFIED == 1
2152 
2163 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2164  size_t sizeBytes);
2165 
2178 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2179  size_t sizeBytes, hipStream_t stream __dparm(0));
2180 #endif
2181 
2182 
2183 // doxygen end PeerToPeer
2202 // TODO-ctx - more description on error codes.
2203 hipError_t hipInit(unsigned int flags);
2204 
2205 
2225 DEPRECATED(DEPRECATED_MSG)
2226 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2227 
2238 DEPRECATED(DEPRECATED_MSG)
2239 hipError_t hipCtxDestroy(hipCtx_t ctx);
2240 
2251 DEPRECATED(DEPRECATED_MSG)
2252 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2253 
2264 DEPRECATED(DEPRECATED_MSG)
2265 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2266 
2277 DEPRECATED(DEPRECATED_MSG)
2278 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2279 
2290 DEPRECATED(DEPRECATED_MSG)
2291 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2292 
2304 DEPRECATED(DEPRECATED_MSG)
2305 hipError_t hipCtxGetDevice(hipDevice_t* device);
2306 
2324 DEPRECATED(DEPRECATED_MSG)
2325 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2326 
2340 DEPRECATED(DEPRECATED_MSG)
2341 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2342 
2356 DEPRECATED(DEPRECATED_MSG)
2357 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2358 
2372 DEPRECATED(DEPRECATED_MSG)
2373 hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config);
2374 
2388 DEPRECATED(DEPRECATED_MSG)
2389 hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig);
2390 
2402 DEPRECATED(DEPRECATED_MSG)
2403 hipError_t hipCtxSynchronize(void);
2404 
2415 DEPRECATED(DEPRECATED_MSG)
2416 hipError_t hipCtxGetFlags(unsigned int* flags);
2417 
2437 DEPRECATED(DEPRECATED_MSG)
2438 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2439 
2456 DEPRECATED(DEPRECATED_MSG)
2457 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
2458 
2471 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
2472 
2485 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
2486 
2498 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
2499 
2510 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
2511 
2523 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
2524 
2525 // doxygen end Context Management
2537 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
2538 
2547 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
2548 
2557 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
2558 
2567 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
2568 
2569 
2577 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
2578 
2579 
2587 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
2588 
2604 hipError_t hipDriverGetVersion(int* driverVersion);
2605 
2618 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
2619 
2631 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
2632 
2643 hipError_t hipModuleUnload(hipModule_t module);
2644 
2655 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
2656 
2666 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
2667 
2677 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
2678 
2679 #if !__HIP_VDI__
2680 #if defined(__cplusplus)
2681 } // extern "C"
2682 #endif
2683 
2684 #ifdef __cplusplus
2685 namespace hip_impl {
2686  class agent_globals_impl;
2687  class agent_globals {
2688  public:
2689  agent_globals();
2690  ~agent_globals();
2691  agent_globals(const agent_globals&) = delete;
2692 
2693  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
2694  hipModule_t hmod, const char* name);
2695  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2696  const char* name);
2697  private:
2698  agent_globals_impl* impl;
2699  };
2700 
2701  inline
2702  __attribute__((visibility("hidden")))
2703  agent_globals& get_agent_globals() {
2704  static agent_globals ag;
2705  return ag;
2706  }
2707 
2708  extern "C"
2709  inline
2710  __attribute__((visibility("hidden")))
2711  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2712  const char* name) {
2713  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
2714  }
2715 } // Namespace hip_impl.
2716 #endif
2717 
2718 #if defined(__cplusplus)
2719 extern "C" {
2720 #endif
2721 
2732 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
2733  hipModule_t hmod, const char* name);
2734 #endif // __HIP_VDI__
2735 
2736 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
2737 
2747 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
2748 
2761 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
2762  hipJitOption* options, void** optionValues);
2763 
2788 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
2789  unsigned int gridDimZ, unsigned int blockDimX,
2790  unsigned int blockDimY, unsigned int blockDimZ,
2791  unsigned int sharedMemBytes, hipStream_t stream,
2792  void** kernelParams, void** extra);
2793 
2809 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
2810  void** kernelParams, unsigned int sharedMemBytes,
2811  hipStream_t stream);
2812 
2823 hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
2824  int numDevices, unsigned int flags);
2825 
2837 hipError_t hipOccupancyMaxPotentialBlockSize(uint32_t* gridSize, uint32_t* blockSize,
2838  hipFunction_t f, size_t dynSharedMemPerBlk,
2839  uint32_t blockSizeLimit);
2840 
2850  uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk);
2851 
2862  uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
2863 
2875 hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
2876  int numDevices, unsigned int flags);
2877 
2878 
2879 // doxygen end Version Management
2897 // TODO - expand descriptions:
2903 hipError_t hipProfilerStart();
2904 
2905 
2911 hipError_t hipProfilerStop();
2912 
2913 
2918 // TODO: implement IPC apis
2919 
2945 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
2946 
2983 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
2984 
3003 hipError_t hipIpcCloseMemHandle(void* devPtr);
3004 
3005 
3006 // hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
3007 // hipError_t hipIpcCloseMemHandle(void *devPtr);
3008 // // hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
3009 // hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
3010 
3011 
3032 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3033 
3034 
3045 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3046 
3047 
3056 hipError_t hipLaunchByPtr(const void* func);
3057 
3058 
3059 
3065 #ifdef __cplusplus
3066 } /* extern "c" */
3067 #endif
3068 
3069 #include <hip/hcc_detail/hip_prof_str.h>
3070 
3071 #ifdef __cplusplus
3072 extern "C" {
3073 #endif
3074 
3077 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3078 hipError_t hipRemoveApiCallback(uint32_t id);
3079 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3080 hipError_t hipRemoveActivityCallback(uint32_t id);
3081 const char* hipApiName(uint32_t id);
3082 const char* hipKernelNameRef(const hipFunction_t f);
3083 #ifdef __cplusplus
3084 } /* extern "C" */
3085 #endif
3086 
3087 #ifdef __cplusplus
3088 
3089 class TlsData;
3090 
3091 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3092  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3093 
3094 hipError_t ihipBindTextureImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, size_t* offset,
3095  const void* devPtr, const struct hipChannelFormatDesc* desc,
3096  size_t size, textureReference* tex);
3097 
3098 /*
3099  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3100  *reference tex.
3101  *
3102  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3103  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3104  *memory previously bound to tex is unbound.
3105  *
3106  * @param[in] offset - Offset in bytes
3107  * @param[out] tex - texture to bind
3108  * @param[in] devPtr - Memory area on device
3109  * @param[in] desc - Channel format
3110  * @param[in] size - Size of the memory area pointed to by devPtr
3111  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3112  **/
3113 template <class T, int dim, enum hipTextureReadMode readMode>
3114 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3115  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3116  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
3117 }
3118 
3119 /*
3120  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3121  *reference tex.
3122  *
3123  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3124  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3125  *memory previously bound to tex is unbound.
3126  *
3127  * @param[in] offset - Offset in bytes
3128  * @param[in] tex - texture to bind
3129  * @param[in] devPtr - Memory area on device
3130  * @param[in] size - Size of the memory area pointed to by devPtr
3131  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3132  **/
3133 template <class T, int dim, enum hipTextureReadMode readMode>
3134 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3135  size_t size = UINT_MAX) {
3136  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
3137 }
3138 
3139 // C API
3140 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
3141  const hipChannelFormatDesc* desc, size_t width, size_t height,
3142  size_t pitch);
3143 
3144 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3145  const void* devPtr, const struct hipChannelFormatDesc* desc,
3146  size_t width, size_t height, textureReference* tex);
3147 
3148 template <class T, int dim, enum hipTextureReadMode readMode>
3149 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3150  const void* devPtr, size_t width, size_t height, size_t pitch) {
3151  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
3152  &tex);
3153 }
3154 
3155 template <class T, int dim, enum hipTextureReadMode readMode>
3156 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3157  const void* devPtr, const struct hipChannelFormatDesc& desc,
3158  size_t width, size_t height, size_t pitch) {
3159  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
3160 }
3161 
3162 // C API
3163 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
3164  const hipChannelFormatDesc* desc);
3165 
3166 hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode,
3167  hipArray_const_t array,
3168  const struct hipChannelFormatDesc& desc,
3169  textureReference* tex);
3170 
3171 template <class T, int dim, enum hipTextureReadMode readMode>
3172 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
3173  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, tex.channelDesc, &tex);
3174 }
3175 
3176 template <class T, int dim, enum hipTextureReadMode readMode>
3177 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
3178  const struct hipChannelFormatDesc& desc) {
3179  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, desc, &tex);
3180 }
3181 
3182 template <class T, int dim, enum hipTextureReadMode readMode>
3183 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
3184  hipArray_const_t array,
3185  const struct hipChannelFormatDesc* desc) {
3186  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, *desc, tex);
3187 }
3188 
3189 // C API
3190 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
3191  hipMipmappedArray_const_t mipmappedArray,
3192  const hipChannelFormatDesc* desc);
3193 
3194 template <class T, int dim, enum hipTextureReadMode readMode>
3195 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3196  hipMipmappedArray_const_t mipmappedArray) {
3197  return hipSuccess;
3198 }
3199 
3200 template <class T, int dim, enum hipTextureReadMode readMode>
3201 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3202  hipMipmappedArray_const_t mipmappedArray,
3203  const hipChannelFormatDesc& desc) {
3204  return hipSuccess;
3205 }
3206 
3207 
3208 template <class T>
3209 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
3210  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
3211  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
3212  blockDim, kernelParams, sharedMemBytes, stream);
3213 }
3214 
3215 template <class T>
3216 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3217  unsigned int numDevices, unsigned int flags = 0) {
3218  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
3219 }
3220 
3221 template <class T>
3222 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
3223  unsigned int numDevices, unsigned int flags = 0) {
3224  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
3225 }
3226 
3227 
3228 /*
3229  * @brief Unbinds the textuer bound to @p tex
3230  *
3231  * @param[in] tex - texture to unbind
3232  *
3233  * @return #hipSuccess
3234  **/
3235 hipError_t hipUnbindTexture(const textureReference* tex);
3236 
3237 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
3238 
3239 template <class T, int dim, enum hipTextureReadMode readMode>
3240 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
3241  return ihipUnbindTextureImpl(tex.textureObject);
3242 }
3243 
3244 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
3245 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
3246 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
3247 
3248 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
3249  const hipTextureDesc* pTexDesc,
3250  const hipResourceViewDesc* pResViewDesc);
3251 
3252 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3253 
3254 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
3255  hipTextureObject_t textureObject);
3256 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
3257  hipTextureObject_t textureObject);
3258 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
3259  hipTextureObject_t textureObject);
3260 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
3261 
3262 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
3263 
3264 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
3265 
3266 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
3267 
3268 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
3269 
3270 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
3271  size_t size);
3272 
3273 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
3274  hipDeviceptr_t devPtr, size_t pitch);
3275 
3276 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
3277 
3278 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
3279 
3280 // doxygen end Texture
3286 #endif
3287 
3288 #ifdef __GNUC__
3289 #pragma GCC visibility pop
3290 #endif
3291 
3309 // end-group HCC_Specific
3315 // doxygen end HIP API
3320 #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:2029
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:249
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:826
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:1901
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
Definition: hip_runtime_api.h:279
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:1768
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:404
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
Definition: hip_device.cpp:462
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:2092
TODO-doc.
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_memory.cpp:2062
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:1315
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:1002
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:1708
hipError_t hipLaunchKernel(const void *function_address, dim3 numBlocks, dim3 dimBlocks, void **args, size_t sharedMemBytes, hipStream_t stream)
C compliant kernel launch API.
Definition: hip_module.cpp:1242
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:1334
uint32_t x
x
Definition: hip_runtime_api.h:271
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1371
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:144
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:250
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:2064
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:397
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:135
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:1223
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:210
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 hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
Definition: hip_memory.cpp:2113
Definition: hip_runtime_api.h:122
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:983
Definition: driver_types.h:77
hipDeviceAttribute_t
Definition: hip_runtime_api.h:268
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:488
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:270
uint32_t y
y
Definition: hip_runtime_api.h:272
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:844
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
Definition: hip_module.cpp:988
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:1817
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:901
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:1161
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:2149
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:1198
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:259
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:281
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:247
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:1256
void * func
Device function symbol.
Definition: hip_runtime_api.h:280
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:1179
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:416
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
Definition: hip_device.cpp:351
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:1833
Definition: driver_types.h:233
dim3 blockDim
Block dimentions.
Definition: hip_runtime_api.h:282
hipFuncCache_t
Definition: hip_runtime_api.h:246
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:285
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:1937
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:1978
uint32_t z
z
Definition: hip_runtime_api.h:273
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...
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
Definition: hip_memory.cpp:1482
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:1353
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:1248
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:450
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:258
Definition: hiprtc.h:85
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:575
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:257
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:320
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:1232
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
Definition: hip_device.cpp:324
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:1241
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:107
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:661
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:430
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:248
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:1263
void ** args
Arguments.
Definition: hip_runtime_api.h:283
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:883
Definition: hip_runtime_api.h:261
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
Definition: hip_memory.cpp:2194
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:1869
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:284
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2450
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:1885
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2440
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
Definition: hip_clang.cpp:210
Definition: texture_types.h:94