Files
clang-p2996/mlir/test/lib/Transforms/TestAllReduceLowering.cpp
Christian Sigg 8b2eb7c494 [mlir] Add in-dialect lowering of gpu.all_reduce.
Reviewers: ftynse, nicolasvasilache, herhut

Reviewed By: ftynse, herhut

Subscribers: liufengdb, aartbik, herhut, merge_guards_bot, mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72129
2020-01-20 13:43:43 +01:00

33 lines
1.1 KiB
C++

//===- TestAllReduceLowering.cpp - Test gpu.all_reduce lowering -----------===//
//
// Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file contains test passes for lowering the gpu.all_reduce op.
//
//===----------------------------------------------------------------------===//
#include "mlir/Dialect/GPU/Passes.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
using namespace mlir;
namespace {
struct TestAllReduceLoweringPass
: public ModulePass<TestAllReduceLoweringPass> {
void runOnModule() override {
OwningRewritePatternList patterns;
populateGpuRewritePatterns(&getContext(), patterns);
applyPatternsGreedily(getModule(), patterns);
}
};
} // namespace
static PassRegistration<TestAllReduceLoweringPass>
pass("test-all-reduce-lowering",
"Lowers gpu.all-reduce ops within the GPU dialect.");