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__
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  #include <algorithm>
71  #include <mutex>
72  #include <string>
73  #include <unordered_map>
74  #include <vector>
75 
76  #define __dparm(x) \
77  = x
78 #else
79  #define __dparm(x)
80 #endif
81 
82 namespace hip_impl {
83 hipError_t hip_init();
84 } // namespace hip_impl
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  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 
279 // Doxygen end group GlobalDefs
283 //-------------------------------------------------------------------------------------------------
284 
285 
286 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
287 // out-of-scope.
288 // typedef class ihipStream_t * hipStream_t;
289 
290 
291 /*
292  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
293  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
294  * out-of-scope but the true event is being written by some async queue or device */
295 // typedef struct hipEvent_t {
296 // struct ihipEvent_t *_handle;
297 //} hipEvent_t;
298 
299 
325 hipError_t hipDeviceSynchronize(void);
326 
327 
339 hipError_t hipDeviceReset(void);
340 
341 
373 hipError_t hipSetDevice(int deviceId);
374 
375 
389 hipError_t hipGetDevice(int* deviceId);
390 
391 
404 hipError_t hipGetDeviceCount(int* count);
405 
415 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
416 
430 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
431 
432 
443 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
444 
445 
456 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
457 
468 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
469 
470 
481 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
482 
494 hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig);
495 
496 
508 hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config);
509 
534 hipError_t hipSetDeviceFlags(unsigned flags);
535 
544 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
545 
558 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
559 
560 // end doxygen Device
583 hipError_t hipGetLastError(void);
584 
585 
596 hipError_t hipPeekAtLastError(void);
597 
598 
607 const char* hipGetErrorName(hipError_t hip_error);
608 
609 
620 const char* hipGetErrorString(hipError_t hipError);
621 
622 // end doxygen Error
655 hipError_t hipStreamCreate(hipStream_t* stream);
656 
657 
675 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
676 
677 
696 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
697 
698 
713 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
714 
715 
734 hipError_t hipStreamDestroy(hipStream_t stream);
735 
736 
752 hipError_t hipStreamQuery(hipStream_t stream);
753 
754 
774 hipError_t hipStreamSynchronize(hipStream_t stream);
775 
776 
796 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
797 
798 
812 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
813 
814 
828 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
829 
830 
834 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
835 
851 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
852  unsigned int flags);
853 
854 
855 // end doxygen Stream
892 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
893 
894 
906 hipError_t hipEventCreate(hipEvent_t* event);
907 
908 
936 #ifdef __cplusplus
937 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
938 #else
939 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
940 #endif
941 
958 hipError_t hipEventDestroy(hipEvent_t event);
959 
960 
978 hipError_t hipEventSynchronize(hipEvent_t event);
979 
980 
1009 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1010 
1011 
1027 hipError_t hipEventQuery(hipEvent_t event);
1028 
1029 
1030 // end doxygen Events
1061 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1062 
1076 hipError_t hipMalloc(void** ptr, size_t size);
1077 
1092 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1093 
1106 DEPRECATED("use hipHostMalloc instead")
1107 hipError_t hipMallocHost(void** ptr, size_t size);
1108 
1122 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1123 
1133 hipError_t hipMallocManaged(void** devPtr, size_t size, unsigned int flags __dparm(0));
1134 
1148 DEPRECATED("use hipHostMalloc instead")
1149 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1150 
1162 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1163 
1173 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1174 
1211 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1212 
1221 hipError_t hipHostUnregister(void* hostPtr);
1222 
1242 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1243 
1257 hipError_t hipFree(void* ptr);
1258 
1269 DEPRECATED("use hipHostFree instead")
1270 hipError_t hipFreeHost(void* ptr);
1271 
1285 hipError_t hipHostFree(void* ptr);
1286 
1314 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1315 
1333 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1334 
1352 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1353 
1371 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1372 
1390 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1391 
1409 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1410 
1428 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1429  hipStream_t stream);
1430 
1431 #if __HIP_VDI__
1432 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1433  hipModule_t hmod, const char* name);
1434 
1435 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName);
1436 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName);
1437 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1438  size_t sizeBytes, size_t offset __dparm(0),
1439  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1440 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1441  size_t sizeBytes, size_t offset,
1442  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1443 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1444  size_t sizeBytes, size_t offset __dparm(0),
1445  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1446 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1447  size_t sizeBytes, size_t offset,
1448  hipMemcpyKind kind,
1449  hipStream_t stream __dparm(0));
1450 #else
1451 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1452 
1453 namespace hip_impl {
1454 inline
1455 __attribute__((visibility("hidden")))
1456 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1457  const char* name);
1458 } // Namespace hip_impl.
1459 
1470 inline
1471 __attribute__((visibility("hidden")))
1472 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
1473  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
1474  hip_impl::hip_init();
1475  size_t size = 0;
1476  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
1477 }
1478 
1479 
1490 inline
1491 __attribute__((visibility("hidden")))
1492 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
1493  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
1494  hip_impl::hip_init();
1495  void* devPtr = nullptr;
1496  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
1497 }
1498 
1499 #if defined(__cplusplus)
1500 } // extern "C"
1501 #endif
1502 
1503 namespace hip_impl {
1504 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
1505  const char*);
1506 } // Namespace hip_impl.
1507 
1508 #if defined(__cplusplus)
1509 extern "C" {
1510 #endif
1511 
1535 inline
1536 __attribute__((visibility("hidden")))
1537 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
1538  size_t sizeBytes, size_t offset __dparm(0),
1539  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
1540  if (!symbolName) return hipErrorInvalidSymbol;
1541 
1542  hipDeviceptr_t dst = NULL;
1543  hipGetSymbolAddress(&dst, (const char*)symbolName);
1544 
1545  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
1546  (const char*)symbolName);
1547 }
1548 
1549 #if defined(__cplusplus)
1550 } // extern "C"
1551 #endif
1552 
1553 namespace hip_impl {
1554 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
1555  hipMemcpyKind, hipStream_t, const char*);
1556 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
1557  hipMemcpyKind, const char*);
1558 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
1559  hipMemcpyKind, hipStream_t, const char*);
1560 } // Namespace hip_impl.
1561 
1562 #if defined(__cplusplus)
1563 extern "C" {
1564 #endif
1565 
1591 inline
1592 __attribute__((visibility("hidden")))
1593 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
1594  size_t sizeBytes, size_t offset,
1595  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
1596  if (!symbolName) return hipErrorInvalidSymbol;
1597 
1598  hipDeviceptr_t dst = NULL;
1599  hipGetSymbolAddress(&dst, symbolName);
1600 
1601  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
1602  stream,
1603  (const char*)symbolName);
1604 }
1605 
1606 inline
1607 __attribute__((visibility("hidden")))
1608 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
1609  size_t sizeBytes, size_t offset __dparm(0),
1610  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
1611  if (!symbolName) return hipErrorInvalidSymbol;
1612 
1613  hipDeviceptr_t src = NULL;
1614  hipGetSymbolAddress(&src, symbolName);
1615 
1616  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
1617  (const char*)symbolName);
1618 }
1619 
1620 inline
1621 __attribute__((visibility("hidden")))
1622 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
1623  size_t sizeBytes, size_t offset,
1624  hipMemcpyKind kind,
1625  hipStream_t stream __dparm(0)) {
1626  if (!symbolName) return hipErrorInvalidSymbol;
1627 
1628  hipDeviceptr_t src = NULL;
1629  hipGetSymbolAddress(&src, symbolName);
1630 
1631  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
1632  stream,
1633  (const char*)symbolName);
1634 }
1635 
1636 #endif // __HIP_VDI__
1637 
1665 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
1666  hipStream_t stream __dparm(0));
1667 
1677 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
1678 
1688 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes);
1689 
1699 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
1700 
1716 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
1717 
1733 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
1734  hipStream_t stream __dparm(0));
1735 
1747 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
1748 
1761 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
1762 
1771 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
1772 
1782 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
1783 
1793 hipError_t hipMemGetInfo(size_t* free, size_t* total);
1794 
1795 
1796 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
1797 
1798 
1811 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
1812  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
1813 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
1814 
1815 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
1816 
1817 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
1818 
1827 hipError_t hipFreeArray(hipArray* array);
1828 
1841 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
1842  struct hipExtent extent, unsigned int flags);
1859 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
1860  size_t height, hipMemcpyKind kind);
1861 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
1862 
1880 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
1881  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
1882 
1899 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
1900  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
1901 
1918 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
1919  size_t count, hipMemcpyKind kind);
1920 
1936 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
1937  size_t count, hipMemcpyKind kind);
1938 
1952 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
1953 
1967 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
1968 
1979 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
1980 
1981 // doxygen end Memory
2013 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2014 
2015 
2032 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2033 
2034 
2046 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2047 
2060 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2061 
2062 #ifndef USE_PEER_NON_UNIFIED
2063 #define USE_PEER_NON_UNIFIED 1
2064 #endif
2065 
2066 #if USE_PEER_NON_UNIFIED == 1
2067 
2078 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2079  size_t sizeBytes);
2080 
2093 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2094  size_t sizeBytes, hipStream_t stream __dparm(0));
2095 #endif
2096 
2097 
2098 // doxygen end PeerToPeer
2117 // TODO-ctx - more description on error codes.
2118 hipError_t hipInit(unsigned int flags);
2119 
2120 
2140 DEPRECATED(DEPRECATED_MSG)
2141 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2142 
2153 DEPRECATED(DEPRECATED_MSG)
2154 hipError_t hipCtxDestroy(hipCtx_t ctx);
2155 
2166 DEPRECATED(DEPRECATED_MSG)
2167 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2168 
2179 DEPRECATED(DEPRECATED_MSG)
2180 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2181 
2192 DEPRECATED(DEPRECATED_MSG)
2193 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2194 
2205 DEPRECATED(DEPRECATED_MSG)
2206 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2207 
2219 DEPRECATED(DEPRECATED_MSG)
2220 hipError_t hipCtxGetDevice(hipDevice_t* device);
2221 
2239 DEPRECATED(DEPRECATED_MSG)
2240 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2241 
2255 DEPRECATED(DEPRECATED_MSG)
2256 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2257 
2271 DEPRECATED(DEPRECATED_MSG)
2272 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2273 
2287 DEPRECATED(DEPRECATED_MSG)
2288 hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config);
2289 
2303 DEPRECATED(DEPRECATED_MSG)
2304 hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig* pConfig);
2305 
2317 DEPRECATED(DEPRECATED_MSG)
2318 hipError_t hipCtxSynchronize(void);
2319 
2330 DEPRECATED(DEPRECATED_MSG)
2331 hipError_t hipCtxGetFlags(unsigned int* flags);
2332 
2352 DEPRECATED(DEPRECATED_MSG)
2353 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
2354 
2371 DEPRECATED(DEPRECATED_MSG)
2372 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
2373 
2386 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
2387 
2400 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
2401 
2413 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
2414 
2425 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
2426 
2438 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
2439 
2440 // doxygen end Context Management
2452 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
2453 
2462 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
2463 
2472 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
2473 
2482 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
2483 
2484 
2492 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
2493 
2494 
2502 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
2503 
2519 hipError_t hipDriverGetVersion(int* driverVersion);
2520 
2533 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
2534 
2546 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
2547 
2558 hipError_t hipModuleUnload(hipModule_t module);
2559 
2570 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
2571 
2581 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
2582 
2584 
2585  Agent_global() : name(nullptr), address(nullptr), byte_cnt(0) {}
2586  Agent_global(const char* name, hipDeviceptr_t address, uint32_t byte_cnt)
2587  : name(nullptr), address(address), byte_cnt(byte_cnt) {
2588  if (name)
2589  this->name = strdup(name);
2590  }
2591 
2592  Agent_global& operator=(Agent_global&& t) {
2593  if (this == &t) return *this;
2594 
2595  if (name) free(name);
2596  name = t.name;
2597  address = t.address;
2598  byte_cnt = t.byte_cnt;
2599 
2600  t.name = nullptr;
2601  t.address = nullptr;
2602  t.byte_cnt = 0;
2603 
2604  return *this;
2605  }
2606 
2607  Agent_global(Agent_global&& t)
2608  : name(nullptr), address(nullptr), byte_cnt(0) {
2609  *this = std::move(t);
2610  }
2611 
2612  // not needed, delete them to prevent bugs
2613  Agent_global(const Agent_global&) = delete;
2614  Agent_global& operator=(Agent_global& t) = delete;
2615 
2616  ~Agent_global() { if (name) free(name); }
2617 
2618  char* name;
2619  hipDeviceptr_t address;
2620  uint32_t byte_cnt;
2621 };
2622 
2623 #if !__HIP_VDI__
2624 #if defined(__cplusplus)
2625 } // extern "C"
2626 #endif
2627 
2628 namespace hip_impl {
2629 hsa_executable_t executable_for(hipModule_t);
2630 const char* hash_for(hipModule_t);
2631 
2632 template<typename ForwardIterator>
2633 std::pair<hipDeviceptr_t, std::size_t> read_global_description(
2634  ForwardIterator f, ForwardIterator l, const char* name) {
2635  const auto it = std::find_if(f, l, [=](const Agent_global& x) {
2636  return strcmp(x.name, name) == 0;
2637  });
2638 
2639  return it == l ?
2640  std::make_pair(nullptr, 0u) : std::make_pair(it->address, it->byte_cnt);
2641 }
2642 
2643 std::vector<Agent_global> read_agent_globals(hsa_agent_t agent,
2644  hsa_executable_t executable);
2645 hsa_agent_t this_agent();
2646 
2647 
2649 private:
2650  std::pair<
2651  std::mutex,
2652  std::unordered_map<
2653  std::string, std::vector<Agent_global>>> globals_from_module;
2654 
2655  std::unordered_map<
2656  hsa_agent_t,
2657  std::pair<
2658  std::once_flag,
2659  std::vector<Agent_global>>> globals_from_process;
2660 
2661 public:
2662 
2663  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
2664  hipModule_t hmod, const char* name) {
2665  // the key of the map would the hash of code object associated with the
2666  // hipModule_t instance
2667  std::string key(hash_for(hmod));
2668 
2669  if (globals_from_module.second.count(key) == 0) {
2670  std::lock_guard<std::mutex> lck{globals_from_module.first};
2671 
2672  if (globals_from_module.second.count(key) == 0) {
2673  globals_from_module.second.emplace(
2674  key, read_agent_globals(this_agent(), executable_for(hmod)));
2675  }
2676  }
2677 
2678  const auto it0 = globals_from_module.second.find(key);
2679  if (it0 == globals_from_module.second.cend()) {
2680  hip_throw(
2681  std::runtime_error{"agent_globals data structure corrupted."});
2682  }
2683 
2684  std::tie(*dptr, *bytes) = read_global_description(it0->second.cbegin(),
2685  it0->second.cend(), name);
2686 
2687  return *dptr ? hipSuccess : hipErrorNotFound;
2688  }
2689 
2690  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2691  const char* name) {
2692 
2693  auto agent = this_agent();
2694 
2695  std::call_once(globals_from_process[agent].first, [this](hsa_agent_t aa) {
2696  std::vector<Agent_global> tmp0;
2697  for (auto&& executable : hip_impl::get_program_state().executables(aa)) {
2698  auto tmp1 = read_agent_globals(aa, executable);
2699  tmp0.insert(tmp0.end(), make_move_iterator(tmp1.begin()),
2700  make_move_iterator(tmp1.end()));
2701  }
2702  globals_from_process[aa].second = move(move(tmp0));
2703  }, agent);
2704 
2705  const auto it = globals_from_process.find(agent);
2706 
2707  if (it == globals_from_process.cend()) return hipErrorNotInitialized;
2708 
2709  std::tie(*dptr, *bytes) = read_global_description(it->second.second.cbegin(),
2710  it->second.second.cend(), name);
2711 
2712  return *dptr ? hipSuccess : hipErrorNotFound;
2713  }
2714 
2715 };
2716 
2718 public:
2719  agent_globals() : impl(new agent_globals_impl()) {
2720  if (!impl)
2721  hip_throw(
2722  std::runtime_error{"Error when constructing agent global data structures."});
2723  }
2724  ~agent_globals() { delete impl; }
2725 
2726  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
2727  hipModule_t hmod, const char* name) {
2728  return impl->read_agent_global_from_module(dptr, bytes, hmod, name);
2729  }
2730 
2731  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2732  const char* name) {
2733  return impl->read_agent_global_from_process(dptr, bytes, name);
2734  }
2735 
2736 private:
2737  agent_globals_impl* impl;
2738 };
2739 
2740 inline
2741 __attribute__((visibility("hidden")))
2742 agent_globals& get_agent_globals() {
2743  static agent_globals ag;
2744  return ag;
2745 }
2746 
2747 
2748 extern "C"
2749 inline
2750 __attribute__((visibility("hidden")))
2751 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
2752  const char* name) {
2753  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
2754 }
2755 
2756 
2757 } // Namespace hip_impl.
2758 
2759 #if defined(__cplusplus)
2760 extern "C" {
2761 #endif
2762 
2773 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
2774  hipModule_t hmod, const char* name);
2775 #endif // __HIP_VDI__
2776 
2777 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
2778 
2788 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
2789 
2802 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
2803  hipJitOption* options, void** optionValues);
2804 
2829 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
2830  unsigned int gridDimZ, unsigned int blockDimX,
2831  unsigned int blockDimY, unsigned int blockDimZ,
2832  unsigned int sharedMemBytes, hipStream_t stream,
2833  void** kernelParams, void** extra);
2834 
2835 // doxygen end Version Management
2853 // TODO - expand descriptions:
2859 hipError_t hipProfilerStart();
2860 
2861 
2867 hipError_t hipProfilerStop();
2868 
2869 
2874 // TODO: implement IPC apis
2875 
2901 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
2902 
2939 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
2940 
2959 hipError_t hipIpcCloseMemHandle(void* devPtr);
2960 
2961 
2962 // hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
2963 // hipError_t hipIpcCloseMemHandle(void *devPtr);
2964 // // hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
2965 // hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
2966 
2967 
2988 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
2989 
2990 
3001 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3002 
3003 
3012 hipError_t hipLaunchByPtr(const void* func);
3013 
3014 
3015 
3021 #ifdef __cplusplus
3022 } /* extern "c" */
3023 #endif
3024 
3025 #ifdef __cplusplus
3026 #include <hip/hcc_detail/hip_prof_api.h>
3027 #endif
3028 
3029 #ifdef __cplusplus
3030 extern "C" {
3031 #endif
3032 
3035 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3036 hipError_t hipRemoveApiCallback(uint32_t id);
3037 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3038 hipError_t hipRemoveActivityCallback(uint32_t id);
3039 static inline const char* hipApiName(const uint32_t& id) { return hip_api_name(id); }
3040 const char* hipKernelNameRef(const hipFunction_t f);
3041 #ifdef __cplusplus
3042 } /* extern "C" */
3043 #endif
3044 
3045 #ifdef __cplusplus
3046 
3047 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3048  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3049 
3050 hipError_t ihipBindTextureImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3051  const void* devPtr, const struct hipChannelFormatDesc* desc,
3052  size_t size, textureReference* tex);
3053 
3054 /*
3055  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3056  *reference tex.
3057  *
3058  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3059  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3060  *memory previously bound to tex is unbound.
3061  *
3062  * @param[in] offset - Offset in bytes
3063  * @param[out] tex - texture to bind
3064  * @param[in] devPtr - Memory area on device
3065  * @param[in] desc - Channel format
3066  * @param[in] size - Size of the memory area pointed to by devPtr
3067  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3068  **/
3069 template <class T, int dim, enum hipTextureReadMode readMode>
3070 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3071  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
3072  return ihipBindTextureImpl(dim, readMode, offset, devPtr, &desc, size, &tex);
3073 }
3074 
3075 /*
3076  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3077  *reference tex.
3078  *
3079  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
3080  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
3081  *memory previously bound to tex is unbound.
3082  *
3083  * @param[in] offset - Offset in bytes
3084  * @param[in] tex - texture to bind
3085  * @param[in] devPtr - Memory area on device
3086  * @param[in] size - Size of the memory area pointed to by devPtr
3087  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
3088  **/
3089 template <class T, int dim, enum hipTextureReadMode readMode>
3090 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
3091  size_t size = UINT_MAX) {
3092  return ihipBindTextureImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
3093 }
3094 
3095 // C API
3096 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
3097  const hipChannelFormatDesc* desc, size_t width, size_t height,
3098  size_t pitch);
3099 
3100 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
3101  const void* devPtr, const struct hipChannelFormatDesc* desc,
3102  size_t width, size_t height, textureReference* tex);
3103 
3104 template <class T, int dim, enum hipTextureReadMode readMode>
3105 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3106  const void* devPtr, size_t width, size_t height, size_t pitch) {
3107  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
3108  &tex);
3109 }
3110 
3111 template <class T, int dim, enum hipTextureReadMode readMode>
3112 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
3113  const void* devPtr, const struct hipChannelFormatDesc& desc,
3114  size_t width, size_t height, size_t pitch) {
3115  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
3116 }
3117 
3118 // C API
3119 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
3120  const hipChannelFormatDesc* desc);
3121 
3122 hipError_t ihipBindTextureToArrayImpl(int dim, enum hipTextureReadMode readMode,
3123  hipArray_const_t array,
3124  const struct hipChannelFormatDesc& desc,
3125  textureReference* tex);
3126 
3127 template <class T, int dim, enum hipTextureReadMode readMode>
3128 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
3129  return ihipBindTextureToArrayImpl(dim, readMode, array, tex.channelDesc, &tex);
3130 }
3131 
3132 template <class T, int dim, enum hipTextureReadMode readMode>
3133 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
3134  const struct hipChannelFormatDesc& desc) {
3135  return ihipBindTextureToArrayImpl(dim, readMode, array, desc, &tex);
3136 }
3137 
3138 template <class T, int dim, enum hipTextureReadMode readMode>
3139 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
3140  hipArray_const_t array,
3141  const struct hipChannelFormatDesc* desc) {
3142  return ihipBindTextureToArrayImpl(dim, readMode, array, *desc, tex);
3143 }
3144 
3145 // C API
3146 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
3147  hipMipmappedArray_const_t mipmappedArray,
3148  const hipChannelFormatDesc* desc);
3149 
3150 template <class T, int dim, enum hipTextureReadMode readMode>
3151 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3152  hipMipmappedArray_const_t mipmappedArray) {
3153  return hipSuccess;
3154 }
3155 
3156 template <class T, int dim, enum hipTextureReadMode readMode>
3157 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
3158  hipMipmappedArray_const_t mipmappedArray,
3159  const hipChannelFormatDesc& desc) {
3160  return hipSuccess;
3161 }
3162 
3163 /*
3164  * @brief Unbinds the textuer bound to @p tex
3165  *
3166  * @param[in] tex - texture to unbind
3167  *
3168  * @return #hipSuccess
3169  **/
3170 hipError_t hipUnbindTexture(const textureReference* tex);
3171 
3172 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
3173 
3174 template <class T, int dim, enum hipTextureReadMode readMode>
3175 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
3176  return ihipUnbindTextureImpl(tex.textureObject);
3177 }
3178 
3179 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
3180 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
3181 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
3182 
3183 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
3184  const hipTextureDesc* pTexDesc,
3185  const hipResourceViewDesc* pResViewDesc);
3186 
3187 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3188 
3189 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
3190  hipTextureObject_t textureObject);
3191 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
3192  hipTextureObject_t textureObject);
3193 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
3194  hipTextureObject_t textureObject);
3195 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
3196 
3197 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
3198 
3199 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
3200 
3201 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
3202 
3203 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
3204 
3205 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
3206  size_t size);
3207 
3208 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
3209  hipDeviceptr_t devPtr, size_t pitch);
3210 
3211 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
3212 
3213 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
3214 
3215 // doxygen end Texture
3221 #endif
3222 
3223 
3241 // end-group HCC_Specific
3247 // doxygen end HIP API
3252 #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:1978
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:470
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:218
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:1832
hipError_t hipStreamGetPriority(hipStream_t stream, int *priority)
Query the priority of a stream.
Definition: hip_stream.cpp:234
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:88
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
Definition: hip_error.cpp:41
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
Definition: hip_context.cpp:324
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
Definition: hip_context.cpp:299
struct dim3 dim3
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
Definition: hip_device.cpp:369
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
Definition: hip_device.cpp:427
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
Definition: hip_memory.cpp:267
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
Definition: hip_memory.cpp:2041
TODO-doc.
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_memory.cpp:2011
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:1312
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:578
Definition: driver_types.h:232
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
Definition: hip_memory.cpp:457
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.
Definition: hip_runtime_api.h:2648
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:1659
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:254
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:1331
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:1368
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:191
hipError_t hipCtxPopCurrent(hipCtx_t *ctx)
Pop the current/default context and return the popped context.
Definition: hip_context.cpp:136
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:137
hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priority.
Definition: hip_stream.cpp:118
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:2013
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
Definition: hip_stream.cpp:109
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:167
Definition: driver_types.h:173
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
Definition: hip_memory.cpp:1157
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
Definition: hip_module.cpp:115
Definition: hip_module.cpp:90
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:257
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:184
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
Definition: hip_context.cpp:244
Definition: hip_runtime_api.h:2717
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:55
#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:236
hipError_t hipCtxSetCurrent(hipCtx_t ctx)
Set the passed context as current/default.
Definition: hip_context.cpp:181
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
Definition: hip_memory.cpp:2062
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:107
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
Definition: hip_memory.cpp:372
Definition: hip_hcc_internal.h:882
Definition: texture_types.h:73
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:559
Definition: driver_types.h:70
hipDeviceAttribute_t
Definition: hip_runtime_api.h:259
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
Definition: hip_event.cpp:155
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
Definition: hip_stream.cpp:95
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:453
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
Definition: hip_context.cpp:228
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:834
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
Definition: hip_module.cpp:564
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
Definition: hip_context.cpp:311
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
Definition: hip_event.cpp:97
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory [Deprecated].
Definition: hip_memory.cpp:396
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_memory.cpp:392
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
Definition: hip_event.cpp:200
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:177
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
Definition: hip_device.cpp:71
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:1748
Definition: driver_types.h:245
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
Definition: hip_stream.cpp:191
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
Definition: hip_memory.cpp:905
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
Definition: hip_stream.cpp:180
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:2098
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
Definition: hip_context.cpp:220
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
Definition: hip_memory.cpp:1195
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
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:252
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:170
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:817
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:1253
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:157
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
Definition: hip_memory.cpp:1176
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))
Copy data from src to dst asynchronously.
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
Definition: hip_device.cpp:381
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
Definition: hip_device.cpp:316
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:933
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:1764
Definition: driver_types.h:225
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:126
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
Definition: hip_stream.cpp:219
Defines surface types for HIP runtime.
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:1868
hipError_t hipCtxGetDevice(hipDevice_t *device)
Get the handle of the device associated with current/default context.
Definition: hip_context.cpp:194
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
Definition: hip_context.cpp:288
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:1927
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:210
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:42
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
Definition: hip_memory.cpp:1387
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
Definition: hip_context.cpp:100
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
Definition: hip_memory.cpp:1350
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
Definition: hip_clang.cpp:187
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:1245
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:73
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
Definition: hip_device.cpp:415
Definition: hip_runtime_api.h:2583
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_api.h:82
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:257
__attribute__((visibility("hidden"))) hipError_t hipGetSymbolAddress(void **devPtr
Copies the memory address of symbol symbolName to devPtr.
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:540
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
Definition: hip_context.cpp:112
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:702
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
Definition: hip_device.cpp:289
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:1238
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
Definition: hip_memory.cpp:1008
Definition: hip_hcc_internal.h:521
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:198
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
Definition: hip_stream.cpp:102
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
Definition: hip_memory.cpp:1130
hipError_t hipEventCreate(hipEvent_t *event)
Definition: hip_event.cpp:103
Definition: driver_types.h:82
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:266
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
Definition: hip_peer.cpp:212
Definition: driver_types.h:201
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:286
Definition: hip_hcc_internal.h:369
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:395
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:1260
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:157
hipError_t hipFuncGetAttributes(struct hipFuncAttributes *attr, const void *func)
Definition: hip_module.cpp:508
Definition: hip_runtime_api.h:260
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
Definition: hip_memory.cpp:2128
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:1800
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
Definition: hip_memory.cpp:161
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2421
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:1816
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
Definition: hip_hcc.cpp:2411
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
Definition: hip_clang.cpp:205
Definition: texture_types.h:93