File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
mlir/lib/Dialect/NVGPU/TransformOps Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 9
9
#include " mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.h"
10
10
11
11
#include " mlir/Analysis/SliceAnalysis.h"
12
+ #include " mlir/Conversion/GPUCommon/GPUCommonPass.h"
12
13
#include " mlir/Conversion/LLVMCommon/TypeConverter.h"
13
14
#include " mlir/Conversion/NVGPUToNVVM/NVGPUToNVVM.h"
14
15
#include " mlir/Dialect/Affine/IR/AffineOps.h"
@@ -51,6 +52,21 @@ void transform::ApplyNVGPUToNVVMConversionPatternsOp::populatePatterns(
51
52
// / device-side async tokens cannot be materialized in nvvm. We just
52
53
// / convert them to a dummy i32 type in order to easily drop them during
53
54
// / conversion.
55
+ populateGpuMemorySpaceAttributeConversions (
56
+ llvmTypeConverter, [](gpu::AddressSpace space) -> unsigned {
57
+ switch (space) {
58
+ case gpu::AddressSpace::Global:
59
+ return static_cast <unsigned >(
60
+ NVVM::NVVMMemorySpace::kGlobalMemorySpace );
61
+ case gpu::AddressSpace::Workgroup:
62
+ return static_cast <unsigned >(
63
+ NVVM::NVVMMemorySpace::kSharedMemorySpace );
64
+ case gpu::AddressSpace::Private:
65
+ return 0 ;
66
+ }
67
+ llvm_unreachable (" unknown address space enum value" );
68
+ return 0 ;
69
+ });
54
70
llvmTypeConverter.addConversion (
55
71
[&](nvgpu::DeviceAsyncTokenType type) -> Type {
56
72
return llvmTypeConverter.convertType (
You can’t perform that action at this time.
0 commit comments