The number of operations dedicated to CUF grew and where all still in FIR. In order to have a better organization, the CUF operations, attributes and code is moved into their specific dialect and files. CUF dialect is tightly coupled with HLFIR/FIR and their types. The CUF attributes are bundled into their own library since some HLFIR/FIR operations depend on them and the CUF dialect depends on the FIR types. Without having the attributes into a separate library there would be a dependency cycle.
33 lines
1.2 KiB
C++
33 lines
1.2 KiB
C++
//===-- CUFAttr.cpp -------------------------------------------------------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "flang/Optimizer/Dialect/CUF/Attributes/CUFAttr.h"
|
|
#include "flang/Optimizer/Dialect/CUF/CUFDialect.h"
|
|
#include "mlir/IR/Builders.h"
|
|
#include "mlir/IR/BuiltinTypes.h"
|
|
#include "mlir/IR/DialectImplementation.h"
|
|
#include "mlir/IR/OpDefinition.h"
|
|
#include "llvm/ADT/TypeSwitch.h"
|
|
|
|
#include "flang/Optimizer/Dialect/CUF/Attributes/CUFEnumAttr.cpp.inc"
|
|
#define GET_ATTRDEF_CLASSES
|
|
#include "flang/Optimizer/Dialect/CUF/Attributes/CUFAttr.cpp.inc"
|
|
|
|
namespace cuf {
|
|
|
|
void CUFDialect::registerAttributes() {
|
|
addAttributes<ClusterDimsAttr, DataAttributeAttr, DataTransferKindAttr,
|
|
LaunchBoundsAttr, ProcAttributeAttr>();
|
|
}
|
|
|
|
} // namespace cuf
|