Fix GCC build problem with 288f05f related to SmallVector. (#116958)
[llvm-project.git] / mlir / lib / Conversion / GPUCommon / AttrToSPIRVConverter.cpp
blobfcabad32974acb76dc21ec4ab87cbb1a91891ef7
1 //===- AttrToSPIRVConverter.cpp - GPU attributes conversion to SPIR-V - C++===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include <mlir/Conversion/GPUCommon/AttrToSPIRVConverter.h>
11 namespace mlir {
12 spirv::StorageClass addressSpaceToStorageClass(gpu::AddressSpace addressSpace) {
13 switch (addressSpace) {
14 case gpu::AddressSpace::Global:
15 return spirv::StorageClass::CrossWorkgroup;
16 case gpu::AddressSpace::Workgroup:
17 return spirv::StorageClass::Workgroup;
18 case gpu::AddressSpace::Private:
19 return spirv::StorageClass::Private;
21 llvm_unreachable("Unhandled storage class");
23 } // namespace mlir