#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.h"
#include "mlir/Target/LLVMIR/Export.h"
#include "mlir/Target/LLVMIR/ModuleTranslation.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/FormatVariadic.h"
usingnamespacemlir;
namespace {
class SelectObjectAttrImpl
: public gpu::OffloadingLLVMTranslationAttrInterface::FallbackModel<
SelectObjectAttrImpl> { … };
std::string getBinaryIdentifier(StringRef binaryName) { … }
}
void mlir::gpu::registerOffloadingLLVMTranslationInterfaceExternalModels(
DialectRegistry ®istry) { … }
gpu::ObjectAttr
SelectObjectAttrImpl::getSelectedObject(gpu::BinaryOp op) const { … }
LogicalResult SelectObjectAttrImpl::embedBinary(
Attribute attribute, Operation *operation, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) const { … }
namespace llvm {
namespace {
class LaunchKernel { … };
}
}
LogicalResult SelectObjectAttrImpl::launchKernel(
Attribute attribute, Operation *launchFuncOperation,
Operation *binaryOperation, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation) const { … }
llvm::LaunchKernel::LaunchKernel(
Module &module, IRBuilderBase &builder,
mlir::LLVM::ModuleTranslation &moduleTranslation)
: … { … }
llvm::FunctionCallee llvm::LaunchKernel::getKernelLaunchFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getClusterKernelLaunchFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getModuleFunctionFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getModuleLoadFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getModuleLoadJITFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getModuleUnloadFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getStreamCreateFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getStreamDestroyFn() { … }
llvm::FunctionCallee llvm::LaunchKernel::getStreamSyncFn() { … }
llvm::Value *llvm::LaunchKernel::getOrCreateFunctionName(StringRef moduleName,
StringRef kernelName) { … }
llvm::Value *
llvm::LaunchKernel::createKernelArgArray(mlir::gpu::LaunchFuncOp op) { … }
llvm::LogicalResult
llvm::LaunchKernel::createKernelLaunch(mlir::gpu::LaunchFuncOp op,
mlir::gpu::ObjectAttr object) { … }