#include "mlir/Conversion/GPUToVulkan/ConvertGPUToVulkanPass.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/Pass/Pass.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FormatVariadic.h"
namespace mlir {
#define GEN_PASS_DEF_CONVERTVULKANLAUNCHFUNCTOVULKANCALLSPASS
#include "mlir/Conversion/Passes.h.inc"
}
usingnamespacemlir;
static constexpr const char *kCInterfaceVulkanLaunch = …;
static constexpr const char *kDeinitVulkan = …;
static constexpr const char *kRunOnVulkan = …;
static constexpr const char *kInitVulkan = …;
static constexpr const char *kSetBinaryShader = …;
static constexpr const char *kSetEntryPoint = …;
static constexpr const char *kSetNumWorkGroups = …;
static constexpr const char *kSPIRVBinary = …;
static constexpr const char *kSPIRVBlobAttrName = …;
static constexpr const char *kSPIRVEntryPointAttrName = …;
static constexpr const char *kSPIRVElementTypesAttrName = …;
static constexpr const char *kVulkanLaunch = …;
namespace {
class VulkanLaunchFuncToVulkanCallsPass
: public impl::ConvertVulkanLaunchFuncToVulkanCallsPassBase<
VulkanLaunchFuncToVulkanCallsPass> { … };
}
void VulkanLaunchFuncToVulkanCallsPass::runOnOperation() { … }
void VulkanLaunchFuncToVulkanCallsPass::collectSPIRVAttributes(
LLVM::CallOp vulkanLaunchCallOp) { … }
void VulkanLaunchFuncToVulkanCallsPass::createBindMemRefCalls(
LLVM::CallOp cInterfaceVulkanLaunchCallOp, Value vulkanRuntime) { … }
LogicalResult
VulkanLaunchFuncToVulkanCallsPass::deduceMemRefRank(Value launchCallArg,
uint32_t &rank) { … }
void VulkanLaunchFuncToVulkanCallsPass::declareVulkanFunctions(Location loc) { … }
Value VulkanLaunchFuncToVulkanCallsPass::createEntryPointNameConstant(
StringRef name, Location loc, OpBuilder &builder) { … }
void VulkanLaunchFuncToVulkanCallsPass::translateVulkanLaunchCall(
LLVM::CallOp cInterfaceVulkanLaunchCallOp) { … }