Changeset View
Changeset View
Standalone View
Standalone View
mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp
//===- mlir-cpu-runner.cpp - MLIR CPU Execution Driver---------------------===// | //===- mlir-cpu-runner.cpp - MLIR CPU Execution Driver---------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Main entry point to a command line utility that executes an MLIR file on the | // Main entry point to a command line utility that executes an MLIR file on the | ||||
// CPU by translating MLIR to LLVM IR before JIT-compiling and executing the | // CPU by translating MLIR to LLVM IR before JIT-compiling and executing the | ||||
// latter. | // latter. | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#include "mlir/InitAllDialects.h" | |||||
#include "mlir/Support/JitRunner.h" | #include "mlir/Support/JitRunner.h" | ||||
#include "llvm/Support/InitLLVM.h" | |||||
#include "llvm/Support/TargetSelect.h" | |||||
#include "mlir/ExecutionEngine/OptUtils.h" | |||||
int main(int argc, char **argv) { | int main(int argc, char **argv) { | ||||
mlir::registerAllDialects(); | |||||
llvm::InitLLVM y(argc, argv); | |||||
llvm::InitializeNativeTarget(); | |||||
llvm::InitializeNativeTargetAsmPrinter(); | |||||
mlir::initializeLLVMPasses(); | |||||
return mlir::JitRunnerMain(argc, argv, nullptr); | return mlir::JitRunnerMain(argc, argv, nullptr); | ||||
} | } |