Skip to content

Commit

Permalink
Disabled the path and test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyPavlenko committed Sep 24, 2024
1 parent 443ff0e commit cc11292
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
49 changes: 28 additions & 21 deletions lib/gc/Transforms/GPU/Pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,49 @@
//
//===----------------------------------------------------------------------===//

#include <string>

#include "gc/Transforms/Passes.h"

#include "imex/Conversion/Passes.h"
#include "imex/Transforms/Passes.h"

#include "mlir/Conversion/Passes.h"
#include "mlir/Dialect/Arith/Transforms/Passes.h"
#include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/GPU/Transforms/Passes.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/Transforms/Passes.h"
#include "mlir/Dialect/Linalg/Passes.h"
#include "mlir/Dialect/Math/Transforms/Passes.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Transforms/Passes.h"
#include "mlir/Dialect/SPIRV/Transforms/Passes.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/IR/DialectRegistry.h"
#include "mlir/InitAllPasses.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/Passes.h"
#include <iostream>

#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/GPU/Transforms/Passes.h"
#include "mlir/Dialect/SPIRV/Transforms/Passes.h"

#include <imex/Conversion/Passes.h>
#include <imex/Transforms/Passes.h>

#include <string>

#include "gc/Transforms/Passes.h"

namespace mlir::gc {

struct GPUPipelineOption : PassPipelineOptions<GPUPipelineOption> {
Option<bool> isUsmArgs{
PassOptions::Option<bool> isUsmArgs{
*this, "is-usm-args",
desc("Whether to use USM(unified shared memory) func args, in "
"which the host and device could access the same buffer "
"and there is no need to add memcpy explicitly"),
init(true)};
llvm::cl::desc("Whether to use USM(unified shared memory) func args, in "
"which the host and device could access the same buffer "
"and there is no need to add memcpy explicitly"),
llvm::cl::init(true)};
};

void populateGPUPipeline(OpPassManager &pm,
void populateGPUPipeline(mlir::OpPassManager &pm,
const GPUPipelineOption &pipelineOption) {
// Add an argument for the GPU context
pm.addNestedPass<func::FuncOp>(createAddContextArg());

pm.addNestedPass<func::FuncOp>(createIterativeTilingAndFusion());

pm.addPass(bufferization::createEmptyTensorEliminationPass());
Expand Down Expand Up @@ -84,7 +91,6 @@ void populateGPUPipeline(OpPassManager &pm,
/*isUsmArgs*/ pipelineOption.isUsmArgs.getValue()};
pm.addNestedPass<func::FuncOp>(
imex::createInsertGPUAllocsPass(insertGPUAllocsOption));

pm.addPass(createGpuKernelOutliningPass());
pm.addPass(createCanonicalizerPass());
pm.addPass(imex::createSetSPIRVCapabilitiesPass());
Expand All @@ -103,14 +109,15 @@ void populateGPUPipeline(OpPassManager &pm,
pm.addNestedPass<func::FuncOp>(LLVM::createRequestCWrappersPass());
pm.addPass(imex::createSerializeSPIRVPass());
pm.addPass(createConvertVectorToSCFPass());
pm.addPass(imex::createConvertGPUToGPUXPass());
pm.addPass(createConvertSCFToCFPass());
pm.addPass(createConvertControlFlowToLLVMPass());
pm.addPass(createConvertVectorToLLVMPass());
pm.addPass(createConvertIndexToLLVMPass());
pm.addPass(createArithToLLVMConversionPass());
pm.addPass(createConvertFuncToLLVMPass());
pm.addPass(createConvertMathToLLVMPass());
pm.addPass(createGpuToGpuOcl());
pm.addPass(imex::createConvertGPUXToLLVMPass());
pm.addPass(createConvertIndexToLLVMPass());
pm.addPass(memref::createExpandStridedMetadataPass());
pm.addPass(createLowerAffinePass());
Expand Down
5 changes: 4 additions & 1 deletion test/mlir/test/gc/Transforms/GPU/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
if not config.gc_use_imex:
config.unsupported = True
config.unsupported = True
else:
# FIXME: Enable when the #343 is merged.
config.excludes = ['gpu-to-gpuocl.mlir']

0 comments on commit cc11292

Please sign in to comment.