|
MLIR 22.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) |
| 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) |
| 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(), mgpuMemAlloc(), mgpuMemcpy(), mgpuMemFree(), mgpuMemGetDevicePointer(), mgpuMemHostRegister(), mgpuMemHostUnregister(), mgpuMemset16(), mgpuMemset32(), mgpuModuleGetFunction(), mgpuModuleLoad(), mgpuModuleUnload(), mgpuSetDefaultDevice(), mgpuStreamCreate(), mgpuStreamDestroy(), mgpuStreamSynchronize(), and mgpuStreamWaitEvent().
| hipEvent_t mgpuEventCreate | ( | ) |
Definition at line 89 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventDestroy | ( | hipEvent_t | event | ) |
Definition at line 95 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventRecord | ( | hipEvent_t | event, |
| hipStream_t | stream ) |
Definition at line 103 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventSynchronize | ( | hipEvent_t | event | ) |
Definition at line 99 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 60 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 107 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 118 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 114 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 192 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 200 of file RocmRuntimeWrappers.cpp.
References mgpuMemGetDevicePointer().
| void mgpuMemGetDevicePointer | ( | T * | hostPtr, |
| T ** | devicePtr ) |
Definition at line 185 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Referenced by mgpuMemGetDeviceMemRef1dFloat(), and mgpuMemGetDeviceMemRef1dInt32().
Helper functions for writing mlir example code.
Definition at line 140 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 147 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostRegister(), StridedMemRefType< T, N >::offset, and StridedMemRefType< T, N >::sizes.
Definition at line 170 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 177 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostUnregister(), and StridedMemRefType< T, N >::offset.
Definition at line 130 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 124 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| hipFunction_t mgpuModuleGetFunction | ( | hipModule_t | module, |
| const char * | name ) |
Definition at line 50 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 ) |
Definition at line 41 of file RocmRuntimeWrappers.cpp.
| void mgpuModuleUnload | ( | hipModule_t | module | ) |
Definition at line 46 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuSetDefaultDevice | ( | int32_t | device | ) |
Definition at line 207 of file RocmRuntimeWrappers.cpp.
References defaultDevice, and HIP_REPORT_IF_ERROR.
| hipStream_t mgpuStreamCreate | ( | ) |
Definition at line 71 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamDestroy | ( | hipStream_t | stream | ) |
Definition at line 77 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamSynchronize | ( | hipStream_t | stream | ) |
Definition at line 81 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamWaitEvent | ( | hipStream_t | stream, |
| hipEvent_t | event ) |
Definition at line 85 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
|
static |
Definition at line 33 of file RocmRuntimeWrappers.cpp.