|
MLIR 24.0.0git
|
#include <cassert>#include <cstdint>#include <cstdio>#include "mlir/ExecutionEngine/CRunnerUtils.h"#include "hip/hip_runtime.h"Go to the source code of this file.
Macros | |
| #define | MLIR_ROCM_WRAPPERS_EXPORT __attribute__((visibility("default"))) |
| #define | HIP_REPORT_IF_ERROR(expr) |
Variables | |
| static thread_local int32_t | defaultDevice = 0 |
| #define HIP_REPORT_IF_ERROR | ( | expr | ) |
Definition at line 29 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().
| #define MLIR_ROCM_WRAPPERS_EXPORT __attribute__((visibility("default"))) |
Definition at line 26 of file RocmRuntimeWrappers.cpp.
Referenced by mgpuEventCreate(), mgpuEventDestroy(), mgpuEventRecord(), mgpuLaunchKernelCooperative(), mgpuMemAlloc(), mgpuMemFree(), mgpuMemHostUnregister(), mgpuModuleUnload(), mgpuSetDefaultDevice(), and mgpuStreamCreate().
| MLIR_ROCM_WRAPPERS_EXPORT hipEvent_t mgpuEventCreate | ( | ) |
Definition at line 119 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuEventDestroy | ( | hipEvent_t | event | ) |
Definition at line 125 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuEventRecord | ( | hipEvent_t | event, |
| hipStream_t | stream ) |
Definition at line 134 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuEventSynchronize | ( | hipEvent_t | event | ) |
Definition at line 130 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT 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 69 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT 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 81 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT void * mgpuMemAlloc | ( | uint64_t | sizeBytes, |
| hipStream_t | , | ||
| bool | ) |
Definition at line 139 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemcpy | ( | void * | dst, |
| void * | src, | ||
| size_t | sizeBytes, | ||
| hipStream_t | stream ) |
Definition at line 153 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemFree | ( | void * | ptr, |
| hipStream_t | ) |
Definition at line 147 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT StridedMemRefType< float, 1 > mgpuMemGetDeviceMemRef1dFloat | ( | float * | allocated, |
| float * | aligned, | ||
| int64_t | offset, | ||
| int64_t | size, | ||
| int64_t | stride ) |
Definition at line 222 of file RocmRuntimeWrappers.cpp.
References mgpuMemGetDevicePointer().
| MLIR_ROCM_WRAPPERS_EXPORT StridedMemRefType< int32_t, 1 > mgpuMemGetDeviceMemRef1dInt32 | ( | int32_t * | allocated, |
| int32_t * | aligned, | ||
| int64_t | offset, | ||
| int64_t | size, | ||
| int64_t | stride ) |
Definition at line 230 of file RocmRuntimeWrappers.cpp.
References mgpuMemGetDevicePointer().
| void mgpuMemGetDevicePointer | ( | T * | hostPtr, |
| T ** | devicePtr ) |
Definition at line 215 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Referenced by mgpuMemGetDeviceMemRef1dFloat(), and mgpuMemGetDeviceMemRef1dInt32().
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemHostRegister | ( | void * | ptr, |
| uint64_t | sizeBytes ) |
Helper functions for writing mlir example code.
Definition at line 175 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
Referenced by mgpuMemHostRegisterMemRef().
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemHostRegisterMemRef | ( | int64_t | rank, |
| StridedMemRefType< char, 1 > * | descriptor, | ||
| int64_t | elementSizeBytes ) |
Definition at line 182 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostRegister(), StridedMemRefType< T, N >::offset, and StridedMemRefType< T, N >::sizes.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemHostUnregister | ( | void * | ptr | ) |
Definition at line 200 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
Referenced by mgpuMemHostUnregisterMemRef().
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemHostUnregisterMemRef | ( | int64_t | rank, |
| StridedMemRefType< char, 1 > * | descriptor, | ||
| int64_t | elementSizeBytes ) |
Definition at line 207 of file RocmRuntimeWrappers.cpp.
References StridedMemRefType< T, N >::data, mgpuMemHostUnregister(), and StridedMemRefType< T, N >::offset.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemset16 | ( | void * | dst, |
| int short | value, | ||
| size_t | count, | ||
| hipStream_t | stream ) |
Definition at line 165 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuMemset32 | ( | void * | dst, |
| int | value, | ||
| size_t | count, | ||
| hipStream_t | stream ) |
Definition at line 159 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT hipFunction_t mgpuModuleGetFunction | ( | hipModule_t | module, |
| const char * | name ) |
Definition at line 59 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT hipModule_t mgpuModuleLoad | ( | void * | data, |
| size_t | ) |
Definition at line 42 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT hipModule_t mgpuModuleLoadJIT | ( | void * | data, |
| int | optLevel, | ||
| size_t | ) |
Definition at line 49 of file RocmRuntimeWrappers.cpp.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuModuleUnload | ( | hipModule_t | module | ) |
Definition at line 54 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuSetDefaultDevice | ( | int32_t | device | ) |
Definition at line 237 of file RocmRuntimeWrappers.cpp.
References defaultDevice, HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT hipStream_t mgpuStreamCreate | ( | ) |
Definition at line 98 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR, and MLIR_ROCM_WRAPPERS_EXPORT.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuStreamDestroy | ( | hipStream_t | stream | ) |
Definition at line 105 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuStreamSynchronize | ( | hipStream_t | stream | ) |
Definition at line 110 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
| MLIR_ROCM_WRAPPERS_EXPORT void mgpuStreamWaitEvent | ( | hipStream_t | stream, |
| hipEvent_t | event ) |
Definition at line 115 of file RocmRuntimeWrappers.cpp.
References HIP_REPORT_IF_ERROR.
|
static |
Definition at line 39 of file RocmRuntimeWrappers.cpp.