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