HIP: Heterogenous-computing Interface for Portability
hip_runtime_api.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 //#pragma once
24 #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_HIP_RUNTIME_API_H
25 #define HIP_INCLUDE_HIP_HCC_DETAIL_HIP_RUNTIME_API_H
26 
31 #include <stdint.h>
32 #include <stddef.h>
33 
34 #ifndef GENERIC_GRID_LAUNCH
35 #define GENERIC_GRID_LAUNCH 1
36 #endif
37 
38 #ifndef __HIP_ROCclr__
39 #define __HIP_ROCclr__ 0
40 #endif
41 
43 #include <hip/hcc_detail/driver_types.h>
46 
47 #if !__HIP_ROCclr__ && defined(__cplusplus)
48 #include <hsa/hsa.h>
49 #include <hip/hcc_detail/program_state.hpp>
50 #endif
51 
52 #if defined(_MSC_VER)
53 #define DEPRECATED(msg) __declspec(deprecated(msg))
54 #else // !defined(_MSC_VER)
55 #define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
56 #endif // !defined(_MSC_VER)
57 
58 #define DEPRECATED_MSG "This API is marked as deprecated and may not be supported in future releases. For more details please refer https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_deprecated_api_list.md"
59 
60 #if defined(__HCC__) && (__hcc_workweek__ < 16155)
61 #error("This version of HIP requires a newer version of HCC.");
62 #endif
63 
64 #define HIP_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
65 #define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
66 #define HIP_LAUNCH_PARAM_END ((void*)0x03)
67 
68 #ifdef __cplusplus
69  #define __dparm(x) \
70  = x
71 #else
72  #define __dparm(x)
73 #endif
74 
75 #ifdef __GNUC__
76 #pragma GCC visibility push (default)
77 #endif
78 
79 #ifdef __cplusplus
80 
81 namespace hip_impl {
82 hipError_t hip_init();
83 } // namespace hip_impl
84 #endif
85 
86 // Structure definitions:
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
91 //---
92 // API-visible structures
93 typedef struct ihipCtx_t* hipCtx_t;
94 
95 // Note many APIs also use integer deviceIds as an alternative to the device pointer:
96 typedef int hipDevice_t;
97 
98 typedef enum hipDeviceP2PAttr {
99  hipDevP2PAttrPerformanceRank = 0,
100  hipDevP2PAttrAccessSupported,
101  hipDevP2PAttrNativeAtomicSupported,
102  hipDevP2PAttrHipArrayAccessSupported
103 } hipDeviceP2PAttr;
104 
105 typedef struct ihipStream_t* hipStream_t;
106 
107 #define hipIpcMemLazyEnablePeerAccess 0
108 
109 #define HIP_IPC_HANDLE_SIZE 64
110 
111 typedef struct hipIpcMemHandle_st {
112  char reserved[HIP_IPC_HANDLE_SIZE];
114 
115 #if __HIP_ROCclr__
116 // TODO: IPC event handle currently unsupported
117 struct ihipIpcEventHandle_t;
118 typedef struct ihipIpcEventHandle_t* hipIpcEventHandle_t;
119 #else
120 typedef struct hipIpcEventHandle_st {
121  char reserved[HIP_IPC_HANDLE_SIZE];
123 #endif
124 typedef struct ihipModule_t* hipModule_t;
125 
126 typedef struct ihipModuleSymbol_t* hipFunction_t;
127 
128 typedef struct hipFuncAttributes {
129  int binaryVersion;
130  int cacheModeCA;
131  size_t constSizeBytes;
132  size_t localSizeBytes;
133  int maxDynamicSharedSizeBytes;
134  int maxThreadsPerBlock;
135  int numRegs;
136  int preferredShmemCarveout;
137  int ptxVersion;
138  size_t sharedSizeBytes;
140 
141 typedef struct ihipEvent_t* hipEvent_t;
142 
143 enum hipLimit_t {
144  hipLimitMallocHeapSize = 0x02,
145 };
146 
151 #define hipStreamDefault \
153  0x00
154 #define hipStreamNonBlocking 0x01
155 
156 
158 #define hipEventDefault 0x0
159 #define hipEventBlockingSync \
160  0x1
161 #define hipEventDisableTiming \
162  0x2
163 #define hipEventInterprocess 0x4
164 #define hipEventReleaseToDevice \
165  0x40000000
166 #define hipEventReleaseToSystem \
169  0x80000000
170 
173 
175 #define hipHostMallocDefault 0x0
176 #define hipHostMallocPortable 0x1
177 #define hipHostMallocMapped \
178  0x2
179 #define hipHostMallocWriteCombined 0x4
181 #define hipHostMallocNumaUser \
182  0x20000000
183 
184 #define hipHostMallocCoherent \
185  0x40000000
186 #define hipHostMallocNonCoherent \
188  0x80000000
189 
191 #define hipMemAttachGlobal 0x01
192 #define hipMemAttachHost 0x02
193 #define hipMemAttachSingle 0x04
194 
196 #define hipDeviceMallocDefault 0x0
197 #define hipDeviceMallocFinegrained 0x1
198 
199 #define hipHostRegisterDefault 0x0
201 #define hipHostRegisterPortable 0x1
202 #define hipHostRegisterMapped \
203  0x2
204 #define hipHostRegisterIoMemory 0x4
206 #define hipExtHostRegisterCoarseGrained 0x8
207 
208 #define hipDeviceScheduleAuto 0x0
209 #define hipDeviceScheduleSpin \
210  0x1
211 #define hipDeviceScheduleYield \
213  0x2
214 #define hipDeviceScheduleBlockingSync 0x4
216 #define hipDeviceScheduleMask 0x7
217 
218 #define hipDeviceMapHost 0x8
219 #define hipDeviceLmemResizeToMax 0x16
220 
221 #define hipArrayDefault 0x00
222 #define hipArrayLayered 0x01
223 #define hipArraySurfaceLoadStore 0x02
224 #define hipArrayCubemap 0x04
225 #define hipArrayTextureGather 0x08
226 
227 #define hipOccupancyDefault 0x00
228 
229 #define hipCooperativeLaunchMultiDeviceNoPreSync 0x01
230 #define hipCooperativeLaunchMultiDeviceNoPostSync 0x02
231 
232 #define hipCpuDeviceId ((int)-1)
233 #define hipInvalidDeviceId ((int)-2)
234 
235 // Flags that can be used with hipExtLaunch Set of APIs
236 #define hipExtAnyOrderLaunch 0x01
237 
238 /*
239  * @brief HIP Memory Advise values
240  * @enum
241  * @ingroup Enumerations
242  */
243 typedef enum hipMemoryAdvise {
255 
256 /*
257  * @brief HIP range attributes
258  * @enum
259  * @ingroup Enumerations
260  */
261 typedef enum hipMemRangeAttribute {
269 
270 /*
271  * @brief hipJitOption
272  * @enum
273  * @ingroup Enumerations
274  */
275 typedef enum hipJitOption {
276  hipJitOptionMaxRegisters = 0,
277  hipJitOptionThreadsPerBlock,
278  hipJitOptionWallTime,
279  hipJitOptionInfoLogBuffer,
280  hipJitOptionInfoLogBufferSizeBytes,
281  hipJitOptionErrorLogBuffer,
282  hipJitOptionErrorLogBufferSizeBytes,
283  hipJitOptionOptimizationLevel,
284  hipJitOptionTargetFromContext,
285  hipJitOptionTarget,
286  hipJitOptionFallbackStrategy,
287  hipJitOptionGenerateDebugInfo,
288  hipJitOptionLogVerbose,
289  hipJitOptionGenerateLineInfo,
290  hipJitOptionCacheMode,
291  hipJitOptionSm3xOpt,
292  hipJitOptionFastCompile,
293  hipJitOptionNumOptions
294 } hipJitOption;
295 
299 typedef enum hipFuncAttribute {
300  hipFuncAttributeMaxDynamicSharedMemorySize = 8,
301  hipFuncAttributePreferredSharedMemoryCarveout = 9,
302  hipFuncAttributeMax
304 
308 typedef enum hipFuncCache_t {
314 
318 typedef enum hipSharedMemConfig {
325 
330 typedef struct dim3 {
331  uint32_t x;
332  uint32_t y;
333  uint32_t z;
334 #ifdef __cplusplus
335  __host__ __device__ dim3(uint32_t _x = 1, uint32_t _y = 1, uint32_t _z = 1) : x(_x), y(_y), z(_z){};
336 #endif
338 
339 typedef struct hipLaunchParams_t {
340  void* func;
343  void **args;
344  size_t sharedMem;
345  hipStream_t stream;
347 
348 #if __HIP_HAS_GET_PCH
349 
354  void __hipGetPCH(const char** pch, unsigned int*size);
355 #endif
356 
357 
358 // Doxygen end group GlobalDefs
362 //-------------------------------------------------------------------------------------------------
363 
364 
365 // The handle allows the async commands to use the stream even if the parent hipStream_t goes
366 // out-of-scope.
367 // typedef class ihipStream_t * hipStream_t;
368 
369 
370 /*
371  * Opaque structure allows the true event (pointed at by the handle) to remain "live" even if the
372  * surrounding hipEvent_t goes out-of-scope. This is handy for cases where the hipEvent_t goes
373  * out-of-scope but the true event is being written by some async queue or device */
374 // typedef struct hipEvent_t {
375 // struct ihipEvent_t *_handle;
376 //} hipEvent_t;
377 
378 
400 // TODO-ctx - more description on error codes.
401 hipError_t hipInit(unsigned int flags);
402 
418 hipError_t hipDriverGetVersion(int* driverVersion);
419 
432 hipError_t hipRuntimeGetVersion(int* runtimeVersion);
433 
434 
442 hipError_t hipDeviceGet(hipDevice_t* device, int ordinal);
443 
452 hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device);
453 
462 hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device);
463 
464 
474 hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr,
475  int srcDevice, int dstDevice);
476 
485 hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device);
486 
487 
495 hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId);
496 
497 
505 hipError_t hipDeviceTotalMem(size_t* bytes, hipDevice_t device);
506 
507 
508 // doxygen end initialization
529 hipError_t hipDeviceSynchronize(void);
530 
531 
543 hipError_t hipDeviceReset(void);
544 
545 
577 hipError_t hipSetDevice(int deviceId);
578 
579 
593 hipError_t hipGetDevice(int* deviceId);
594 
595 
608 hipError_t hipGetDeviceCount(int* count);
609 
619 hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int deviceId);
620 
634 hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId);
635 
636 
647 hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig);
648 
649 
660 hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig);
661 
672 hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit);
673 
674 
687 
695 hipError_t hipGetDeviceFlags(unsigned int* flags);
696 
709 
734 hipError_t hipSetDeviceFlags(unsigned flags);
735 
744 hipError_t hipChooseDevice(int* device, const hipDeviceProp_t* prop);
745 
758 hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount);
759 
760 
761 // TODO: implement IPC apis
762 
788 hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr);
789 
826 hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags);
827 
846 hipError_t hipIpcCloseMemHandle(void* devPtr);
847 
848 
849 hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event);
850 hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle);
851 
852 // end doxygen Device
877 hipError_t hipFuncSetAttribute(const void* func, hipFuncAttribute attr, int value);
878 
889 hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config);
890 
903 hipError_t hipFuncSetSharedMemConfig(const void* func, hipSharedMemConfig config);
904 
905 //doxygen end execution
929 hipError_t hipGetLastError(void);
930 
931 
942 hipError_t hipPeekAtLastError(void);
943 
944 
953 const char* hipGetErrorName(hipError_t hip_error);
954 
955 
966 const char* hipGetErrorString(hipError_t hipError);
967 
968 // end doxygen Error
1001 hipError_t hipStreamCreate(hipStream_t* stream);
1002 
1003 
1021 hipError_t hipStreamCreateWithFlags(hipStream_t* stream, unsigned int flags);
1022 
1023 
1042 hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags, int priority);
1043 
1044 
1059 hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
1060 
1061 
1080 hipError_t hipStreamDestroy(hipStream_t stream);
1081 
1082 
1098 hipError_t hipStreamQuery(hipStream_t stream);
1099 
1100 
1120 hipError_t hipStreamSynchronize(hipStream_t stream);
1121 
1122 
1142 hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags);
1143 
1144 
1158 hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags);
1159 
1160 
1174 hipError_t hipStreamGetPriority(hipStream_t stream, int* priority);
1175 
1176 
1196 hipError_t hipExtStreamCreateWithCUMask(hipStream_t* stream, uint32_t cuMaskSize, const uint32_t* cuMask);
1197 
1198 
1211 hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32_t* cuMask);
1212 
1216 typedef void (*hipStreamCallback_t)(hipStream_t stream, hipError_t status, void* userData);
1217 
1233 hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void* userData,
1234  unsigned int flags);
1235 
1236 
1237 // end doxygen Stream
1274 hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned flags);
1275 
1276 
1288 hipError_t hipEventCreate(hipEvent_t* event);
1289 
1290 
1318 #ifdef __cplusplus
1319 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream = NULL);
1320 #else
1321 hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream);
1322 #endif
1323 
1340 hipError_t hipEventDestroy(hipEvent_t event);
1341 
1342 
1360 hipError_t hipEventSynchronize(hipEvent_t event);
1361 
1362 
1391 hipError_t hipEventElapsedTime(float* ms, hipEvent_t start, hipEvent_t stop);
1392 
1393 
1409 hipError_t hipEventQuery(hipEvent_t event);
1410 
1411 
1412 // end doxygen Events
1442 hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr);
1443 
1457 hipError_t hipMalloc(void** ptr, size_t size);
1458 
1473 hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
1474 
1487 DEPRECATED("use hipHostMalloc instead")
1488 hipError_t hipMallocHost(void** ptr, size_t size);
1489 
1502 DEPRECATED("use hipHostMalloc instead")
1503 hipError_t hipMemAllocHost(void** ptr, size_t size);
1504 
1518 hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
1519 
1540 hipError_t hipMallocManaged(void** dev_ptr,
1541  size_t size,
1542  unsigned int flags __dparm(hipMemAttachGlobal));
1543 
1554 hipError_t hipMemPrefetchAsync(const void* dev_ptr,
1555  size_t count,
1556  int device,
1557  hipStream_t stream __dparm(0));
1558 
1569 hipError_t hipMemAdvise(const void* dev_ptr,
1570  size_t count,
1571  hipMemoryAdvise advice,
1572  int device);
1573 
1586 hipError_t hipMemRangeGetAttribute(void* data,
1587  size_t data_size,
1588  hipMemRangeAttribute attribute,
1589  const void* dev_ptr,
1590  size_t count);
1591 
1606 hipError_t hipMemRangeGetAttributes(void** data,
1607  size_t* data_sizes,
1608  hipMemRangeAttribute* attributes,
1609  size_t num_attributes,
1610  const void* dev_ptr,
1611  size_t count);
1612 
1625 hipError_t hipStreamAttachMemAsync(hipStream_t stream,
1626  hipDeviceptr_t* dev_ptr,
1627  size_t length __dparm(0),
1628  unsigned int flags __dparm(hipMemAttachSingle));
1629 
1630 // end doxygen Managed Memory
1648 DEPRECATED("use hipHostMalloc instead")
1649 hipError_t hipHostAlloc(void** ptr, size_t size, unsigned int flags);
1650 
1662 hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
1663 
1673 hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
1674 
1711 hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
1712 
1721 hipError_t hipHostUnregister(void* hostPtr);
1722 
1742 hipError_t hipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t height);
1743 
1766 hipError_t hipMemAllocPitch(hipDeviceptr_t* dptr, size_t* pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes);
1767 
1781 hipError_t hipFree(void* ptr);
1782 
1793 DEPRECATED("use hipHostFree instead")
1794 hipError_t hipFreeHost(void* ptr);
1795 
1809 hipError_t hipHostFree(void* ptr);
1810 
1840 hipError_t hipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind);
1841 
1842 // TODO: Add description
1843 hipError_t hipMemcpyWithStream(void* dst, const void* src, size_t sizeBytes,
1844  hipMemcpyKind kind, hipStream_t stream);
1862 hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void* src, size_t sizeBytes);
1863 
1881 hipError_t hipMemcpyDtoH(void* dst, hipDeviceptr_t src, size_t sizeBytes);
1882 
1900 hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes);
1901 
1919 hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void* src, size_t sizeBytes, hipStream_t stream);
1920 
1938 hipError_t hipMemcpyDtoHAsync(void* dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream);
1939 
1957 hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes,
1958  hipStream_t stream);
1959 
1960 #if __HIP_ROCclr__
1961 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
1962  hipModule_t hmod, const char* name);
1963 
1964 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol);
1965 hipError_t hipGetSymbolSize(size_t* size, const void* symbol);
1966 hipError_t hipMemcpyToSymbol(const void* symbol, const void* src,
1967  size_t sizeBytes, size_t offset __dparm(0),
1968  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice));
1969 hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src,
1970  size_t sizeBytes, size_t offset,
1971  hipMemcpyKind kind, hipStream_t stream __dparm(0));
1972 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbol,
1973  size_t sizeBytes, size_t offset __dparm(0),
1974  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost));
1975 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbol,
1976  size_t sizeBytes, size_t offset,
1977  hipMemcpyKind kind,
1978  hipStream_t stream __dparm(0));
1979 #else
1980 hipError_t hipModuleGetGlobal(void**, size_t*, hipModule_t, const char*);
1981 
1982 #ifdef __cplusplus //Start : Not supported in gcc
1983 namespace hip_impl {
1984 inline
1985 __attribute__((visibility("hidden")))
1986 hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
1987  const char* name);
1988 } // Namespace hip_impl.
1989 
1990 
2001 inline
2002 __attribute__((visibility("hidden")))
2003 hipError_t hipGetSymbolAddress(void** devPtr, const void* symbolName) {
2004  //HIP_INIT_API(hipGetSymbolAddress, devPtr, symbolName);
2005  hip_impl::hip_init();
2006  size_t size = 0;
2007  return hip_impl::read_agent_global_from_process(devPtr, &size, (const char*)symbolName);
2008 }
2009 
2010 
2021 inline
2022 __attribute__((visibility("hidden")))
2023 hipError_t hipGetSymbolSize(size_t* size, const void* symbolName) {
2024  // HIP_INIT_API(hipGetSymbolSize, size, symbolName);
2025  hip_impl::hip_init();
2026  void* devPtr = nullptr;
2027  return hip_impl::read_agent_global_from_process(&devPtr, size, (const char*)symbolName);
2028 }
2029 #endif // End : Not supported in gcc
2030 
2031 #if defined(__cplusplus)
2032 } // extern "C"
2033 #endif
2034 
2035 #ifdef __cplusplus
2036 namespace hip_impl {
2037 hipError_t hipMemcpyToSymbol(void*, const void*, size_t, size_t, hipMemcpyKind,
2038  const char*);
2039 } // Namespace hip_impl.
2040 #endif
2041 
2042 #if defined(__cplusplus)
2043 extern "C" {
2044 #endif
2045 
2069 #ifdef __cplusplus
2070 inline
2071 __attribute__((visibility("hidden")))
2072 hipError_t hipMemcpyToSymbol(const void* symbolName, const void* src,
2073  size_t sizeBytes, size_t offset __dparm(0),
2074  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
2075  if (!symbolName) return hipErrorInvalidSymbol;
2076 
2077  hipDeviceptr_t dst = NULL;
2078  hipGetSymbolAddress(&dst, (const char*)symbolName);
2079 
2080  return hip_impl::hipMemcpyToSymbol(dst, src, sizeBytes, offset, kind,
2081  (const char*)symbolName);
2082 }
2083 #endif
2084 
2085 #if defined(__cplusplus)
2086 } // extern "C"
2087 #endif
2088 
2089 #ifdef __cplusplus
2090 namespace hip_impl {
2091 hipError_t hipMemcpyToSymbolAsync(void*, const void*, size_t, size_t,
2092  hipMemcpyKind, hipStream_t, const char*);
2093 hipError_t hipMemcpyFromSymbol(void*, const void*, size_t, size_t,
2094  hipMemcpyKind, const char*);
2095 hipError_t hipMemcpyFromSymbolAsync(void*, const void*, size_t, size_t,
2096  hipMemcpyKind, hipStream_t, const char*);
2097 } // Namespace hip_impl.
2098 #endif
2099 
2100 #if defined(__cplusplus)
2101 extern "C" {
2102 #endif
2103 
2130 #ifdef __cplusplus //Start : Not supported in gcc
2131 inline
2132 __attribute__((visibility("hidden")))
2133 hipError_t hipMemcpyToSymbolAsync(const void* symbolName, const void* src,
2134  size_t sizeBytes, size_t offset,
2135  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
2136  if (!symbolName) return hipErrorInvalidSymbol;
2137 
2138  hipDeviceptr_t dst = NULL;
2139  hipGetSymbolAddress(&dst, symbolName);
2140 
2141  return hip_impl::hipMemcpyToSymbolAsync(dst, src, sizeBytes, offset, kind,
2142  stream,
2143  (const char*)symbolName);
2144 }
2145 
2146 inline
2147 __attribute__((visibility("hidden")))
2148 hipError_t hipMemcpyFromSymbol(void* dst, const void* symbolName,
2149  size_t sizeBytes, size_t offset __dparm(0),
2150  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
2151  if (!symbolName) return hipErrorInvalidSymbol;
2152 
2153  hipDeviceptr_t src = NULL;
2154  hipGetSymbolAddress(&src, symbolName);
2155 
2156  return hip_impl::hipMemcpyFromSymbol(dst, src, sizeBytes, offset, kind,
2157  (const char*)symbolName);
2158 }
2159 
2160 inline
2161 __attribute__((visibility("hidden")))
2162 hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbolName,
2163  size_t sizeBytes, size_t offset,
2164  hipMemcpyKind kind,
2165  hipStream_t stream __dparm(0)) {
2166  if (!symbolName) return hipErrorInvalidSymbol;
2167 
2168  hipDeviceptr_t src = NULL;
2169  hipGetSymbolAddress(&src, symbolName);
2170 
2171  return hip_impl::hipMemcpyFromSymbolAsync(dst, src, sizeBytes, offset, kind,
2172  stream,
2173  (const char*)symbolName);
2174 }
2175 #endif // End : Not supported in gcc
2176 
2177 #endif // __HIP_ROCclr__
2178 
2206 hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcpyKind kind,
2207  hipStream_t stream __dparm(0));
2208 
2218 hipError_t hipMemset(void* dst, int value, size_t sizeBytes);
2219 
2229 hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count);
2230 
2246 hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0));
2247 
2257 hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count);
2258 
2274 hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0));
2275 
2285 hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count);
2286 
2302 hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0));
2303 
2319 hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count,
2320  hipStream_t stream __dparm(0));
2321 
2333 hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
2334 
2347 hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
2348 
2357 hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent );
2358 
2368 hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0));
2369 
2379 hipError_t hipMemGetInfo(size_t* free, size_t* total);
2380 
2381 
2382 hipError_t hipMemPtrGetInfo(void* ptr, size_t* size);
2383 
2384 
2397 hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, size_t width,
2398  size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
2399 hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
2400 
2401 hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray);
2402 
2403 hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
2404 
2413 hipError_t hipFreeArray(hipArray* array);
2414 
2422 hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray);
2423 
2436 hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
2437  struct hipExtent extent, unsigned int flags);
2438 
2451  hipMipmappedArray_t *mipmappedArray,
2452  const struct hipChannelFormatDesc* desc,
2453  struct hipExtent extent,
2454  unsigned int numLevels,
2455  unsigned int flags __dparm(0));
2456 
2467  hipArray_t *levelArray,
2468  hipMipmappedArray_const_t mipmappedArray,
2469  unsigned int level);
2470 
2487 hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2488  size_t height, hipMemcpyKind kind);
2489 
2499 hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy);
2500 
2511 hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D* pCopy, hipStream_t stream __dparm(0));
2512 
2530 hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width,
2531  size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2532 
2550 hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2551  size_t spitch, size_t width, size_t height, hipMemcpyKind kind);
2552 
2568 DEPRECATED(DEPRECATED_MSG)
2569 hipError_t hipMemcpyToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
2570  size_t count, hipMemcpyKind kind);
2571 
2587 DEPRECATED(DEPRECATED_MSG)
2588 hipError_t hipMemcpyFromArray(void* dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset,
2589  size_t count, hipMemcpyKind kind);
2590 
2608 hipError_t hipMemcpy2DFromArray( void* dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind);
2609 
2628 hipError_t hipMemcpy2DFromArrayAsync( void* dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0));
2629 
2643 hipError_t hipMemcpyAtoH(void* dst, hipArray* srcArray, size_t srcOffset, size_t count);
2644 
2658 hipError_t hipMemcpyHtoA(hipArray* dstArray, size_t dstOffset, const void* srcHost, size_t count);
2659 
2670 hipError_t hipMemcpy3D(const struct hipMemcpy3DParms* p);
2671 
2683 hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms* p, hipStream_t stream __dparm(0));
2684 
2695 hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D* pCopy);
2696 
2708 hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D* pCopy, hipStream_t stream);
2709 
2710 // doxygen end Memory
2741 hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDeviceId);
2742 
2743 
2760 hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags);
2761 
2762 
2774 hipError_t hipDeviceDisablePeerAccess(int peerDeviceId);
2775 
2788 hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDeviceptr_t dptr);
2789 
2790 #ifndef USE_PEER_NON_UNIFIED
2791 #define USE_PEER_NON_UNIFIED 1
2792 #endif
2793 
2794 #if USE_PEER_NON_UNIFIED == 1
2795 
2806 hipError_t hipMemcpyPeer(void* dst, int dstDeviceId, const void* src, int srcDeviceId,
2807  size_t sizeBytes);
2808 
2821 hipError_t hipMemcpyPeerAsync(void* dst, int dstDeviceId, const void* src, int srcDevice,
2822  size_t sizeBytes, hipStream_t stream __dparm(0));
2823 #endif
2824 
2825 
2826 // doxygen end PeerToPeer
2860 DEPRECATED(DEPRECATED_MSG)
2861 hipError_t hipCtxCreate(hipCtx_t* ctx, unsigned int flags, hipDevice_t device);
2862 
2873 DEPRECATED(DEPRECATED_MSG)
2874 hipError_t hipCtxDestroy(hipCtx_t ctx);
2875 
2886 DEPRECATED(DEPRECATED_MSG)
2887 hipError_t hipCtxPopCurrent(hipCtx_t* ctx);
2888 
2899 DEPRECATED(DEPRECATED_MSG)
2900 hipError_t hipCtxPushCurrent(hipCtx_t ctx);
2901 
2912 DEPRECATED(DEPRECATED_MSG)
2913 hipError_t hipCtxSetCurrent(hipCtx_t ctx);
2914 
2925 DEPRECATED(DEPRECATED_MSG)
2926 hipError_t hipCtxGetCurrent(hipCtx_t* ctx);
2927 
2939 DEPRECATED(DEPRECATED_MSG)
2940 hipError_t hipCtxGetDevice(hipDevice_t* device);
2941 
2959 DEPRECATED(DEPRECATED_MSG)
2960 hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int* apiVersion);
2961 
2975 DEPRECATED(DEPRECATED_MSG)
2976 hipError_t hipCtxGetCacheConfig(hipFuncCache_t* cacheConfig);
2977 
2991 DEPRECATED(DEPRECATED_MSG)
2992 hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig);
2993 
3007 DEPRECATED(DEPRECATED_MSG)
3009 
3023 DEPRECATED(DEPRECATED_MSG)
3025 
3037 DEPRECATED(DEPRECATED_MSG)
3038 hipError_t hipCtxSynchronize(void);
3039 
3050 DEPRECATED(DEPRECATED_MSG)
3051 hipError_t hipCtxGetFlags(unsigned int* flags);
3052 
3072 DEPRECATED(DEPRECATED_MSG)
3073 hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags);
3074 
3091 DEPRECATED(DEPRECATED_MSG)
3092 hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx);
3093 
3094 // doxygen end Context deprecated
3111 hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int* flags, int* active);
3112 
3125 hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev);
3126 
3138 hipError_t hipDevicePrimaryCtxRetain(hipCtx_t* pctx, hipDevice_t dev);
3139 
3150 hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev);
3151 
3163 hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags);
3164 
3165 // doxygen end Context Management
3189 hipError_t hipModuleLoad(hipModule_t* module, const char* fname);
3190 
3201 hipError_t hipModuleUnload(hipModule_t module);
3202 
3213 hipError_t hipModuleGetFunction(hipFunction_t* function, hipModule_t module, const char* kname);
3214 
3224 hipError_t hipFuncGetAttributes(struct hipFuncAttributes* attr, const void* func);
3225 
3235 hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunction_t hfunc);
3236 
3237 #if !__HIP_ROCclr__
3238 #if defined(__cplusplus)
3239 } // extern "C"
3240 #endif
3241 
3242 #ifdef __cplusplus
3243 namespace hip_impl {
3244  class agent_globals_impl;
3245  class agent_globals {
3246  public:
3247  agent_globals();
3248  ~agent_globals();
3249  agent_globals(const agent_globals&) = delete;
3250 
3251  hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes,
3252  hipModule_t hmod, const char* name);
3253  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
3254  const char* name);
3255  private:
3256  agent_globals_impl* impl;
3257  };
3258 
3259  inline
3260  __attribute__((visibility("hidden")))
3261  agent_globals& get_agent_globals() {
3262  static agent_globals ag;
3263  return ag;
3264  }
3265 
3266  extern "C"
3267  inline
3268  __attribute__((visibility("hidden")))
3269  hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes,
3270  const char* name) {
3271  return get_agent_globals().read_agent_global_from_process(dptr, bytes, name);
3272  }
3273 } // Namespace hip_impl.
3274 #endif
3275 
3276 #if defined(__cplusplus)
3277 extern "C" {
3278 #endif
3279 
3290 hipError_t hipModuleGetGlobal(hipDeviceptr_t* dptr, size_t* bytes,
3291  hipModule_t hmod, const char* name);
3292 #endif // __HIP_ROCclr__
3293 
3303 hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name);
3304 
3314 hipError_t hipModuleLoadData(hipModule_t* module, const void* image);
3315 
3328 hipError_t hipModuleLoadDataEx(hipModule_t* module, const void* image, unsigned int numOptions,
3329  hipJitOption* options, void** optionValues);
3330 
3355 hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY,
3356  unsigned int gridDimZ, unsigned int blockDimX,
3357  unsigned int blockDimY, unsigned int blockDimZ,
3358  unsigned int sharedMemBytes, hipStream_t stream,
3359  void** kernelParams, void** extra);
3360 
3361 
3362 #if __HIP_ROCclr__ && !defined(__HCC__)
3363 
3378 hipError_t hipLaunchCooperativeKernel(const void* f, dim3 gridDim, dim3 blockDimX,
3379  void** kernelParams, unsigned int sharedMemBytes,
3380  hipStream_t stream);
3381 
3392 hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
3393  int numDevices, unsigned int flags);
3394 
3395 #endif
3396 
3409  int numDevices, unsigned int flags);
3410 
3411 
3412 // doxygen end Module
3437 //TODO - Match CUoccupancyB2DSize
3438 hipError_t hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3439  hipFunction_t f, size_t dynSharedMemPerBlk,
3440  int blockSizeLimit);
3441 
3454 //TODO - Match CUoccupancyB2DSize
3455 hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3456  hipFunction_t f, size_t dynSharedMemPerBlk,
3457  int blockSizeLimit, unsigned int flags);
3458 
3468  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk);
3469 
3480  int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags);
3481 
3491  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk);
3492 
3503  int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
3504 
3516 hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3517  const void* f, size_t dynSharedMemPerBlk,
3518  int blockSizeLimit);
3519 
3520 // doxygen end Occupancy
3538 // TODO - expand descriptions:
3544 DEPRECATED("use roctracer/rocTX instead")
3545 hipError_t hipProfilerStart();
3546 
3547 
3553 DEPRECATED("use roctracer/rocTX instead")
3554 hipError_t hipProfilerStop();
3555 
3556 // doxygen end profiler
3582 hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0));
3583 
3584 
3595 hipError_t hipSetupArgument(const void* arg, size_t size, size_t offset);
3596 
3597 
3606 hipError_t hipLaunchByPtr(const void* func);
3607 
3608 
3624  dim3 blockDim,
3625  size_t sharedMem __dparm(0),
3626  hipStream_t stream __dparm(0));
3627 
3641 hipError_t __hipPopCallConfiguration(dim3 *gridDim,
3642  dim3 *blockDim,
3643  size_t *sharedMem,
3644  hipStream_t *stream);
3645 
3661 hipError_t hipLaunchKernel(const void* function_address,
3662  dim3 numBlocks,
3663  dim3 dimBlocks,
3664  void** args,
3665  size_t sharedMemBytes __dparm(0),
3666  hipStream_t stream __dparm(0));
3667 
3668 #if __HIP_ROCclr__ || !defined(__HCC__)
3669 //TODO: Move this to hip_ext.h
3670 hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks, dim3 dimBlocks,
3671  void** args, size_t sharedMemBytes, hipStream_t stream,
3672  hipEvent_t startEvent, hipEvent_t stopEvent, int flags);
3673 // doxygen end Clang launch
3678 DEPRECATED(DEPRECATED_MSG)
3679 hipError_t hipBindTexture(
3680  size_t* offset,
3681  const textureReference* tex,
3682  const void* devPtr,
3683  const hipChannelFormatDesc* desc,
3684  size_t size __dparm(UINT_MAX));
3685 
3686 DEPRECATED(DEPRECATED_MSG)
3687 hipError_t hipBindTexture2D(
3688  size_t* offset,
3689  const textureReference* tex,
3690  const void* devPtr,
3691  const hipChannelFormatDesc* desc,
3692  size_t width,
3693  size_t height,
3694  size_t pitch);
3695 
3696 DEPRECATED(DEPRECATED_MSG)
3697 hipError_t hipBindTextureToArray(
3698  const textureReference* tex,
3699  hipArray_const_t array,
3700  const hipChannelFormatDesc* desc);
3701 
3702 hipError_t hipBindTextureToMipmappedArray(
3703  const textureReference* tex,
3704  hipMipmappedArray_const_t mipmappedArray,
3705  const hipChannelFormatDesc* desc);
3706 
3707 DEPRECATED(DEPRECATED_MSG)
3708 hipError_t hipGetTextureAlignmentOffset(
3709  size_t* offset,
3710  const textureReference* texref);
3711 
3712 hipError_t hipGetTextureReference(
3713  const textureReference** texref,
3714  const void* symbol);
3715 
3716 DEPRECATED(DEPRECATED_MSG)
3717 hipError_t hipUnbindTexture(const textureReference* tex);
3718 
3719 hipError_t hipCreateTextureObject(
3720  hipTextureObject_t* pTexObject,
3721  const hipResourceDesc* pResDesc,
3722  const hipTextureDesc* pTexDesc,
3723  const struct hipResourceViewDesc* pResViewDesc);
3724 
3725 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
3726 
3727 hipError_t hipGetChannelDesc(
3728  hipChannelFormatDesc* desc,
3729  hipArray_const_t array);
3730 
3731 hipError_t hipGetTextureObjectResourceDesc(
3732  hipResourceDesc* pResDesc,
3733  hipTextureObject_t textureObject);
3734 
3735 hipError_t hipGetTextureObjectResourceViewDesc(
3736  struct hipResourceViewDesc* pResViewDesc,
3737  hipTextureObject_t textureObject);
3738 
3739 hipError_t hipGetTextureObjectTextureDesc(
3740  hipTextureDesc* pTexDesc,
3741  hipTextureObject_t textureObject);
3742 
3743 hipError_t hipTexRefGetAddress(
3744  hipDeviceptr_t* dev_ptr,
3745  const textureReference* texRef);
3746 
3747 hipError_t hipTexRefGetAddressMode(
3748  enum hipTextureAddressMode* pam,
3749  const textureReference* texRef,
3750  int dim);
3751 
3752 hipError_t hipTexRefGetFilterMode(
3753  enum hipTextureFilterMode* pfm,
3754  const textureReference* texRef);
3755 
3756 hipError_t hipTexRefGetFlags(
3757  unsigned int* pFlags,
3758  const textureReference* texRef);
3759 
3760 hipError_t hipTexRefGetFormat(
3761  hipArray_Format* pFormat,
3762  int* pNumChannels,
3763  const textureReference* texRef);
3764 
3765 hipError_t hipTexRefGetMaxAnisotropy(
3766  int* pmaxAnsio,
3767  const textureReference* texRef);
3768 
3769 hipError_t hipTexRefGetMipmapFilterMode(
3770  enum hipTextureFilterMode* pfm,
3771  const textureReference* texRef);
3772 
3773 hipError_t hipTexRefGetMipmapLevelBias(
3774  float* pbias,
3775  const textureReference* texRef);
3776 
3777 hipError_t hipTexRefGetMipmapLevelClamp(
3778  float* pminMipmapLevelClamp,
3779  float* pmaxMipmapLevelClamp,
3780  const textureReference* texRef);
3781 
3782 hipError_t hipTexRefGetMipMappedArray(
3783  hipMipmappedArray_t* pArray,
3784  const textureReference* texRef);
3785 
3786 hipError_t hipTexRefSetAddress(
3787  size_t* ByteOffset,
3788  textureReference* texRef,
3789  hipDeviceptr_t dptr,
3790  size_t bytes);
3791 
3792 hipError_t hipTexRefSetAddress2D(
3793  textureReference* texRef,
3794  const HIP_ARRAY_DESCRIPTOR* desc,
3795  hipDeviceptr_t dptr,
3796  size_t Pitch);
3797 
3798 hipError_t hipTexRefSetAddressMode(
3799  textureReference* texRef,
3800  int dim,
3801  enum hipTextureAddressMode am);
3802 
3803 hipError_t hipTexRefSetArray(
3804  textureReference* tex,
3805  hipArray_const_t array,
3806  unsigned int flags);
3807 
3808 hipError_t hipTexRefSetBorderColor(
3809  textureReference* texRef,
3810  float* pBorderColor);
3811 
3812 hipError_t hipTexRefSetFilterMode(
3813  textureReference* texRef,
3814  enum hipTextureFilterMode fm);
3815 
3816 hipError_t hipTexRefSetFlags(
3817  textureReference* texRef,
3818  unsigned int Flags);
3819 
3820 hipError_t hipTexRefSetFormat(
3821  textureReference* texRef,
3822  hipArray_Format fmt,
3823  int NumPackedComponents);
3824 
3825 hipError_t hipTexRefSetMaxAnisotropy(
3826  textureReference* texRef,
3827  unsigned int maxAniso);
3828 
3829 hipError_t hipTexRefSetMipmapFilterMode(
3830  textureReference* texRef,
3831  enum hipTextureFilterMode fm);
3832 
3833 hipError_t hipTexRefSetMipmapLevelBias(
3834  textureReference* texRef,
3835  float bias);
3836 
3837 hipError_t hipTexRefSetMipmapLevelClamp(
3838  textureReference* texRef,
3839  float minMipMapLevelClamp,
3840  float maxMipMapLevelClamp);
3841 
3842 hipError_t hipTexRefSetMipmappedArray(
3843  textureReference* texRef,
3844  struct hipMipmappedArray* mipmappedArray,
3845  unsigned int Flags);
3846 
3847 hipError_t hipMipmappedArrayCreate(
3848  hipMipmappedArray_t* pHandle,
3849  HIP_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc,
3850  unsigned int numMipmapLevels);
3851 
3852 hipError_t hipMipmappedArrayDestroy(
3853  hipMipmappedArray_t hMipmappedArray);
3854 
3855 hipError_t hipMipmappedArrayGetLevel(
3856  hipArray_t* pLevelArray,
3857  hipMipmappedArray_t hMipMappedArray,
3858  unsigned int level);
3859 
3860 hipError_t hipTexObjectCreate(
3861  hipTextureObject_t* pTexObject,
3862  const HIP_RESOURCE_DESC* pResDesc,
3863  const HIP_TEXTURE_DESC* pTexDesc,
3864  const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
3865 
3866 hipError_t hipTexObjectDestroy(
3867  hipTextureObject_t texObject);
3868 
3869 hipError_t hipTexObjectGetResourceDesc(
3870  HIP_RESOURCE_DESC* pResDesc,
3871  hipTextureObject_t texObject);
3872 
3873 hipError_t hipTexObjectGetResourceViewDesc(
3874  HIP_RESOURCE_VIEW_DESC* pResViewDesc,
3875  hipTextureObject_t texObject);
3876 
3877 hipError_t hipTexObjectGetTextureDesc(
3878  HIP_TEXTURE_DESC* pTexDesc,
3879  hipTextureObject_t texObject);
3880 #endif
3881 
3887 #ifdef __cplusplus
3888 } /* extern "c" */
3889 #endif
3890 
3891 #if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3892 template <typename T>
3893 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
3894  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0) {
3895  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3896 }
3897 
3898 template <typename T>
3899 static hipError_t __host__ inline hipOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
3900  T f, size_t dynSharedMemPerBlk = 0, int blockSizeLimit = 0, unsigned int flags = 0 ) {
3901  return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, reinterpret_cast<const void*>(f),dynSharedMemPerBlk,blockSizeLimit);
3902 }
3903 #endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
3904 
3905 #if defined(__cplusplus) && !defined(__HCC__)
3906 
3907 template <typename T>
3908 hipError_t hipGetSymbolAddress(void** devPtr, const T &symbol) {
3909  return ::hipGetSymbolAddress(devPtr, (const void *)&symbol);
3910 }
3911 
3912 template <typename T>
3913 hipError_t hipGetSymbolSize(size_t* size, const T &symbol) {
3914  return ::hipGetSymbolSize(size, (const void *)&symbol);
3915 }
3916 
3917 template <typename T>
3918 hipError_t hipMemcpyToSymbol(const T& symbol, const void* src, size_t sizeBytes,
3919  size_t offset __dparm(0),
3920  hipMemcpyKind kind __dparm(hipMemcpyHostToDevice)) {
3921  return ::hipMemcpyToSymbol((const void*)&symbol, src, sizeBytes, offset, kind);
3922 }
3923 
3924 template <typename T>
3925 hipError_t hipMemcpyToSymbolAsync(const T& symbol, const void* src, size_t sizeBytes, size_t offset,
3926  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3927  return ::hipMemcpyToSymbolAsync((const void*)&symbol, src, sizeBytes, offset, kind, stream);
3928 }
3929 
3930 template <typename T>
3931 hipError_t hipMemcpyFromSymbol(void* dst, const T &symbol,
3932  size_t sizeBytes, size_t offset __dparm(0),
3933  hipMemcpyKind kind __dparm(hipMemcpyDeviceToHost)) {
3934  return ::hipMemcpyFromSymbol(dst, (const void*)&symbol, sizeBytes, offset, kind);
3935 }
3936 
3937 template <typename T>
3938 hipError_t hipMemcpyFromSymbolAsync(void* dst, const T& symbol, size_t sizeBytes, size_t offset,
3939  hipMemcpyKind kind, hipStream_t stream __dparm(0)) {
3940  return ::hipMemcpyFromSymbolAsync(dst, (const void*)&symbol, sizeBytes, offset, kind, stream);
3941 }
3942 
3943 #endif
3944 
3945 #if USE_PROF_API
3946 #include <hip/hcc_detail/hip_prof_str.h>
3947 #endif
3948 
3949 #ifdef __cplusplus
3950 extern "C" {
3951 #endif
3952 
3955 hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg);
3956 hipError_t hipRemoveApiCallback(uint32_t id);
3957 hipError_t hipRegisterActivityCallback(uint32_t id, void* fun, void* arg);
3958 hipError_t hipRemoveActivityCallback(uint32_t id);
3959 const char* hipApiName(uint32_t id);
3960 const char* hipKernelNameRef(const hipFunction_t f);
3961 const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream);
3962 int hipGetStreamDeviceId(hipStream_t stream);
3963 #ifdef __cplusplus
3964 } /* extern "C" */
3965 #endif
3966 
3967 #ifdef __cplusplus
3968 
3969 template <class T>
3971  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk) {
3973  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk);
3974 }
3975 
3976 template <class T>
3978  int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
3980  numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk, flags);
3981 }
3982 
3983 class TlsData;
3984 
3985 #if !__HIP_ROCclr__
3986 DEPRECATED(DEPRECATED_MSG)
3987 hipError_t hipBindTexture(size_t* offset, textureReference* tex, const void* devPtr,
3988  const hipChannelFormatDesc* desc, size_t size = UINT_MAX);
3989 #endif
3990 
3991 #if !__HIP_ROCclr__
3992 hipError_t ihipBindTextureImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode, size_t* offset,
3993  const void* devPtr, const struct hipChannelFormatDesc* desc,
3994  size_t size, textureReference* tex);
3995 #endif
3996 
3997 /*
3998  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
3999  *reference tex.
4000  *
4001  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
4002  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
4003  *memory previously bound to tex is unbound.
4004  *
4005  * @param[in] offset - Offset in bytes
4006  * @param[out] tex - texture to bind
4007  * @param[in] devPtr - Memory area on device
4008  * @param[in] desc - Channel format
4009  * @param[in] size - Size of the memory area pointed to by devPtr
4010  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
4011  **/
4012 #if !__HIP_ROCclr__
4013 template <class T, int dim, enum hipTextureReadMode readMode>
4014 DEPRECATED(DEPRECATED_MSG)
4015 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
4016  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
4017  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &desc, size, &tex);
4018 }
4019 #endif
4020 
4021 /*
4022  * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture
4023  *reference tex.
4024  *
4025  * @p desc describes how the memory is interpreted when fetching values from the texture. The @p
4026  *offset parameter is an optional byte offset as with the low-level hipBindTexture() function. Any
4027  *memory previously bound to tex is unbound.
4028  *
4029  * @param[in] offset - Offset in bytes
4030  * @param[in] tex - texture to bind
4031  * @param[in] devPtr - Memory area on device
4032  * @param[in] size - Size of the memory area pointed to by devPtr
4033  * @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree, #hipErrorUnknown
4034  **/
4035 #if !__HIP_ROCclr__
4036 template <class T, int dim, enum hipTextureReadMode readMode>
4037 DEPRECATED(DEPRECATED_MSG)
4038 hipError_t hipBindTexture(size_t* offset, struct texture<T, dim, readMode>& tex, const void* devPtr,
4039  size_t size = UINT_MAX) {
4040  return ihipBindTextureImpl(nullptr, dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex);
4041 }
4042 #endif
4043 
4044 // C API
4045 #if !__HIP_ROCclr__
4046 DEPRECATED(DEPRECATED_MSG)
4047 hipError_t hipBindTexture2D(size_t* offset, textureReference* tex, const void* devPtr,
4048  const hipChannelFormatDesc* desc, size_t width, size_t height,
4049  size_t pitch);
4050 #endif
4051 
4052 #if !__HIP_ROCclr__
4053 hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t* offset,
4054  const void* devPtr, const struct hipChannelFormatDesc* desc,
4055  size_t width, size_t height, textureReference* tex, size_t pitch);
4056 #endif
4057 
4058 #if !__HIP_ROCclr__
4059 template <class T, int dim, enum hipTextureReadMode readMode>
4060 DEPRECATED(DEPRECATED_MSG)
4061 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
4062  const void* devPtr, size_t width, size_t height, size_t pitch) {
4063  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height,
4064  &tex);
4065 }
4066 #endif
4067 
4068 #if !__HIP_ROCclr__
4069 template <class T, int dim, enum hipTextureReadMode readMode>
4070 DEPRECATED(DEPRECATED_MSG)
4071 hipError_t hipBindTexture2D(size_t* offset, struct texture<T, dim, readMode>& tex,
4072  const void* devPtr, const struct hipChannelFormatDesc& desc,
4073  size_t width, size_t height, size_t pitch) {
4074  return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex);
4075 }
4076 #endif
4077 
4078 // C API
4079 #if !__HIP_ROCclr__
4080 DEPRECATED(DEPRECATED_MSG)
4081 hipError_t hipBindTextureToArray(textureReference* tex, hipArray_const_t array,
4082  const hipChannelFormatDesc* desc);
4083 #endif
4084 
4085 #if !__HIP_ROCclr__
4086 hipError_t ihipBindTextureToArrayImpl(TlsData *tls, int dim, enum hipTextureReadMode readMode,
4087  hipArray_const_t array,
4088  const struct hipChannelFormatDesc& desc,
4089  textureReference* tex);
4090 #endif
4091 
4092 #if !__HIP_ROCclr__
4093 template <class T, int dim, enum hipTextureReadMode readMode>
4094 DEPRECATED(DEPRECATED_MSG)
4095 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
4096  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, tex.channelDesc, &tex);
4097 }
4098 #endif
4099 
4100 #if !__HIP_ROCclr__
4101 template <class T, int dim, enum hipTextureReadMode readMode>
4102 DEPRECATED(DEPRECATED_MSG)
4103 hipError_t hipBindTextureToArray(struct texture<T, dim, readMode>& tex, hipArray_const_t array,
4104  const struct hipChannelFormatDesc& desc) {
4105  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, desc, &tex);
4106 }
4107 #endif
4108 
4109 #if !__HIP_ROCclr__
4110 template <class T, int dim, enum hipTextureReadMode readMode>
4111 DEPRECATED(DEPRECATED_MSG)
4112 inline static hipError_t hipBindTextureToArray(struct texture<T, dim, readMode> *tex,
4113  hipArray_const_t array,
4114  const struct hipChannelFormatDesc* desc) {
4115  return ihipBindTextureToArrayImpl(nullptr, dim, readMode, array, *desc, tex);
4116 }
4117 #endif
4118 
4119 // C API
4120 #if !__HIP_ROCclr__
4121 hipError_t hipBindTextureToMipmappedArray(const textureReference* tex,
4122  hipMipmappedArray_const_t mipmappedArray,
4123  const hipChannelFormatDesc* desc);
4124 #endif
4125 
4126 #if !__HIP_ROCclr__
4127 template <class T, int dim, enum hipTextureReadMode readMode>
4128 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
4129  hipMipmappedArray_const_t mipmappedArray) {
4130  return hipSuccess;
4131 }
4132 #endif
4133 
4134 #if !__HIP_ROCclr__
4135 template <class T, int dim, enum hipTextureReadMode readMode>
4136 hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
4137  hipMipmappedArray_const_t mipmappedArray,
4138  const hipChannelFormatDesc& desc) {
4139  return hipSuccess;
4140 }
4141 #endif
4142 
4143 #if __HIP_ROCclr__ && !defined(__HCC__)
4144 
4145 template <typename F>
4146 inline hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
4147  F kernel, size_t dynSharedMemPerBlk, uint32_t blockSizeLimit) {
4148 return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize,(hipFunction_t)kernel, dynSharedMemPerBlk, blockSizeLimit);
4149 }
4150 
4151 template <class T>
4152 inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
4153  void** kernelParams, unsigned int sharedMemBytes, hipStream_t stream) {
4154  return hipLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim,
4155  blockDim, kernelParams, sharedMemBytes, stream);
4156 }
4157 
4158 template <class T>
4159 inline hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsList,
4160  unsigned int numDevices, unsigned int flags = 0) {
4161  return hipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags);
4162 }
4163 
4164 
4165 template <class T>
4166 inline hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
4167  unsigned int numDevices, unsigned int flags = 0) {
4168  return hipExtLaunchMultiKernelMultiDevice(launchParamsList, numDevices, flags);
4169 }
4170 
4171 #endif
4172 
4173 /*
4174  * @brief Unbinds the textuer bound to @p tex
4175  *
4176  * @param[in] tex - texture to unbind
4177  *
4178  * @return #hipSuccess
4179  **/
4180 #if !__HIP_ROCclr__
4181 DEPRECATED(DEPRECATED_MSG)
4182 hipError_t hipUnbindTexture(const textureReference* tex);
4183 #endif
4184 
4185 #if !__HIP_ROCclr__
4186 extern hipError_t ihipUnbindTextureImpl(const hipTextureObject_t& textureObject);
4187 #endif
4188 
4189 #if !__HIP_ROCclr__
4190 template <class T, int dim, enum hipTextureReadMode readMode>
4191 DEPRECATED(DEPRECATED_MSG)
4192 hipError_t hipUnbindTexture(struct texture<T, dim, readMode>& tex) {
4193  return ihipUnbindTextureImpl(tex.textureObject);
4194 }
4195 #endif
4196 
4197 #if !__HIP_ROCclr__
4198 hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array);
4199 
4200 DEPRECATED(DEPRECATED_MSG)
4201 hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* texref);
4202 
4203 hipError_t hipGetTextureReference(const textureReference** texref, const void* symbol);
4204 
4205 hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResourceDesc* pResDesc,
4206  const hipTextureDesc* pTexDesc,
4207  const hipResourceViewDesc* pResViewDesc);
4208 
4209 hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject);
4210 
4211 hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc,
4212  hipTextureObject_t textureObject);
4213 hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc,
4214  hipTextureObject_t textureObject);
4215 hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc,
4216  hipTextureObject_t textureObject);
4217 hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsigned int flags);
4218 
4219 hipError_t hipTexRefGetArray(hipArray_t* array, textureReference tex);
4220 
4221 hipError_t hipTexRefSetAddressMode(textureReference* tex, int dim, hipTextureAddressMode am);
4222 
4223 hipError_t hipTexRefGetAddressMode(hipTextureAddressMode* am, textureReference tex, int dim);
4224 
4225 hipError_t hipTexRefSetFilterMode(textureReference* tex, hipTextureFilterMode fm);
4226 
4227 hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags);
4228 
4229 hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int NumPackedComponents);
4230 
4231 hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDeviceptr_t devPtr,
4232  size_t size);
4233 
4234 hipError_t hipTexRefGetAddress(hipDeviceptr_t* dev_ptr, textureReference tex);
4235 
4236 hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc,
4237  hipDeviceptr_t devPtr, size_t pitch);
4238 #endif
4239 
4240 hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject, const hipResourceDesc* pResDesc);
4241 
4242 hipError_t hipDestroySurfaceObject(hipSurfaceObject_t surfaceObject);
4243 
4244 #if __HIP_ROCclr__
4245 template <class T, int dim, enum hipTextureReadMode readMode>
4246 DEPRECATED(DEPRECATED_MSG)
4247 static inline hipError_t hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex,
4248  const void* devPtr, size_t size = UINT_MAX) {
4249  return hipBindTexture(offset, &tex, devPtr, &tex.channelDesc, size);
4250 }
4251 
4252 template <class T, int dim, enum hipTextureReadMode readMode>
4253 DEPRECATED(DEPRECATED_MSG)
4254 static inline hipError_t
4255  hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex, const void* devPtr,
4256  const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) {
4257  return hipBindTexture(offset, &tex, devPtr, &desc, size);
4258 }
4259 
4260 template<class T, int dim, enum hipTextureReadMode readMode>
4261 DEPRECATED(DEPRECATED_MSG)
4262 static inline hipError_t hipBindTexture2D(
4263  size_t *offset,
4264  const struct texture<T, dim, readMode> &tex,
4265  const void *devPtr,
4266  size_t width,
4267  size_t height,
4268  size_t pitch)
4269 {
4270  return hipBindTexture2D(offset, &tex, devPtr, &tex.channelDesc, width, height, pitch);
4271 }
4272 
4273 template<class T, int dim, enum hipTextureReadMode readMode>
4274 DEPRECATED(DEPRECATED_MSG)
4275 static inline hipError_t hipBindTexture2D(
4276  size_t *offset,
4277  const struct texture<T, dim, readMode> &tex,
4278  const void *devPtr,
4279  const struct hipChannelFormatDesc &desc,
4280  size_t width,
4281  size_t height,
4282  size_t pitch)
4283 {
4284  return hipBindTexture2D(offset, &tex, devPtr, &desc, width, height, pitch);
4285 }
4286 
4287 template<class T, int dim, enum hipTextureReadMode readMode>
4288 DEPRECATED(DEPRECATED_MSG)
4289 static inline hipError_t hipBindTextureToArray(
4290  const struct texture<T, dim, readMode> &tex,
4291  hipArray_const_t array)
4292 {
4293  struct hipChannelFormatDesc desc;
4294  hipError_t err = hipGetChannelDesc(&desc, array);
4295  return (err == hipSuccess) ? hipBindTextureToArray(&tex, array, &desc) : err;
4296 }
4297 
4298 template<class T, int dim, enum hipTextureReadMode readMode>
4299 DEPRECATED(DEPRECATED_MSG)
4300 static inline hipError_t hipBindTextureToArray(
4301  const struct texture<T, dim, readMode> &tex,
4302  hipArray_const_t array,
4303  const struct hipChannelFormatDesc &desc)
4304 {
4305  return hipBindTextureToArray(&tex, array, &desc);
4306 }
4307 
4308 template<class T, int dim, enum hipTextureReadMode readMode>
4309 static inline hipError_t hipBindTextureToMipmappedArray(
4310  const struct texture<T, dim, readMode> &tex,
4311  hipMipmappedArray_const_t mipmappedArray)
4312 {
4313  struct hipChannelFormatDesc desc;
4314  hipArray_t levelArray;
4315  hipError_t err = hipGetMipmappedArrayLevel(&levelArray, mipmappedArray, 0);
4316  if (err != hipSuccess) {
4317  return err;
4318  }
4319  err = hipGetChannelDesc(&desc, levelArray);
4320  return (err == hipSuccess) ? hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc) : err;
4321 }
4322 
4323 template<class T, int dim, enum hipTextureReadMode readMode>
4324 static inline hipError_t hipBindTextureToMipmappedArray(
4325  const struct texture<T, dim, readMode> &tex,
4326  hipMipmappedArray_const_t mipmappedArray,
4327  const struct hipChannelFormatDesc &desc)
4328 {
4329  return hipBindTextureToMipmappedArray(&tex, mipmappedArray, &desc);
4330 }
4331 
4332 template<class T, int dim, enum hipTextureReadMode readMode>
4333 DEPRECATED(DEPRECATED_MSG)
4334 static inline hipError_t hipUnbindTexture(
4335  const struct texture<T, dim, readMode> &tex)
4336 {
4337  return hipUnbindTexture(&tex);
4338 }
4339 #endif
4340 
4341 // doxygen end Texture
4347 #endif
4348 
4349 #ifdef __GNUC__
4350 #pragma GCC visibility pop
4351 #endif
4352 
4353 // doxygen end HIP API
4358 #endif
hipFuncAttributes
Definition: hip_runtime_api.h:128
hipModuleGetGlobal
hipError_t hipModuleGetGlobal(void **, size_t *, hipModule_t, const char *)
returns device memory pointer and size of the kernel present in the module with symbol name
hipPointerGetAttributes
hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, const void *ptr)
Return attributes for the specified pointer.
hipMemset3DAsync
hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent, hipStream_t stream __dparm(0))
Fills asynchronously the memory area pointed to by pitchedDevPtr with the constant value.
hipMemcpy3D
hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
Copies data between host and device.
hipIpcOpenMemHandle
hipError_t hipIpcOpenMemHandle(void **devPtr, hipIpcMemHandle_t handle, unsigned int flags)
Opens an interprocess memory handle exported from another process and returns a device pointer usable...
hipCtxEnablePeerAccess
hipError_t hipCtxEnablePeerAccess(hipCtx_t peerCtx, unsigned int flags)
Enables direct access to memory allocations in a peer context.
hipMallocPitch
hipError_t hipMallocPitch(void **ptr, size_t *pitch, size_t width, size_t height)
hipSetDevice
hipError_t hipSetDevice(int deviceId)
Set default device to be used for subsequent hip API calls from this thread.
hipDeviceGetP2PAttribute
hipError_t hipDeviceGetP2PAttribute(int *value, hipDeviceP2PAttr attr, int srcDevice, int dstDevice)
Returns a value for attr of link between two devices.
hipMemsetD16Async
hipError_t hipMemsetD16Async(hipDeviceptr_t dest, unsigned short value, size_t count, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant short value v...
hipMemcpy2DFromArrayAsync
hipError_t hipMemcpy2DFromArrayAsync(void *dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipGetErrorString
const char * hipGetErrorString(hipError_t hipError)
Return handy text string message to explain the error which occurred.
hipMemRangeGetAttributes
hipError_t hipMemRangeGetAttributes(void **data, size_t *data_sizes, hipMemRangeAttribute *attributes, size_t num_attributes, const void *dev_ptr, size_t count)
Query attributes of a given memory range in AMD HMM.
hipGetDeviceFlags
hipError_t hipGetDeviceFlags(unsigned int *flags)
Gets the flags set for current device.
hipDeviceGetByPCIBusId
hipError_t hipDeviceGetByPCIBusId(int *device, const char *pciBusId)
Returns a handle to a compute device.
hipMalloc3DArray
hipError_t hipMalloc3DArray(hipArray **array, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int flags)
Allocate an array on the device.
hipChooseDevice
hipError_t hipChooseDevice(int *device, const hipDeviceProp_t *prop)
Device which matches hipDeviceProp_t is returned.
hipMemcpy2DAsync
hipError_t hipMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies data between host and device.
hipLaunchKernel
hipError_t hipLaunchKernel(const void *function_address, dim3 numBlocks, dim3 dimBlocks, void **args, size_t sharedMemBytes __dparm(0), hipStream_t stream __dparm(0))
C compliant kernel launch API.
hipMemsetD32
hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count)
Fills the memory area pointed to by dest with the constant integer value for specified number of time...
hipStreamCreate
hipError_t hipStreamCreate(hipStream_t *stream)
Create an asynchronous stream.
hipDeviceGetStreamPriorityRange
hipError_t hipDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority)
Returns numerical values that correspond to the least and greatest stream priority.
hipIpcEventHandle_st
Definition: hip_runtime_api.h:120
hipMemAdviseSetPreferredLocation
@ hipMemAdviseSetPreferredLocation
Definition: hip_runtime_api.h:247
hipStreamCreateWithPriority
hipError_t hipStreamCreateWithPriority(hipStream_t *stream, unsigned int flags, int priority)
Create an asynchronous stream with the specified priority.
hipFuncCache_t
hipFuncCache_t
Definition: hip_runtime_api.h:308
hipPeekAtLastError
hipError_t hipPeekAtLastError(void)
Return last error returned by any HIP runtime API call.
hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault))
Returns occupancy for a device function.
hipModuleGetTexRef
hipError_t hipModuleGetTexRef(textureReference **texRef, hipModule_t hmod, const char *name)
returns the handle of the texture reference with the name from the module.
hipMemcpy3DAsync
hipError_t hipMemcpy3DAsync(const struct hipMemcpy3DParms *p, hipStream_t stream __dparm(0))
Copies data between host and device asynchronously.
hipDeviceGetPCIBusId
hipError_t hipDeviceGetPCIBusId(char *pciBusId, int len, int device)
Returns a PCI Bus Id string for the device, overloaded to take int device ID.
hipHostGetFlags
hipError_t hipHostGetFlags(unsigned int *flagsPtr, void *hostPtr)
Return flags associated with host pointer.
hipMemGetAddressRange
hipError_t hipMemGetAddressRange(hipDeviceptr_t *pbase, size_t *psize, hipDeviceptr_t dptr)
Get information on memory allocations.
hipSurfaceObject_t
unsigned long long hipSurfaceObject_t
Definition: hip_surface_types.h:36
hipStreamWaitEvent
hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags)
Make the specified compute stream wait for an event.
hipFuncCachePreferEqual
@ hipFuncCachePreferEqual
prefer equal size L1 cache and shared memory
Definition: hip_runtime_api.h:312
hipGetDevice
hipError_t hipGetDevice(int *deviceId)
Return the default device id for the calling host thread.
hipMallocArray
hipError_t hipMallocArray(hipArray **array, const hipChannelFormatDesc *desc, size_t width, size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault))
Allocate an array on the device.
hipCtxSetCurrent
hipError_t hipCtxSetCurrent(hipCtx_t ctx)
Set the passed context as current/default.
hipMemcpyToArray
hipError_t hipMemcpyToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t count, hipMemcpyKind kind)
Copies data between host and device.
HIP_MEMCPY3D
Definition: driver_types.h:394
hipMemcpyDtoDAsync
hipError_t hipMemcpyDtoDAsync(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Device asynchronously.
hipMemcpy2DFromArray
hipError_t hipMemcpy2DFromArray(void *dst, size_t dpitch, hipArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
hipModuleOccupancyMaxPotentialBlockSizeWithFlags
hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int *gridSize, int *blockSize, hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit, unsigned int flags)
determine the grid and block sizes to achieves maximum occupancy for a kernel
hipDevicePrimaryCtxRelease
hipError_t hipDevicePrimaryCtxRelease(hipDevice_t dev)
Release the primary context on the GPU.
hipHostMalloc
hipError_t hipHostMalloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory.
dim3::y
uint32_t y
y
Definition: hip_runtime_api.h:332
hipMemRangeGetAttribute
hipError_t hipMemRangeGetAttribute(void *data, size_t data_size, hipMemRangeAttribute attribute, const void *dev_ptr, size_t count)
Query an attribute of a given memory range in AMD HMM.
hipDeviceGetName
hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device)
Returns an identifer string for the device.
hipMemcpyParam2DAsync
hipError_t hipMemcpyParam2DAsync(const hip_Memcpy2D *pCopy, hipStream_t stream __dparm(0))
Copies memory for 2D arrays.
hipMemAdvise
hipError_t hipMemAdvise(const void *dev_ptr, size_t count, hipMemoryAdvise advice, int device)
Advise about the usage of a given memory range to AMD HMM.
hipDeviceEnablePeerAccess
hipError_t hipDeviceEnablePeerAccess(int peerDeviceId, unsigned int flags)
Enable direct access from current device's virtual address space to memory allocations physically loc...
hipCtxSetCacheConfig
hipError_t hipCtxSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipMallocMipmappedArray
hipError_t hipMallocMipmappedArray(hipMipmappedArray_t *mipmappedArray, const struct hipChannelFormatDesc *desc, struct hipExtent extent, unsigned int numLevels, unsigned int flags __dparm(0))
Allocate a mipmapped array on the device.
hipCtxPushCurrent
hipError_t hipCtxPushCurrent(hipCtx_t ctx)
Push the context to be set as current/ default context.
hipSharedMemConfig
hipSharedMemConfig
Definition: hip_runtime_api.h:318
hipDrvMemcpy3D
hipError_t hipDrvMemcpy3D(const HIP_MEMCPY3D *pCopy)
Copies data between host and device.
dim3::x
uint32_t x
x
Definition: hip_runtime_api.h:331
hipDeviceComputeCapability
hipError_t hipDeviceComputeCapability(int *major, int *minor, hipDevice_t device)
Returns the compute capability of the device.
hipStreamCallback_t
void(* hipStreamCallback_t)(hipStream_t stream, hipError_t status, void *userData)
Definition: hip_runtime_api.h:1216
hipMemoryAdvise
hipMemoryAdvise
Definition: hip_runtime_api.h:243
hip_Memcpy2D
Definition: driver_types.h:91
hipGetMipmappedArrayLevel
hipError_t hipGetMipmappedArrayLevel(hipArray_t *levelArray, hipMipmappedArray_const_t mipmappedArray, unsigned int level)
Gets a mipmap level of a HIP mipmapped array.
hipModuleOccupancyMaxPotentialBlockSize
hipError_t hipModuleOccupancyMaxPotentialBlockSize(int *gridSize, int *blockSize, hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit)
determine the grid and block sizes to achieves maximum occupancy for a kernel
__hipPushCallConfiguration
hipError_t __hipPushCallConfiguration(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Push configuration of a kernel launch.
hipIpcCloseMemHandle
hipError_t hipIpcCloseMemHandle(void *devPtr)
Close memory mapped with hipIpcOpenMemHandle.
hipDevicePrimaryCtxGetState
hipError_t hipDevicePrimaryCtxGetState(hipDevice_t dev, unsigned int *flags, int *active)
Get the state of the primary context.
hipDeviceSetCacheConfig
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
Set L1/Shared cache partition.
hipMemcpyAtoH
hipError_t hipMemcpyAtoH(void *dst, hipArray *srcArray, size_t srcOffset, size_t count)
Copies data between host and device.
hipGetDeviceCount
hipError_t hipGetDeviceCount(int *count)
Return number of compute-capable devices.
hipSuccess
hipSuccess
Successful completion.
Definition: hip_runtime_api.h:204
hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)
Returns occupancy for a device function.
hipSetupArgument
hipError_t hipSetupArgument(const void *arg, size_t size, size_t offset)
Set a kernel argument.
hipHostUnregister
hipError_t hipHostUnregister(void *hostPtr)
Un-register host pointer.
hipStreamGetFlags
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
Return flags associated with this stream.
hipMemsetD8Async
hipError_t hipMemsetD8Async(hipDeviceptr_t dest, unsigned char value, size_t count, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipExtStreamCreateWithCUMask
hipError_t hipExtStreamCreateWithCUMask(hipStream_t *stream, uint32_t cuMaskSize, const uint32_t *cuMask)
Create an asynchronous stream with the specified CU mask.
hipStreamSynchronize
hipError_t hipStreamSynchronize(hipStream_t stream)
Wait for all commands in stream to complete.
hipGetErrorName
const char * hipGetErrorName(hipError_t hip_error)
Return name of the specified error code in text form.
dim3
struct dim3 dim3
hipDeviceGet
hipError_t hipDeviceGet(hipDevice_t *device, int ordinal)
Returns a handle to a compute device.
__host__
#define __host__
Definition: host_defines.h:41
hipMemcpyDtoD
hipError_t hipMemcpyDtoD(hipDeviceptr_t dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Device.
hipMemcpy3DParms
Definition: driver_types.h:383
hipIpcGetMemHandle
hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t *handle, void *devPtr)
Gets an interprocess memory handle for an existing device memory allocation.
hipMemcpyHtoD
hipError_t hipMemcpyHtoD(hipDeviceptr_t dst, void *src, size_t sizeBytes)
Copy data from Host to Device.
hipDriverGetVersion
hipError_t hipDriverGetVersion(int *driverVersion)
Returns the approximate HIP driver version.
hipCtxGetFlags
hipError_t hipCtxGetFlags(unsigned int *flags)
Return flags used for creating default context.
hipMemcpy2DToArray
hipError_t hipMemcpy2DToArray(hipArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
hipMemAllocPitch
hipError_t hipMemAllocPitch(hipDeviceptr_t *dptr, size_t *pitch, size_t widthInBytes, size_t height, unsigned int elementSizeBytes)
hipDeviceProp_t
Definition: hip_runtime_api.h:84
hipMemAllocHost
hipError_t hipMemAllocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:883
hipMallocHost
hipError_t hipMallocHost(void **ptr, size_t size)
Allocate pinned host memory [Deprecated].
Definition: hip_runtime_api.h:877
hip_surface_types.h
Defines surface types for HIP runtime.
host_defines.h
TODO-doc.
hipMemsetD32Async
hipError_t hipMemsetD32Async(hipDeviceptr_t dst, int value, size_t count, hipStream_t stream __dparm(0))
Fills the memory area pointed to by dev with the constant integer value for specified number of times...
hipRuntimeGetVersion
hipError_t hipRuntimeGetVersion(int *runtimeVersion)
Returns the approximate HIP Runtime version.
hipConfigureCall
hipError_t hipConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem __dparm(0), hipStream_t stream __dparm(0))
Configure a kernel launch.
hipEventQuery
hipError_t hipEventQuery(hipEvent_t event)
Query event status.
hipExtLaunchMultiKernelMultiDevice
hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams *launchParamsList, int numDevices, unsigned int flags)
Launches kernels on multiple devices and guarantees all specified kernels are dispatched on respectiv...
hipStreamGetPriority
hipError_t hipStreamGetPriority(hipStream_t stream, int *priority)
Query the priority of a stream.
hipOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
hipCtxGetApiVersion
hipError_t hipCtxGetApiVersion(hipCtx_t ctx, int *apiVersion)
Returns the approximate HIP api version.
hipSharedMemBankSizeFourByte
@ hipSharedMemBankSizeFourByte
Definition: hip_runtime_api.h:320
hipEventSynchronize
hipError_t hipEventSynchronize(hipEvent_t event)
Wait for an event to complete.
hipFuncCachePreferNone
@ hipFuncCachePreferNone
no preference for shared memory or L1 (default)
Definition: hip_runtime_api.h:309
hipCtxCreate
hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device)
Create a context and set it as current/ default context.
hipHostFree
hipError_t hipHostFree(void *ptr)
Free memory allocated by the hcc hip host memory allocation API This API performs an implicit hipDevi...
hipMemsetD16
hipError_t hipMemsetD16(hipDeviceptr_t dest, unsigned short value, size_t count)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant short value v...
hipMipmappedArray
Definition: driver_types.h:116
hipMemRangeAttributeAccessedBy
@ hipMemRangeAttributeAccessedBy
Definition: hip_runtime_api.h:265
hipDeviceGetLimit
hipError_t hipDeviceGetLimit(size_t *pValue, enum hipLimit_t limit)
Get Resource limits of current device.
hipLaunchParams_t::args
void ** args
Arguments.
Definition: hip_runtime_api.h:343
hipMalloc
hipError_t hipMalloc(void **ptr, size_t size)
Allocate memory on the default accelerator.
hipIpcMemHandle_st
Definition: hip_runtime_api.h:111
hipEventElapsedTime
hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop)
Return the elapsed time between two events.
hipGetLastError
hipError_t hipGetLastError(void)
Return last error returned by any HIP runtime API call and resets the stored error code to hipSuccess...
hipInit
hipError_t hipInit(unsigned int flags)
Explicitly initializes the HIP runtime.
HIP_TEXTURE_DESC_st
Definition: driver_types.h:166
hipFuncSetCacheConfig
hipError_t hipFuncSetCacheConfig(const void *func, hipFuncCache_t config)
Set Cache configuration for a specific function.
hipCtxPopCurrent
hipError_t hipCtxPopCurrent(hipCtx_t *ctx)
Pop the current/default context and return the popped context.
hipArray
Definition: driver_types.h:78
hipHostGetDevicePointer
hipError_t hipHostGetDevicePointer(void **devPtr, void *hstPtr, unsigned int flags)
Get Device pointer from Host Pointer allocated through hipHostMalloc.
hipMemGetInfo
hipError_t hipMemGetInfo(size_t *free, size_t *total)
Query memory info. Return snapshot of free memory, and total allocatable memory on the device.
hipEventDestroy
hipError_t hipEventDestroy(hipEvent_t event)
Destroy the specified event.
hipDeviceSetSharedMemConfig
hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config)
The bank width of shared memory on current device is set.
hipDeviceReset
hipError_t hipDeviceReset(void)
The state of current device is discarded and updated to a fresh state.
hipSetDeviceFlags
hipError_t hipSetDeviceFlags(unsigned flags)
The current device behavior is changed according the flags passed.
hipCtxGetCurrent
hipError_t hipCtxGetCurrent(hipCtx_t *ctx)
Get the handle of the current/ default context.
hipFuncGetAttributes
hipError_t hipFuncGetAttributes(struct hipFuncAttributes *attr, const void *func)
Find out attributes for a given function.
HIP_ARRAY3D_DESCRIPTOR
Definition: driver_types.h:69
hipFuncGetAttribute
hipError_t hipFuncGetAttribute(int *value, hipFunction_attribute attrib, hipFunction_t hfunc)
Find out a specific attribute for a given function.
hipMemAdviseUnsetReadMostly
@ hipMemAdviseUnsetReadMostly
Undo the effect of hipMemAdviseSetReadMostly.
Definition: hip_runtime_api.h:246
dim3
Definition: hip_runtime_api.h:330
hipStreamQuery
hipError_t hipStreamQuery(hipStream_t stream)
Return hipSuccess if all of the operations in the specified stream have completed,...
hipLaunchByPtr
hipError_t hipLaunchByPtr(const void *func)
Launch a kernel.
hipExtStreamGetCUMask
hipError_t hipExtStreamGetCUMask(hipStream_t stream, uint32_t cuMaskSize, uint32_t *cuMask)
Get CU mask associated with an asynchronous stream.
hipExtMallocWithFlags
hipError_t hipExtMallocWithFlags(void **ptr, size_t sizeBytes, unsigned int flags)
Allocate memory on the default accelerator.
hipStreamAttachMemAsync
hipError_t hipStreamAttachMemAsync(hipStream_t stream, hipDeviceptr_t *dev_ptr, size_t length __dparm(0), unsigned int flags __dparm(hipMemAttachSingle))
Attach memory to a stream asynchronously in AMD HMM.
hipDevicePrimaryCtxSetFlags
hipError_t hipDevicePrimaryCtxSetFlags(hipDevice_t dev, unsigned int flags)
Set flags for the primary context.
hipPointerAttribute_t
Definition: hip_runtime_api.h:169
hipFree
hipError_t hipFree(void *ptr)
Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSy...
hipLaunchParams_t::func
void * func
Device function symbol.
Definition: hip_runtime_api.h:340
hipArrayDefault
#define hipArrayDefault
Default HIP array allocation flag.
Definition: hip_runtime_api.h:221
hipDevicePrimaryCtxRetain
hipError_t hipDevicePrimaryCtxRetain(hipCtx_t *pctx, hipDevice_t dev)
Retain the primary context on the GPU.
hipCtxSynchronize
hipError_t hipCtxSynchronize(void)
Blocks until the default context has completed all preceding requested tasks.
hipFreeHost
hipError_t hipFreeHost(void *ptr)
Free memory allocated by the hcc hip host memory allocation API. [Deprecated].
Definition: hip_runtime_api.h:934
hipMemcpyHtoA
hipError_t hipMemcpyHtoA(hipArray *dstArray, size_t dstOffset, const void *srcHost, size_t count)
Copies data between host and device.
hipStreamAddCallback
hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback, void *userData, unsigned int flags)
Adds a callback to be called on the host after all currently enqueued items in the stream have comple...
hipLaunchParams_t::stream
hipStream_t stream
Stream identifier.
Definition: hip_runtime_api.h:345
hipMemcpyDtoHAsync
hipError_t hipMemcpyDtoHAsync(void *dst, hipDeviceptr_t src, size_t sizeBytes, hipStream_t stream)
Copy data from Device to Host asynchronously.
hipMemRangeAttributeReadMostly
@ hipMemRangeAttributeReadMostly
Definition: hip_runtime_api.h:262
hipMemRangeAttributeLastPrefetchLocation
@ hipMemRangeAttributeLastPrefetchLocation
The last location to which the range was prefetched.
Definition: hip_runtime_api.h:267
hipDrvMemcpy3DAsync
hipError_t hipDrvMemcpy3DAsync(const HIP_MEMCPY3D *pCopy, hipStream_t stream)
Copies data between host and device asynchronously.
hipEventRecord
hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream)
Record an event in the specified stream.
hipLaunchParams_t::gridDim
dim3 gridDim
Grid dimentions.
Definition: hip_runtime_api.h:341
hipMemcpy2D
hipError_t hipMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind)
Copies data between host and device.
hipExtent
Definition: driver_types.h:370
hipPitchedPtr
Definition: driver_types.h:363
hipSharedMemBankSizeDefault
@ hipSharedMemBankSizeDefault
The compiler selects a device-specific value for the banking.
Definition: hip_runtime_api.h:319
hipMemset2D
hipError_t hipMemset2D(void *dst, size_t pitch, int value, size_t width, size_t height)
Fills the memory area pointed to by dst with the constant value.
hipMemset3D
hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent)
Fills synchronously the memory area pointed to by pitchedDevPtr with the constant value.
hipStreamCreateWithFlags
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
Create an asynchronous stream.
hipDeviceGetAttribute
hipError_t hipDeviceGetAttribute(int *pi, hipDeviceAttribute_t attr, int deviceId)
Query for a specific device attribute.
hipMemcpyFromArray
hipError_t hipMemcpyFromArray(void *dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset, size_t count, hipMemcpyKind kind)
Copies data between host and device.
hipMemcpyPeerAsync
hipError_t hipMemcpyPeerAsync(void *dst, int dstDeviceId, const void *src, int srcDevice, size_t sizeBytes, hipStream_t stream __dparm(0))
Copies memory from one device to memory on another device.
hipMemcpyHtoDAsync
hipError_t hipMemcpyHtoDAsync(hipDeviceptr_t dst, void *src, size_t sizeBytes, hipStream_t stream)
Copy data from Host to Device asynchronously.
hipMemcpyDtoH
hipError_t hipMemcpyDtoH(void *dst, hipDeviceptr_t src, size_t sizeBytes)
Copy data from Device to Host.
hipDeviceGetCacheConfig
hipError_t hipDeviceGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
hipMemcpyPeer
hipError_t hipMemcpyPeer(void *dst, int dstDeviceId, const void *src, int srcDeviceId, size_t sizeBytes)
Copies memory from one device to memory on another device.
hipModuleLoadDataEx
hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned int numOptions, hipJitOption *options, void **optionValues)
builds module from code object which resides in host memory. Image is pointer to that location....
hipFreeMipmappedArray
hipError_t hipFreeMipmappedArray(hipMipmappedArray_t mipmappedArray)
Frees a mipmapped array on the device.
hipRegisterApiCallback
hipError_t hipRegisterApiCallback(uint32_t id, void *fun, void *arg)
hipGetDeviceProperties
hipError_t hipGetDeviceProperties(hipDeviceProp_t *prop, int deviceId)
Returns device properties.
hipMemcpy
hipError_t hipMemcpy(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
Copy data from src to dst.
hipEventCreateWithFlags
hipError_t hipEventCreateWithFlags(hipEvent_t *event, unsigned flags)
Create an event with the specified flags.
hipMemAdviseUnsetAccessedBy
@ hipMemAdviseUnsetAccessedBy
Definition: hip_runtime_api.h:252
hipDeviceTotalMem
hipError_t hipDeviceTotalMem(size_t *bytes, hipDevice_t device)
Returns the total amount of memory on the device.
hipFreeArray
hipError_t hipFreeArray(hipArray *array)
Frees an array on the device.
hipMallocManaged
hipError_t hipMallocManaged(void **dev_ptr, size_t size, unsigned int flags __dparm(hipMemAttachGlobal))
Allocates memory that will be automatically managed by AMD HMM.
hip_texture_types.h
Defines the different newt vector types for HIP runtime.
textureReference
Definition: texture_types.h:74
hipCtxGetSharedMemConfig
hipError_t hipCtxGetSharedMemConfig(hipSharedMemConfig *pConfig)
Get Shared memory bank configuration.
hipDeviceCanAccessPeer
hipError_t hipDeviceCanAccessPeer(int *canAccessPeer, int deviceId, int peerDeviceId)
Determine if a device can access a peer's memory.
hipMemAdviseUnsetPreferredLocation
@ hipMemAdviseUnsetPreferredLocation
Clear the preferred location for the data.
Definition: hip_runtime_api.h:249
hipModuleGetFunction
hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, const char *kname)
Function with kname will be extracted if present in module.
hipMemPrefetchAsync
hipError_t hipMemPrefetchAsync(const void *dev_ptr, size_t count, int device, hipStream_t stream __dparm(0))
Prefetches memory to the specified destination device using AMD HMM.
hipCtxDisablePeerAccess
hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx)
Disable direct access from current context's virtual address space to memory allocations physically l...
HIP_RESOURCE_DESC_st
Definition: driver_types.h:288
hipTextureDesc
Definition: texture_types.h:95
hipResourceViewDesc
Definition: driver_types.h:323
dim3::z
uint32_t z
z
Definition: hip_runtime_api.h:333
hipCtxSetSharedMemConfig
hipError_t hipCtxSetSharedMemConfig(hipSharedMemConfig config)
Set Shared memory bank configuration.
hipMemsetD8
hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t count)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipMemset2DAsync
hipError_t hipMemset2DAsync(void *dst, size_t pitch, int value, size_t width, size_t height, hipStream_t stream __dparm(0))
Fills asynchronously the memory area pointed to by dst with the constant value.
HIP_ARRAY_DESCRIPTOR
Definition: driver_types.h:62
hipCtxGetDevice
hipError_t hipCtxGetDevice(hipDevice_t *device)
Get the handle of the device associated with current/default context.
hipLaunchParams_t::blockDim
dim3 blockDim
Block dimentions.
Definition: hip_runtime_api.h:342
hipMemAttachGlobal
#define hipMemAttachGlobal
Memory can be accessed by any stream on any device.
Definition: hip_runtime_api.h:191
hipLaunchParams_t
Definition: hip_runtime_api.h:339
hipFuncCachePreferShared
@ hipFuncCachePreferShared
prefer larger shared memory and smaller L1 cache
Definition: hip_runtime_api.h:310
hipMemRangeAttributePreferredLocation
@ hipMemRangeAttributePreferredLocation
The preferred location of the range.
Definition: hip_runtime_api.h:264
hipMemAdviseSetReadMostly
@ hipMemAdviseSetReadMostly
Definition: hip_runtime_api.h:244
hipFuncAttribute
hipFuncAttribute
Definition: hip_runtime_api.h:299
hipSharedMemBankSizeEightByte
@ hipSharedMemBankSizeEightByte
Definition: hip_runtime_api.h:322
hipDeviceAttribute_t
hipDeviceAttribute_t
Definition: hip_runtime_api.h:297
hipFuncSetSharedMemConfig
hipError_t hipFuncSetSharedMemConfig(const void *func, hipSharedMemConfig config)
Set shared memory configuation for a specific function.
hipExtGetLinkTypeAndHopCount
hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t *linktype, uint32_t *hopcount)
Returns the link type and hop count between two devices.
hipMemAdviseSetAccessedBy
@ hipMemAdviseSetAccessedBy
Definition: hip_runtime_api.h:250
hipResourceDesc
Definition: driver_types.h:262
hipDeviceSynchronize
hipError_t hipDeviceSynchronize(void)
Waits on all active streams on current device.
hipCtxGetCacheConfig
hipError_t hipCtxGetCacheConfig(hipFuncCache_t *cacheConfig)
Set Cache configuration for a specific function.
hipLaunchParams_t::sharedMem
size_t sharedMem
Shared memory.
Definition: hip_runtime_api.h:344
hipCtxDestroy
hipError_t hipCtxDestroy(hipCtx_t ctx)
Destroy a HIP context.
hipModuleLaunchKernel
hipError_t hipModuleLaunchKernel(hipFunction_t f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, hipStream_t stream, void **kernelParams, void **extra)
launches kernel f with launch parameters and shared memory on stream with arguments passed to kernelp...
hipProfilerStart
hipError_t hipProfilerStart()
Start recording of profiling information When using this API, start the profiler with profiling disab...
hipDeviceGetSharedMemConfig
hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig *pConfig)
Returns bank width of shared memory for current device.
hipMemcpyAsync
hipError_t hipMemcpyAsync(void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream __dparm(0))
Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset...
hipOccupancyMaxPotentialBlockSize
hipError_t hipOccupancyMaxPotentialBlockSize(int *gridSize, int *blockSize, const void *f, size_t dynSharedMemPerBlk, int blockSizeLimit)
determine the grid and block sizes to achieves maximum occupancy for a kernel
hipStreamDestroy
hipError_t hipStreamDestroy(hipStream_t stream)
Destroys the specified stream.
hipHostRegister
hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
Register host memory so it can be accessed from the current device.
hipModuleLoad
hipError_t hipModuleLoad(hipModule_t *module, const char *fname)
Loads code object from file into a hipModule_t.
hipProfilerStop
hipError_t hipProfilerStop()
Stop recording of profiling information. When using this API, start the profiler with profiling disab...
hipEventCreate
hipError_t hipEventCreate(hipEvent_t *event)
HIP_RESOURCE_VIEW_DESC_st
Definition: driver_types.h:338
hipMemsetAsync
hipError_t hipMemsetAsync(void *dst, int value, size_t sizeBytes, hipStream_t stream __dparm(0))
Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value val...
hipModuleLoadData
hipError_t hipModuleLoadData(hipModule_t *module, const void *image)
builds module from code object which resides in host memory. Image is pointer to that location.
hipFuncCachePreferL1
@ hipFuncCachePreferL1
prefer larger L1 cache and smaller shared memory
Definition: hip_runtime_api.h:311
hipMemAttachSingle
#define hipMemAttachSingle
the associated device
Definition: hip_runtime_api.h:193
hipMemcpyParam2D
hipError_t hipMemcpyParam2D(const hip_Memcpy2D *pCopy)
Copies memory for 2D arrays.
hipHostAlloc
hipError_t hipHostAlloc(void **ptr, size_t size, unsigned int flags)
Allocate device accessible page locked host memory [Deprecated].
Definition: hip_runtime_api.h:889
hipMemset
hipError_t hipMemset(void *dst, int value, size_t sizeBytes)
Fills the first sizeBytes bytes of the memory area pointed to by dest with the constant byte value va...
hipDeviceDisablePeerAccess
hipError_t hipDeviceDisablePeerAccess(int peerDeviceId)
Disable direct access from current device's virtual address space to memory allocations physically lo...
hipModuleOccupancyMaxActiveBlocksPerMultiprocessor
hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
Returns occupancy for a device function.
hipFuncSetAttribute
hipError_t hipFuncSetAttribute(const void *func, hipFuncAttribute attr, int value)
Set attribute for a specific function.
__hipPopCallConfiguration
hipError_t __hipPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, size_t *sharedMem, hipStream_t *stream)
Pop configuration of a kernel launch.
hipDevicePrimaryCtxReset
hipError_t hipDevicePrimaryCtxReset(hipDevice_t dev)
Resets the primary context on the GPU.
hipChannelFormatDesc
Definition: driver_types.h:38
hipModuleUnload
hipError_t hipModuleUnload(hipModule_t module)
Frees the module.
hipMemRangeAttribute
hipMemRangeAttribute
Definition: hip_runtime_api.h:261