From 5b41ac8a4de3f2e8e5cd2bbd9364ddd023358f75 Mon Sep 17 00:00:00 2001 From: Felix Reissmann Date: Tue, 3 Sep 2024 21:27:16 +0200 Subject: [PATCH] Fix compilation errors in cnm-to-gpu and cinm-vulkan-runner. --- cinnamon/lib/Conversion/CnmToGPU/CnmToGPU.cpp | 10 +++++----- .../tools/cinm-vulkan-runner/cinm-vulkan-runner.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cinnamon/lib/Conversion/CnmToGPU/CnmToGPU.cpp b/cinnamon/lib/Conversion/CnmToGPU/CnmToGPU.cpp index 4912c30..0001257 100644 --- a/cinnamon/lib/Conversion/CnmToGPU/CnmToGPU.cpp +++ b/cinnamon/lib/Conversion/CnmToGPU/CnmToGPU.cpp @@ -314,19 +314,19 @@ void populateCnmToGPUFinalTypeConversions(TypeConverter &typeConverter) { }); } -void populateCnmToGPUConversionPatterns(TypeConverter &typeConverter, - RewritePatternSet &patterns) { +void populateCnmToGPUConversionPatterns(RewritePatternSet &patterns, + MLIRContext *context) { patterns .add(&typeConverter.getContext()); + cnmtogpu::ConvertCnmTerminatorToGPU>(context); } struct ConvertCnmToGPUPass : public ::impl::ConvertCnmToGPUPassBase { void runOnOperation() final { - TypeConverter converter(&getContext()); + TypeConverter converter{}; populateCnmToGPUFinalTypeConversions(converter); const auto addUnrealizedCast = [](OpBuilder &builder, Type type, ValueRange inputs, Location loc) { @@ -337,7 +337,7 @@ struct ConvertCnmToGPUPass converter.addTargetMaterialization(addUnrealizedCast); RewritePatternSet patterns(&getContext()); - populateCnmToGPUConversionPatterns(converter, patterns); + populateCnmToGPUConversionPatterns(patterns, &getContext()); populateReconcileUnrealizedCastsPatterns(patterns); ConversionTarget target(getContext()); diff --git a/cinnamon/tools/cinm-vulkan-runner/cinm-vulkan-runner.cpp b/cinnamon/tools/cinm-vulkan-runner/cinm-vulkan-runner.cpp index 6625000..05f5b89 100644 --- a/cinnamon/tools/cinm-vulkan-runner/cinm-vulkan-runner.cpp +++ b/cinnamon/tools/cinm-vulkan-runner/cinm-vulkan-runner.cpp @@ -59,7 +59,7 @@ static LogicalResult runMLIRPasses(Operation *op) { passManager.addPass(createLowerAffinePass()); // affine.apply -> arith ops passManager.addPass(createCnmSPIRVAttachTargetAttributePass( - CnmSPIRVAttachTargetAttributePassOptions{ + cnm::CnmSPIRVAttachTargetAttributePassOptions{ .spirvCapabilities = {"Shader"}, .spirvExtensions = {"SPV_KHR_storage_buffer_storage_class"}, })); @@ -67,7 +67,7 @@ static LogicalResult runMLIRPasses(Operation *op) { OpPassManager &gpuModulePM = passManager.nest(); gpuModulePM.addPass(createConvertMemRefToSPIRVPass()); gpuModulePM.addPass(createConvertControlFlowToSPIRVPass()); - gpuModulePM.addPass(createCnmSPIRVAttachKernelEntryPointAttributePass()); + gpuModulePM.addPass(cnm::createCnmSPIRVAttachKernelEntryPointAttributePass()); passManager.addPass(createConvertGPUToSPIRVPass(/*mapMemorySpace=*/true));