|
MLIR 23.0.0git
|
#include <cassert>#include <numeric>#include "mlir/ExecutionEngine/CRunnerUtils.h"#include "llvm/ADT/ArrayRef.h"#include "hip/hip_runtime.h"Go to the source code of this file.
Macros | |
| #define | HIP_REPORT_IF_ERROR(expr) |
Functions | |
| hipModule_t | mgpuModuleLoad (void *data, size_t) |
| hipModule_t | mgpuModuleLoadJIT (void *data, int optLevel, size_t) |
| void | mgpuModuleUnload (hipModule_t module) |
| hipFunction_t | mgpuModuleGetFunction (hipModule_t module, const char *name) |
| void | mgpuLaunchKernel (hipFunction_t function, intptr_t gridX, intptr_t gridY, intptr_t gridZ, intptr_t blockX, intptr_t blockY, intptr_t blockZ, int32_t smem, hipStream_t stream, void **params, void **extra, size_t) |
| void | mgpuLaunchKernelCooperative (hipFunction_t function, intptr_t gridX, intptr_t gridY, intptr_t gridZ, intptr_t clusterX, intptr_t clusterY, intptr_t clusterZ, intptr_t blockX, intptr_t blockY, intptr_t blockZ, int32_t smem, hipStream_t stream, void **params, void **) |
| hipStream_t | mgpuStreamCreate () |
| void | mgpuStreamDestroy (hipStream_t stream) |
| void | mgpuStreamSynchronize (hipStream_t stream) |
| void | mgpuStreamWaitEvent (hipStream_t stream, hipEvent_t event) |
| hipEvent_t | mgpuEventCreate () |
| void | mgpuEventDestroy (hipEvent_t event) |
| void | mgpuEventSynchronize (hipEvent_t event) |
| void | mgpuEventRecord (hipEvent_t event, hipStream_t stream) |
| void * | mgpuMemAlloc (uint64_t sizeBytes, hipStream_t, bool) |
| void | mgpuMemFree (void *ptr, hipStream_t) |
| void | mgpuMemcpy (void *dst, void *src, size_t sizeBytes, hipStream_t stream) |
| void | mgpuMemset32 (void *dst, int value, size_t count, hipStream_t stream) |
| void | mgpuMemset16 (void *dst, int short value, size_t count, hipStream_t stream) |
| void | mgpuMemHostRegister (void *ptr, uint64_t sizeBytes) |
| Helper functions for writing mlir example code. | |
| void | mgpuMemHostRegisterMemRef (int64_t rank, StridedMemRefType< char, 1 > *descriptor, int64_t elementSizeBytes) |
| void | mgpuMemHostUnregister (void *ptr) |
| void | mgpuMemHostUnregisterMemRef (int64_t rank, StridedMemRefType< char, 1 > *descriptor, int64_t elementSizeBytes) |
| template<typename T> | |
| void | mgpuMemGetDevicePointer (T *hostPtr, T **devicePtr) |
| StridedMemRefType< float, 1 > | mgpuMemGetDeviceMemRef1dFloat (float *allocated, float *aligned, int64_t offset, int64_t size, int64_t stride) |
| StridedMemRefType< int32_t, 1 > | mgpuMemGetDeviceMemRef1dInt32 (int32_t *allocated, int32_t *aligned, int64_t offset, int64_t size, int64_t stride) |
| void | mgpuSetDefaultDevice (int32_t device) |
Variables | |
| static thread_local int32_t | defaultDevice = 0 |
| #define HIP_REPORT_IF_ERROR | ( | expr | ) |
Definition at line 23 of file RocmRuntimeWrappers.cpp.
Referenced by mgpuEventCreate(), mgpuEventDestroy(), mgpuEventRecord(), mgpuEventSynchronize(), mgpuLaunchKernel(), mgpuLaunchKernelCooperative(), mgpuMemAlloc(), mgpuMemcpy(), mgpuMemFree(), mgpuMemGetDevicePointer(), mgpuMemHostRegister(), mgpuMemHostUnregister(), mgpuMemset16(), mgpuMemset32(), mgpuModuleGetFunction(), mgpuModuleLoad(), mgpuModuleUnload(), mgpuSetDefaultDevice(), mgpuStreamCreate(), mgpuStreamDestroy(), mgpuStreamSynchronize(), and mgpuStreamWaitEvent().
| hipEvent_t mgpuEventCreate | ( | ) |
Definition at line 110 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventDestroy | ( | hipEvent_t | event | ) |
Definition at line 116 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventRecord | ( | hipEvent_t | event, |
| hipStream_t | stream ) |
Definition at line 124 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventSynchronize | ( | hipEvent_t | event | ) |
Definition at line 120 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuLaunchKernel | ( | hipFunction_t | function, |
| intptr_t | gridX, | ||
| intptr_t | gridY, | ||
| intptr_t | gridZ, | ||
| intptr_t | blockX, | ||
| intptr_t | blockY, | ||
| intptr_t | blockZ, | ||
| int32_t | smem, | ||
| hipStream_t | stream, | ||
| void ** | params, | ||
| void ** | extra, | ||
| size_t | ) |
Definition at line 61 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuLaunchKernelCooperative | ( | hipFunction_t | function, |
| intptr_t | gridX, | ||
| intptr_t | gridY, | ||
| intptr_t | gridZ, | ||
| intptr_t | clusterX, | ||
| intptr_t | clusterY, | ||
| intptr_t | clusterZ, | ||
| intptr_t | blockX, | ||
| intptr_t | blockY, | ||
| intptr_t | blockZ, | ||
| int32_t | smem, | ||
| hipStream_t | stream, | ||
| void ** | params, | ||
| void ** | ) |
Definition at line 75 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 128 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 139 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 135 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| StridedMemRefType< float, 1 > mgpuMemGetDeviceMemRef1dFloat | ( | float * | allocated, |
| float * | aligned, | ||
| int64_t | offset, | ||
| int64_t | size, | ||
| int64_t | stride ) |
Definition at line 213 of file RocmRuntimeWrappers.cpp.
References mgpuMemGetDevicePointer().
| StridedMemRefType< int32_t, 1 > mgpuMemGetDeviceMemRef1dInt32 | ( | int32_t * | allocated, |
| int32_t * | aligned, | ||
| int64_t | offset, | ||
| int64_t | size, | ||
| int64_t | stride ) |
Definition at line 221 of file RocmRuntimeWrappers.cpp.
References mgpuMemGetDevicePointer().
| void mgpuMemGetDevicePointer | ( | T * | hostPtr, |
| T ** | devicePtr ) |
Definition at line 206 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Referenced by mgpuMemGetDeviceMemRef1dFloat(), and mgpuMemGetDeviceMemRef1dInt32().
Helper functions for writing mlir example code.
Definition at line 161 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Referenced by mgpuMemHostRegisterMemRef().
| void mgpuMemHostRegisterMemRef | ( | int64_t | rank, |
| StridedMemRefType< char, 1 > * | descriptor, | ||
| int64_t | elementSizeBytes ) |
Definition at line 168 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostRegister(), StridedMemRefType< T, N >::offset, and StridedMemRefType< T, N >::sizes.
Definition at line 191 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Referenced by mgpuMemHostUnregisterMemRef().
| void mgpuMemHostUnregisterMemRef | ( | int64_t | rank, |
| StridedMemRefType< char, 1 > * | descriptor, | ||
| int64_t | elementSizeBytes ) |
Definition at line 198 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostUnregister(), and StridedMemRefType< T, N >::offset.
Definition at line 151 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 145 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| hipFunction_t mgpuModuleGetFunction | ( | hipModule_t | module, |
| const char * | name ) |
Definition at line 51 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| hipModule_t mgpuModuleLoad | ( | void * | data, |
| size_t | ) |
Definition at line 35 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| hipModule_t mgpuModuleLoadJIT | ( | void * | data, |
| int | optLevel, | ||
| size_t | ) |
Definition at line 41 of file RocmRuntimeWrappers.cpp.
| void mgpuModuleUnload | ( | hipModule_t | module | ) |
Definition at line 47 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuSetDefaultDevice | ( | int32_t | device | ) |
Definition at line 228 of file RocmRuntimeWrappers.cpp.
References defaultDevice, and HIP_REPORT_IF_ERROR.
| hipStream_t mgpuStreamCreate | ( | ) |
Definition at line 92 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamDestroy | ( | hipStream_t | stream | ) |
Definition at line 98 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamSynchronize | ( | hipStream_t | stream | ) |
Definition at line 102 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamWaitEvent | ( | hipStream_t | stream, |
| hipEvent_t | event ) |
Definition at line 106 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
|
static |
Definition at line 33 of file RocmRuntimeWrappers.cpp.