1
1
// RUN: mlir-opt -split-input-file -allow-unregistered-dialect -map-memref-spirv-storage-class='client-api=vulkan' -verify-diagnostics %s -o - | FileCheck %s --check-prefix=VULKAN
2
2
// RUN: mlir-opt -split-input-file -allow-unregistered-dialect -map-memref-spirv-storage-class='client-api=opencl' -verify-diagnostics %s -o - | FileCheck %s --check-prefix=OPENCL
3
+ // RUN: mlir-opt -split-input-file -allow-unregistered-dialect -map-memref-spirv-storage-class -verify-diagnostics %s -o - | FileCheck %s
3
4
4
5
// Vulkan Mappings:
5
6
// 0 -> StorageBuffer
6
7
// 1 -> Generic
7
8
// 2 -> [null]
8
9
// 3 -> Workgroup
9
10
// 4 -> Uniform
11
+ // 5 -> Private
12
+ // 6 -> Function
13
+ // 7 -> PushConstant
14
+ // 8 -> UniformConstant
15
+ // 9 -> Input
16
+ // 10 -> Output
17
+ // 11 -> PhysicalStorageBuffer
18
+ // 12 -> Image
10
19
11
20
// OpenCL Mappings:
12
21
// 0 -> CrossWorkgroup
13
22
// 1 -> Generic
14
23
// 2 -> [null]
15
24
// 3 -> Workgroup
16
25
// 4 -> UniformConstant
26
+ // 5 -> Private
27
+ // 6 -> Function
28
+ // 7 -> Image
17
29
18
30
// VULKAN-LABEL: func @operand_result
19
31
// OPENCL-LABEL: func @operand_result
@@ -30,6 +42,15 @@ func.func @operand_result() {
30
42
// VULKAN: memref<*xf16, #spirv.storage_class<Uniform>>
31
43
// OPENCL: memref<*xf16, #spirv.storage_class<UniformConstant>>
32
44
%3 = " dialect.memref_producer" () : () -> (memref <*xf16 , 4 >)
45
+ // VULKAN: memref<*xf16, #spirv.storage_class<Private>>
46
+ // OPENCL: memref<*xf16, #spirv.storage_class<Private>>
47
+ %4 = " dialect.memref_producer" () : () -> (memref <*xf16 , 5 >)
48
+ // VULKAN: memref<*xf16, #spirv.storage_class<Function>>
49
+ // OPENCL: memref<*xf16, #spirv.storage_class<Function>>
50
+ %5 = " dialect.memref_producer" () : () -> (memref <*xf16 , 6 >)
51
+ // VULKAN: memref<*xf16, #spirv.storage_class<PushConstant>>
52
+ // OPENCL: memref<*xf16, #spirv.storage_class<Image>>
53
+ %6 = " dialect.memref_producer" () : () -> (memref <*xf16 , 7 >)
33
54
34
55
35
56
" dialect.memref_consumer" (%0 ) : (memref <f32 >) -> ()
@@ -42,6 +63,15 @@ func.func @operand_result() {
42
63
// VULKAN: memref<*xf16, #spirv.storage_class<Uniform>>
43
64
// OPENCL: memref<*xf16, #spirv.storage_class<UniformConstant>>
44
65
" dialect.memref_consumer" (%3 ) : (memref <*xf16 , 4 >) -> ()
66
+ // VULKAN: memref<*xf16, #spirv.storage_class<Private>>
67
+ // OPENCL: memref<*xf16, #spirv.storage_class<Private>>
68
+ " dialect.memref_consumer" (%4 ) : (memref <*xf16 , 5 >) -> ()
69
+ // VULKAN: memref<*xf16, #spirv.storage_class<Function>>
70
+ // OPENCL: memref<*xf16, #spirv.storage_class<Function>>
71
+ " dialect.memref_consumer" (%5 ) : (memref <*xf16 , 6 >) -> ()
72
+ // VULKAN: memref<*xf16, #spirv.storage_class<PushConstant>>
73
+ // OPENCL: memref<*xf16, #spirv.storage_class<Image>>
74
+ " dialect.memref_consumer" (%6 ) : (memref <*xf16 , 7 >) -> ()
45
75
46
76
return
47
77
}
@@ -166,4 +196,4 @@ func.func @operand_result() {
166
196
" dialect.memref_consumer" (%3 ) : (memref <*xf16 , 4 >) -> ()
167
197
return
168
198
}
169
- }
199
+ }
0 commit comments