FLANG
CUFCommon.h
1//===-- CUFCommon.h -------------------------------------------------------===//
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#ifndef FORTRAN_OPTIMIZER_TRANSFORMS_CUFCOMMON_H_
10#define FORTRAN_OPTIMIZER_TRANSFORMS_CUFCOMMON_H_
11
12#include "flang/Optimizer/Dialect/FIROps.h"
13#include "mlir/Dialect/GPU/IR/GPUDialect.h"
14#include "mlir/IR/BuiltinOps.h"
15
16static constexpr llvm::StringRef cudaDeviceModuleName = "cuda_device_mod";
17
18namespace fir {
19class FirOpBuilder;
20} // namespace fir
21
22namespace cuf {
23
25mlir::gpu::GPUModuleOp getOrCreateGPUModule(mlir::ModuleOp mod,
26 mlir::SymbolTable &symTab);
27
28bool isInCUDADeviceContext(mlir::Operation *op);
29bool isRegisteredDeviceGlobal(fir::GlobalOp op);
30
31void genPointerSync(const mlir::Value box, fir::FirOpBuilder &builder);
32
33} // namespace cuf
34
35#endif // FORTRAN_OPTIMIZER_TRANSFORMS_CUFCOMMON_H_
Definition: FIRBuilder.h:55
Definition: ConvertVariable.h:26
mlir::gpu::GPUModuleOp getOrCreateGPUModule(mlir::ModuleOp mod, mlir::SymbolTable &symTab)
Retrieve or create the CUDA Fortran GPU module in the given mod.
Definition: CUFCommon.cpp:17
Definition: AbstractConverter.h:31