//===- AtomicOps.cpp - MLIR SPIR-V Atomic Ops ----------------------------===// // // 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 // //===----------------------------------------------------------------------===// // // Defines the atomic operations in the SPIR-V dialect. // //===----------------------------------------------------------------------===// #include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" #include "SPIRVOpUtils.h" #include "SPIRVParsingUtils.h" usingnamespacemlir::spirv::AttrNames; namespace mlir::spirv { template <typename T> static StringRef stringifyTypeName(); template <> StringRef stringifyTypeName<IntegerType>() { … } template <> StringRef stringifyTypeName<FloatType>() { … } // Verifies an atomic update op. template <typename AtomicOpTy, typename ExpectedElementType> static LogicalResult verifyAtomicUpdateOp(Operation *op) { … } //===----------------------------------------------------------------------===// // spirv.AtomicAndOp //===----------------------------------------------------------------------===// LogicalResult AtomicAndOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicIAddOp //===----------------------------------------------------------------------===// LogicalResult AtomicIAddOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.EXT.AtomicFAddOp //===----------------------------------------------------------------------===// LogicalResult EXTAtomicFAddOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicIDecrementOp //===----------------------------------------------------------------------===// LogicalResult AtomicIDecrementOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicIIncrementOp //===----------------------------------------------------------------------===// LogicalResult AtomicIIncrementOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicISubOp //===----------------------------------------------------------------------===// LogicalResult AtomicISubOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicOrOp //===----------------------------------------------------------------------===// LogicalResult AtomicOrOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicSMaxOp //===----------------------------------------------------------------------===// LogicalResult AtomicSMaxOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicSMinOp //===----------------------------------------------------------------------===// LogicalResult AtomicSMinOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicUMaxOp //===----------------------------------------------------------------------===// LogicalResult AtomicUMaxOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicUMinOp //===----------------------------------------------------------------------===// LogicalResult AtomicUMinOp::verify() { … } //===----------------------------------------------------------------------===// // spirv.AtomicXorOp //===----------------------------------------------------------------------===// LogicalResult AtomicXorOp::verify() { … } } // namespace mlir::spirv