1 | //===- MeshOps.cpp - MLIR SPIR-V Mesh Ops --------------------------------===// |
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 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // Defines the mesh operations in the SPIR-V dialect. |
10 | // |
11 | //===----------------------------------------------------------------------===// |
12 | |
13 | #include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h" |
14 | #include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" |
15 | #include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h" |
16 | |
17 | using namespace mlir; |
18 | |
19 | //===----------------------------------------------------------------------===// |
20 | // spirv.EXT.EmitMeshTasks |
21 | //===----------------------------------------------------------------------===// |
22 | |
23 | LogicalResult spirv::EXTEmitMeshTasksOp::verify() { |
24 | if (Value payload = getPayload()) { |
25 | // The operand definition restricts type to be SPIRV_AnyPointer, so we can |
26 | // cast here safely. |
27 | auto payloadType = cast<spirv::PointerType>(payload.getType()); |
28 | if (payloadType.getStorageClass() != |
29 | spirv::StorageClass::TaskPayloadWorkgroupEXT) |
30 | return emitOpError("payload must be a variable with a storage class of " |
31 | "TaskPayloadWorkgroupEXT" ); |
32 | } |
33 | return success(); |
34 | } |
35 | |