|
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) |
| 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 90 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventDestroy | ( | hipEvent_t | event | ) |
Definition at line 96 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventRecord | ( | hipEvent_t | event, |
| hipStream_t | stream ) |
Definition at line 104 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuEventSynchronize | ( | hipEvent_t | event | ) |
Definition at line 100 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.
Definition at line 108 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 119 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 115 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 193 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 201 of file RocmRuntimeWrappers.cpp.
References mgpuMemGetDevicePointer().
| void mgpuMemGetDevicePointer | ( | T * | hostPtr, |
| T ** | devicePtr ) |
Definition at line 186 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Referenced by mgpuMemGetDeviceMemRef1dFloat(), and mgpuMemGetDeviceMemRef1dInt32().
Helper functions for writing mlir example code.
Definition at line 141 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 148 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostRegister(), StridedMemRefType< T, N >::offset, and StridedMemRefType< T, N >::sizes.
Definition at line 171 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 178 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostUnregister(), and StridedMemRefType< T, N >::offset.
Definition at line 131 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Definition at line 125 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 208 of file RocmRuntimeWrappers.cpp.
References defaultDevice, and HIP_REPORT_IF_ERROR.
| hipStream_t mgpuStreamCreate | ( | ) |
Definition at line 72 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamDestroy | ( | hipStream_t | stream | ) |
Definition at line 78 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamSynchronize | ( | hipStream_t | stream | ) |
Definition at line 82 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| void mgpuStreamWaitEvent | ( | hipStream_t | stream, |
| hipEvent_t | event ) |
Definition at line 86 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
|
static |
Definition at line 33 of file RocmRuntimeWrappers.cpp.