28 lines · plain
1// RUN: mlir-opt --allow-unregistered-dialect --map-memref-spirv-storage-class='client-api=vulkan' %s | FileCheck %s2 3// Vulkan Specific Mappings:4// 8 -> UniformConstant5// 9 -> Input6// 10 -> Output7// 11 -> PhysicalStorageBuffer8// 12 -> Image9 10/// Check that Vulkan specific memory space indices get converted into the correct11/// SPIR-V storage class. If mappings to OpenCL address spaces are added for these12/// indices then those test case should be moved into the common test file.13 14// CHECK-LABEL: func @test_vk_specific_memory_spaces15func.func @test_vk_specific_memory_spaces() {16 // CHECK: memref<4xi32, #spirv.storage_class<UniformConstant>>17 %1 = "dialect.memref_producer"() : () -> (memref<4xi32, 8>)18 // CHECK: memref<4xi32, #spirv.storage_class<Input>>19 %2 = "dialect.memref_producer"() : () -> (memref<4xi32, 9>)20 // CHECK: memref<4xi32, #spirv.storage_class<Output>>21 %3 = "dialect.memref_producer"() : () -> (memref<4xi32, 10>)22 // CHECK: memref<4xi32, #spirv.storage_class<PhysicalStorageBuffer>>23 %4 = "dialect.memref_producer"() : () -> (memref<4xi32, 11>)24 // CHECK: memref<4xi32, #spirv.storage_class<Image>>25 %5 = "dialect.memref_producer"() : () -> (memref<4xi32, 12>)26 return27}28