1 /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 // This file defines the operations used in the LMHLO GPU dialect. 17 18 #include "mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops.h" 19 20 #include <assert.h> 21 #include <stddef.h> 22 #include <stdint.h> 23 24 #include "llvm/ADT/APFloat.h" 25 #include "llvm/ADT/APInt.h" 26 #include "llvm/ADT/ArrayRef.h" 27 #include "llvm/ADT/STLExtras.h" 28 #include "llvm/ADT/SmallVector.h" 29 #include "llvm/ADT/StringRef.h" 30 #include "llvm/Support/FormatVariadic.h" 31 #include "mlir/Dialect/StandardOps/IR/Ops.h" 32 #include "mlir/IR/Attributes.h" 33 #include "mlir/IR/Builders.h" 34 #include "mlir/IR/BuiltinTypes.h" 35 #include "mlir/IR/Dialect.h" 36 #include "mlir/IR/Location.h" 37 #include "mlir/IR/MLIRContext.h" 38 #include "mlir/IR/OpDefinition.h" 39 #include "mlir/IR/OpImplementation.h" 40 #include "mlir/IR/Operation.h" 41 #include "mlir/IR/OperationSupport.h" 42 #include "mlir/IR/PatternMatch.h" 43 #include "mlir/IR/TypeUtilities.h" 44 #include "mlir/IR/Types.h" 45 #include "mlir/IR/Value.h" 46 47 namespace mlir { 48 namespace lmhlo_gpu { 49 LmhloGpuDialect(MLIRContext * context)50LmhloGpuDialect::LmhloGpuDialect(MLIRContext *context) 51 : Dialect(getDialectNamespace(), context, TypeID::get<LmhloGpuDialect>()) { 52 addOperations< 53 #define GET_OP_LIST 54 #include "mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops.cc.inc" 55 >(); 56 } 57 58 // TODO(jurahul): Add verification for operand shapes and ranks. 59 60 } // namespace lmhlo_gpu 61 } // namespace mlir 62 63 #define GET_OP_CLASSES 64 #include "mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops.cc.inc" 65