FLANG
memory.h
1//===-- include/flang/Runtime/CUDA/memory.h ---------------------*- C++ -*-===//
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_RUNTIME_CUDA_MEMORY_H_
10#define FORTRAN_RUNTIME_CUDA_MEMORY_H_
11
12#include "flang/Runtime/descriptor-consts.h"
13#include "flang/Runtime/entry-names.h"
14#include <cstddef>
15
16namespace Fortran::runtime::cuda {
17
18extern "C" {
19
21void *RTDECL(CUFMemAlloc)(std::size_t bytes, unsigned type,
22 const char *sourceFile = nullptr, int sourceLine = 0);
23
25void RTDECL(CUFMemFree)(void *devicePtr, unsigned type,
26 const char *sourceFile = nullptr, int sourceLine = 0);
27
31void RTDECL(CUFMemsetDescriptor)(Descriptor *desc, void *value,
32 const char *sourceFile = nullptr, int sourceLine = 0);
33
35void RTDECL(CUFDataTransferPtrPtr)(void *dst, void *src, std::size_t bytes,
36 unsigned mode, const char *sourceFile = nullptr, int sourceLine = 0);
37
39void RTDECL(CUFDataTransferPtrDesc)(void *dst, Descriptor *src,
40 std::size_t bytes, unsigned mode, const char *sourceFile = nullptr,
41 int sourceLine = 0);
42
44void RTDECL(CUFDataTransferDescDesc)(Descriptor *dst, Descriptor *src,
45 unsigned mode, const char *sourceFile = nullptr, int sourceLine = 0);
46
48void RTDECL(CUFDataTransferCstDesc)(Descriptor *dst, Descriptor *src,
49 unsigned mode, const char *sourceFile = nullptr, int sourceLine = 0);
50
52void RTDECL(CUFDataTransferDescDescNoRealloc)(Descriptor *dst, Descriptor *src,
53 unsigned mode, const char *sourceFile = nullptr, int sourceLine = 0);
54
56void RTDECL(CUFDataTransferGlobalDescDesc)(Descriptor *dst, Descriptor *src,
57 unsigned mode, const char *sourceFile = nullptr, int sourceLine = 0);
58
59} // extern "C"
60} // namespace Fortran::runtime::cuda
61#endif // FORTRAN_RUNTIME_CUDA_MEMORY_H_