1 /**
2  * Author......: See docs/credits.txt
3  * License.....: MIT
4  */
5 
6 #ifndef _EXT_HIP_H
7 #define _EXT_HIP_H
8 
9 // The general Idea with HIP is to use it for AMD GPU since we use CUDA for NV
10 // Therefore, we need to take certain items, such as hipDeviceptr_t from driver specific paths like amd_driver_types.h
11 // We just need to keep this in mind in case we need to update these constants from future SDK versions
12 
13 // start: amd_driver_types.h
14 
15 typedef void* hipDeviceptr_t;
16 
17 typedef enum hipFunction_attribute {
18     HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK,
19     HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES,
20     HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES,
21     HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES,
22     HIP_FUNC_ATTRIBUTE_NUM_REGS,
23     HIP_FUNC_ATTRIBUTE_PTX_VERSION,
24     HIP_FUNC_ATTRIBUTE_BINARY_VERSION,
25     HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA,
26     HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES,
27     HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT,
28     HIP_FUNC_ATTRIBUTE_MAX
29 }hipFunction_attribute;
30 
31 // stop: amd_driver_types.h
32 
33 // start: hip_runtime_api.h
34 
35 typedef int hipDevice_t;
36 typedef struct ihipCtx_t* hipCtx_t;
37 typedef struct ihipEvent_t* hipEvent_t;
38 typedef struct ihipStream_t* hipStream_t;
39 typedef struct ihipModule_t* hipModule_t;
40 typedef struct ihipModuleSymbol_t* hipFunction_t;
41 
42 // Ignoring error-code return values from hip APIs is discouraged. On C++17,
43 // we can make that yield a warning
44 #if __cplusplus >= 201703L
45 #define __HIP_NODISCARD [[nodiscard]]
46 #else
47 #define __HIP_NODISCARD
48 #endif
49 
50 typedef enum __HIP_NODISCARD hipError_t {
51     hipSuccess = 0,  ///< Successful completion.
52     hipErrorInvalidValue = 1,  ///< One or more of the parameters passed to the API call is NULL
53                                ///< or not in an acceptable range.
54     hipErrorOutOfMemory = 2,
55     // Deprecated
56     hipErrorMemoryAllocation = 2,  ///< Memory allocation error.
57     hipErrorNotInitialized = 3,
58     // Deprecated
59     hipErrorInitializationError = 3,
60     hipErrorDeinitialized = 4,
61     hipErrorProfilerDisabled = 5,
62     hipErrorProfilerNotInitialized = 6,
63     hipErrorProfilerAlreadyStarted = 7,
64     hipErrorProfilerAlreadyStopped = 8,
65     hipErrorInvalidConfiguration = 9,
66     hipErrorInvalidPitchValue = 12,
67     hipErrorInvalidSymbol = 13,
68     hipErrorInvalidDevicePointer = 17,  ///< Invalid Device Pointer
69     hipErrorInvalidMemcpyDirection = 21,  ///< Invalid memory copy direction
70     hipErrorInsufficientDriver = 35,
71     hipErrorMissingConfiguration = 52,
72     hipErrorPriorLaunchFailure = 53,
73     hipErrorInvalidDeviceFunction = 98,
74     hipErrorNoDevice = 100,  ///< Call to hipGetDeviceCount returned 0 devices
75     hipErrorInvalidDevice = 101,  ///< DeviceID must be in range 0...#compute-devices.
76     hipErrorInvalidImage = 200,
77     hipErrorInvalidContext = 201,  ///< Produced when input context is invalid.
78     hipErrorContextAlreadyCurrent = 202,
79     hipErrorMapFailed = 205,
80     // Deprecated
81     hipErrorMapBufferObjectFailed = 205,  ///< Produced when the IPC memory attach failed from ROCr.
82     hipErrorUnmapFailed = 206,
83     hipErrorArrayIsMapped = 207,
84     hipErrorAlreadyMapped = 208,
85     hipErrorNoBinaryForGpu = 209,
86     hipErrorAlreadyAcquired = 210,
87     hipErrorNotMapped = 211,
88     hipErrorNotMappedAsArray = 212,
89     hipErrorNotMappedAsPointer = 213,
90     hipErrorECCNotCorrectable = 214,
91     hipErrorUnsupportedLimit = 215,
92     hipErrorContextAlreadyInUse = 216,
93     hipErrorPeerAccessUnsupported = 217,
94     hipErrorInvalidKernelFile = 218,  ///< In CUDA DRV, it is CUDA_ERROR_INVALID_PTX
95     hipErrorInvalidGraphicsContext = 219,
96     hipErrorInvalidSource = 300,
97     hipErrorFileNotFound = 301,
98     hipErrorSharedObjectSymbolNotFound = 302,
99     hipErrorSharedObjectInitFailed = 303,
100     hipErrorOperatingSystem = 304,
101     hipErrorInvalidHandle = 400,
102     // Deprecated
103     hipErrorInvalidResourceHandle = 400,  ///< Resource handle (hipEvent_t or hipStream_t) invalid.
104     hipErrorNotFound = 500,
105     hipErrorNotReady = 600,  ///< Indicates that asynchronous operations enqueued earlier are not
106                              ///< ready.  This is not actually an error, but is used to distinguish
107                              ///< from hipSuccess (which indicates completion).  APIs that return
108                              ///< this error include hipEventQuery and hipStreamQuery.
109     hipErrorIllegalAddress = 700,
110     hipErrorLaunchOutOfResources = 701,  ///< Out of resources error.
111     hipErrorLaunchTimeOut = 702,
112     hipErrorPeerAccessAlreadyEnabled =
113         704,  ///< Peer access was already enabled from the current device.
114     hipErrorPeerAccessNotEnabled =
115         705,  ///< Peer access was never enabled from the current device.
116     hipErrorSetOnActiveProcess = 708,
117     hipErrorContextIsDestroyed = 709,
118     hipErrorAssert = 710,  ///< Produced when the kernel calls assert.
119     hipErrorHostMemoryAlreadyRegistered =
120         712,  ///< Produced when trying to lock a page-locked memory.
121     hipErrorHostMemoryNotRegistered =
122         713,  ///< Produced when trying to unlock a non-page-locked memory.
123     hipErrorLaunchFailure =
124         719,  ///< An exception occurred on the device while executing a kernel.
125     hipErrorCooperativeLaunchTooLarge =
126         720,  ///< This error indicates that the number of blocks launched per grid for a kernel
127               ///< that was launched via cooperative launch APIs exceeds the maximum number of
128               ///< allowed blocks for the current device
129     hipErrorNotSupported = 801,  ///< Produced when the hip API is not supported/implemented
130     hipErrorStreamCaptureUnsupported = 900,  ///< The operation is not permitted when the stream
131                                              ///< is capturing.
132     hipErrorStreamCaptureInvalidated = 901,  ///< The current capture sequence on the stream
133                                              ///< has been invalidated due to a previous error.
134     hipErrorStreamCaptureMerge = 902,  ///< The operation would have resulted in a merge of
135                                        ///< two independent capture sequences.
136     hipErrorStreamCaptureUnmatched = 903,  ///< The capture was not initiated in this stream.
137     hipErrorStreamCaptureUnjoined = 904,  ///< The capture sequence contains a fork that was not
138                                           ///< joined to the primary stream.
139     hipErrorStreamCaptureIsolation = 905,  ///< A dependency would have been created which crosses
140                                            ///< the capture sequence boundary. Only implicit
141                                            ///< in-stream ordering dependencies  are allowed
142                                            ///< to cross the boundary
143     hipErrorStreamCaptureImplicit = 906,  ///< The operation would have resulted in a disallowed
144                                           ///< implicit dependency on a current capture sequence
145                                           ///< from hipStreamLegacy.
146     hipErrorCapturedEvent = 907,  ///< The operation is not permitted on an event which was last
147                                   ///< recorded in a capturing stream.
148     hipErrorStreamCaptureWrongThread = 908,  ///< A stream capture sequence not initiated with
149                                              ///< the hipStreamCaptureModeRelaxed argument to
150                                              ///< hipStreamBeginCapture was passed to
151                                              ///< hipStreamEndCapture in a different thread.
152     hipErrorUnknown = 999,  //< Unknown error.
153     // HSA Runtime Error Codes start here.
154     hipErrorRuntimeMemory = 1052,  ///< HSA runtime memory call returned error.  Typically not seen
155                                    ///< in production systems.
156     hipErrorRuntimeOther = 1053,  ///< HSA runtime call other than memory returned error.  Typically
157                                   ///< not seen in production systems.
158     hipErrorTbd  ///< Marker that more error codes are needed.
159 } hipError_t;
160 
161 #undef __HIP_NODISCARD
162 
163 typedef enum hipDeviceAttribute_t {
164     hipDeviceAttributeMaxThreadsPerBlock,       ///< Maximum number of threads per block.
165     hipDeviceAttributeMaxBlockDimX,             ///< Maximum x-dimension of a block.
166     hipDeviceAttributeMaxBlockDimY,             ///< Maximum y-dimension of a block.
167     hipDeviceAttributeMaxBlockDimZ,             ///< Maximum z-dimension of a block.
168     hipDeviceAttributeMaxGridDimX,              ///< Maximum x-dimension of a grid.
169     hipDeviceAttributeMaxGridDimY,              ///< Maximum y-dimension of a grid.
170     hipDeviceAttributeMaxGridDimZ,              ///< Maximum z-dimension of a grid.
171     hipDeviceAttributeMaxSharedMemoryPerBlock,  ///< Maximum shared memory available per block in
172                                                 ///< bytes.
173     hipDeviceAttributeTotalConstantMemory,      ///< Constant memory size in bytes.
174     hipDeviceAttributeWarpSize,                 ///< Warp size in threads.
175     hipDeviceAttributeMaxRegistersPerBlock,  ///< Maximum number of 32-bit registers available to a
176                                              ///< thread block. This number is shared by all thread
177                                              ///< blocks simultaneously resident on a
178                                              ///< multiprocessor.
179     hipDeviceAttributeClockRate,             ///< Peak clock frequency in kilohertz.
180     hipDeviceAttributeMemoryClockRate,       ///< Peak memory clock frequency in kilohertz.
181     hipDeviceAttributeMemoryBusWidth,        ///< Global memory bus width in bits.
182     hipDeviceAttributeMultiprocessorCount,   ///< Number of multiprocessors on the device.
183     hipDeviceAttributeComputeMode,           ///< Compute mode that device is currently in.
184     hipDeviceAttributeL2CacheSize,  ///< Size of L2 cache in bytes. 0 if the device doesn't have L2
185                                     ///< cache.
186     hipDeviceAttributeMaxThreadsPerMultiProcessor,  ///< Maximum resident threads per
187                                                     ///< multiprocessor.
188     hipDeviceAttributeComputeCapabilityMajor,       ///< Major compute capability version number.
189     hipDeviceAttributeComputeCapabilityMinor,       ///< Minor compute capability version number.
190     hipDeviceAttributeConcurrentKernels,  ///< Device can possibly execute multiple kernels
191                                           ///< concurrently.
192     hipDeviceAttributePciBusId,           ///< PCI Bus ID.
193     hipDeviceAttributePciDeviceId,        ///< PCI Device ID.
194     hipDeviceAttributeMaxSharedMemoryPerMultiprocessor,  ///< Maximum Shared Memory Per
195                                                          ///< Multiprocessor.
196     hipDeviceAttributeIsMultiGpuBoard,                   ///< Multiple GPU devices.
197     hipDeviceAttributeIntegrated,                        ///< iGPU
198     hipDeviceAttributeCooperativeLaunch,                 ///< Support cooperative launch
199     hipDeviceAttributeCooperativeMultiDeviceLaunch,      ///< Support cooperative launch on multiple devices
200     hipDeviceAttributeMaxTexture1DWidth,    ///< Maximum number of elements in 1D images
201     hipDeviceAttributeMaxTexture2DWidth,    ///< Maximum dimension width of 2D images in image elements
202     hipDeviceAttributeMaxTexture2DHeight,   ///< Maximum dimension height of 2D images in image elements
203     hipDeviceAttributeMaxTexture3DWidth,    ///< Maximum dimension width of 3D images in image elements
204     hipDeviceAttributeMaxTexture3DHeight,   ///< Maximum dimensions height of 3D images in image elements
205     hipDeviceAttributeMaxTexture3DDepth,    ///< Maximum dimensions depth of 3D images in image elements
206 
207     hipDeviceAttributeHdpMemFlushCntl,      ///< Address of the HDP_MEM_COHERENCY_FLUSH_CNTL register
208     hipDeviceAttributeHdpRegFlushCntl,      ///< Address of the HDP_REG_COHERENCY_FLUSH_CNTL register
209 
210     hipDeviceAttributeMaxPitch,             ///< Maximum pitch in bytes allowed by memory copies
211     hipDeviceAttributeTextureAlignment,     ///<Alignment requirement for textures
212     hipDeviceAttributeTexturePitchAlignment, ///<Pitch alignment requirement for 2D texture references bound to pitched memory;
213     hipDeviceAttributeKernelExecTimeout,    ///<Run time limit for kernels executed on the device
214     hipDeviceAttributeCanMapHostMemory,     ///<Device can map host memory into device address space
215     hipDeviceAttributeEccEnabled,           ///<Device has ECC support enabled
216 
217     hipDeviceAttributeCooperativeMultiDeviceUnmatchedFunc,        ///< Supports cooperative launch on multiple
218                                                                   ///devices with unmatched functions
219     hipDeviceAttributeCooperativeMultiDeviceUnmatchedGridDim,     ///< Supports cooperative launch on multiple
220                                                                   ///devices with unmatched grid dimensions
221     hipDeviceAttributeCooperativeMultiDeviceUnmatchedBlockDim,    ///< Supports cooperative launch on multiple
222                                                                   ///devices with unmatched block dimensions
223     hipDeviceAttributeCooperativeMultiDeviceUnmatchedSharedMem,   ///< Supports cooperative launch on multiple
224                                                                   ///devices with unmatched shared memories
225     hipDeviceAttributeAsicRevision,         ///< Revision of the GPU in this device
226     hipDeviceAttributeManagedMemory,        ///< Device supports allocating managed memory on this system
227     hipDeviceAttributeDirectManagedMemAccessFromHost, ///< Host can directly access managed memory on
228                                                       /// the device without migration
229     hipDeviceAttributeConcurrentManagedAccess,  ///< Device can coherently access managed memory
230                                                 /// concurrently with the CPU
231     hipDeviceAttributePageableMemoryAccess,     ///< Device supports coherently accessing pageable memory
232                                                 /// without calling hipHostRegister on it
233     hipDeviceAttributePageableMemoryAccessUsesHostPageTables, ///< Device accesses pageable memory via
234                                                               /// the host's page tables
235     hipDeviceAttributeCanUseStreamWaitValue ///< '1' if Device supports hipStreamWaitValue32() and
236                                             ///< hipStreamWaitValue64() , '0' otherwise.
237 
238 } hipDeviceAttribute_t;
239 
240 //! Flags that can be used with hipStreamCreateWithFlags
241 #define hipStreamDefault                                                                           \
242     0x00  ///< Default stream creation flags. These are used with hipStreamCreate().
243 #define hipStreamNonBlocking 0x01  ///< Stream does not implicitly synchronize with null stream
244 
245 
246 //! Flags that can be used with hipEventCreateWithFlags:
247 #define hipEventDefault 0x0  ///< Default flags
248 #define hipEventBlockingSync                                                                       \
249     0x1  ///< Waiting will yield CPU.  Power-friendly and usage-friendly but may increase latency.
250 #define hipEventDisableTiming                                                                      \
251     0x2  ///< Disable event's capability to record timing information.  May improve performance.
252 #define hipEventInterprocess 0x4  ///< Event can support IPC.  @warning - not supported in HIP.
253 #define hipEventReleaseToDevice                                                                    \
254     0x40000000  /// < Use a device-scope release when recording this event.  This flag is useful to
255                 /// obtain more precise timings of commands between events.  The flag is a no-op on
256                 /// CUDA platforms.
257 #define hipEventReleaseToSystem                                                                    \
258     0x80000000  /// < Use a system-scope release when recording this event.  This flag is
259                 /// useful to make non-coherent host memory visible to the host.  The flag is a
260                 /// no-op on CUDA platforms.
261 
262 
263 #define hipDeviceScheduleAuto 0x0  ///< Automatically select between Spin and Yield
264 #define hipDeviceScheduleSpin                                                                      \
265     0x1  ///< Dedicate a CPU core to spin-wait.  Provides lowest latency, but burns a CPU core and
266          ///< may consume more power.
267 #define hipDeviceScheduleYield                                                                     \
268     0x2  ///< Yield the CPU to the operating system when waiting.  May increase latency, but lowers
269          ///< power and is friendlier to other threads in the system.
270 #define hipDeviceScheduleBlockingSync 0x4
271 #define hipDeviceScheduleMask 0x7
272 #define hipDeviceMapHost 0x8
273 #define hipDeviceLmemResizeToMax 0x16
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 
296 // stop: hip_runtime_api.h
297 
298 #ifdef _WIN32
299 #define HIPAPI __stdcall
300 #else
301 #define HIPAPI
302 #endif
303 
304 #define HIP_API_CALL HIPAPI
305 
306 typedef hipError_t (HIP_API_CALL *HIP_HIPCTXCREATE)              (hipCtx_t *, unsigned int, hipDevice_t);
307 typedef hipError_t (HIP_API_CALL *HIP_HIPCTXDESTROY)             (hipCtx_t);
308 typedef hipError_t (HIP_API_CALL *HIP_HIPCTXPOPCURRENT)          (hipCtx_t *);
309 typedef hipError_t (HIP_API_CALL *HIP_HIPCTXPUSHCURRENT)         (hipCtx_t);
310 typedef hipError_t (HIP_API_CALL *HIP_HIPCTXSETCURRENT)          (hipCtx_t);
311 typedef hipError_t (HIP_API_CALL *HIP_HIPCTXSYNCHRONIZE)         ();
312 typedef hipError_t (HIP_API_CALL *HIP_HIPDEVICEGETATTRIBUTE)     (int *, hipDeviceAttribute_t, hipDevice_t);
313 typedef hipError_t (HIP_API_CALL *HIP_HIPDEVICEGETCOUNT)         (int *);
314 typedef hipError_t (HIP_API_CALL *HIP_HIPDEVICEGET)              (hipDevice_t *, int);
315 typedef hipError_t (HIP_API_CALL *HIP_HIPDEVICEGETNAME)          (char *, int, hipDevice_t);
316 typedef hipError_t (HIP_API_CALL *HIP_HIPDEVICETOTALMEM)         (size_t *, hipDevice_t);
317 typedef hipError_t (HIP_API_CALL *HIP_HIPDRIVERGETVERSION)       (int *);
318 typedef hipError_t (HIP_API_CALL *HIP_HIPEVENTCREATE)            (hipEvent_t *, unsigned int);
319 typedef hipError_t (HIP_API_CALL *HIP_HIPEVENTDESTROY)           (hipEvent_t);
320 typedef hipError_t (HIP_API_CALL *HIP_HIPEVENTELAPSEDTIME)       (float *, hipEvent_t, hipEvent_t);
321 typedef hipError_t (HIP_API_CALL *HIP_HIPEVENTRECORD)            (hipEvent_t, hipStream_t);
322 typedef hipError_t (HIP_API_CALL *HIP_HIPEVENTSYNCHRONIZE)       (hipEvent_t);
323 typedef hipError_t (HIP_API_CALL *HIP_HIPFUNCGETATTRIBUTE)       (int *, hipFunction_attribute, hipFunction_t);
324 typedef hipError_t (HIP_API_CALL *HIP_HIPGETERRORNAME)           (hipError_t, const char **);
325 typedef hipError_t (HIP_API_CALL *HIP_HIPGETERRORSTRING)         (hipError_t, const char **);
326 typedef hipError_t (HIP_API_CALL *HIP_HIPINIT)                   (unsigned int);
327 typedef hipError_t (HIP_API_CALL *HIP_HIPLAUNCHKERNEL)           (hipFunction_t, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, hipStream_t, void **, void **);
328 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMALLOC)               (hipDeviceptr_t *, size_t);
329 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMFREE)                (hipDeviceptr_t);
330 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMGETINFO)             (size_t *, size_t *);
331 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYDTODASYNC)        (hipDeviceptr_t, hipDeviceptr_t, size_t, hipStream_t);
332 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYDTOHASYNC)        (void *, hipDeviceptr_t, size_t, hipStream_t);
333 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMCPYHTODASYNC)        (hipDeviceptr_t, const void *, size_t, hipStream_t);
334 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMSETD32ASYNC)         (hipDeviceptr_t, unsigned int, size_t, hipStream_t);
335 typedef hipError_t (HIP_API_CALL *HIP_HIPMEMSETD8ASYNC)          (hipDeviceptr_t, unsigned char, size_t, hipStream_t);
336 typedef hipError_t (HIP_API_CALL *HIP_HIPMODULEGETFUNCTION)      (hipFunction_t *, hipModule_t, const char *);
337 typedef hipError_t (HIP_API_CALL *HIP_HIPMODULEGETGLOBAL)        (hipDeviceptr_t *, size_t *, hipModule_t, const char *);
338 typedef hipError_t (HIP_API_CALL *HIP_HIPMODULELOADDATAEX)       (hipModule_t *, const void *, unsigned int, hipJitOption *, void **);
339 typedef hipError_t (HIP_API_CALL *HIP_HIPMODULEUNLOAD)           (hipModule_t);
340 typedef hipError_t (HIP_API_CALL *HIP_HIPRUNTIMEGETVERSION)      (int *);
341 typedef hipError_t (HIP_API_CALL *HIP_HIPSTREAMCREATE)           (hipStream_t *, unsigned int);
342 typedef hipError_t (HIP_API_CALL *HIP_HIPSTREAMDESTROY)          (hipStream_t);
343 typedef hipError_t (HIP_API_CALL *HIP_HIPSTREAMSYNCHRONIZE)      (hipStream_t);
344 
345 typedef struct hc_hip_lib
346 {
347   hc_dynlib_t lib;
348 
349   HIP_HIPCTXCREATE              hipCtxCreate;
350   HIP_HIPCTXDESTROY             hipCtxDestroy;
351   HIP_HIPCTXPOPCURRENT          hipCtxPopCurrent;
352   HIP_HIPCTXPUSHCURRENT         hipCtxPushCurrent;
353   HIP_HIPCTXSETCURRENT          hipCtxSetCurrent;
354   HIP_HIPCTXSYNCHRONIZE         hipCtxSynchronize;
355   HIP_HIPDEVICEGETATTRIBUTE     hipDeviceGetAttribute;
356   HIP_HIPDEVICEGETCOUNT         hipDeviceGetCount;
357   HIP_HIPDEVICEGET              hipDeviceGet;
358   HIP_HIPDEVICEGETNAME          hipDeviceGetName;
359   HIP_HIPDEVICETOTALMEM         hipDeviceTotalMem;
360   HIP_HIPDRIVERGETVERSION       hipDriverGetVersion;
361   HIP_HIPEVENTCREATE            hipEventCreate;
362   HIP_HIPEVENTDESTROY           hipEventDestroy;
363   HIP_HIPEVENTELAPSEDTIME       hipEventElapsedTime;
364   HIP_HIPEVENTRECORD            hipEventRecord;
365   HIP_HIPEVENTSYNCHRONIZE       hipEventSynchronize;
366   HIP_HIPFUNCGETATTRIBUTE       hipFuncGetAttribute;
367   HIP_HIPGETERRORNAME           hipGetErrorName;
368   HIP_HIPGETERRORSTRING         hipGetErrorString;
369   HIP_HIPINIT                   hipInit;
370   HIP_HIPLAUNCHKERNEL           hipLaunchKernel;
371   HIP_HIPMEMALLOC               hipMemAlloc;
372   HIP_HIPMEMFREE                hipMemFree;
373   HIP_HIPMEMGETINFO             hipMemGetInfo;
374   HIP_HIPMEMCPYDTODASYNC        hipMemcpyDtoDAsync;
375   HIP_HIPMEMCPYDTOHASYNC        hipMemcpyDtoHAsync;
376   HIP_HIPMEMCPYHTODASYNC        hipMemcpyHtoDAsync;
377   HIP_HIPMEMSETD32ASYNC         hipMemsetD32Async;
378   HIP_HIPMEMSETD8ASYNC          hipMemsetD8Async;
379   HIP_HIPMODULEGETFUNCTION      hipModuleGetFunction;
380   HIP_HIPMODULEGETGLOBAL        hipModuleGetGlobal;
381   HIP_HIPMODULELOADDATAEX       hipModuleLoadDataEx;
382   HIP_HIPMODULEUNLOAD           hipModuleUnload;
383   HIP_HIPRUNTIMEGETVERSION      hipRuntimeGetVersion;
384   HIP_HIPSTREAMCREATE           hipStreamCreate;
385   HIP_HIPSTREAMDESTROY          hipStreamDestroy;
386   HIP_HIPSTREAMSYNCHRONIZE      hipStreamSynchronize;
387 
388 } hc_hip_lib_t;
389 
390 typedef hc_hip_lib_t HIP_PTR;
391 
392 #endif // _EXT_HIP_H
393