43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
//===-- include/flang/Runtime/CUDA/allocator.h ------------------*- C++ -*-===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
|
|
#define FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
|
|
|
|
#include "common.h"
|
|
#include "flang/Runtime/descriptor-consts.h"
|
|
#include "flang/Runtime/entry-names.h"
|
|
|
|
#include "cuda_runtime.h"
|
|
|
|
namespace Fortran::runtime::cuda {
|
|
|
|
extern "C" {
|
|
|
|
void RTDECL(CUFRegisterAllocator)();
|
|
cudaStream_t RTDECL(CUFGetAssociatedStream)(void *);
|
|
int RTDECL(CUFSetAssociatedStream)(void *, cudaStream_t);
|
|
void RTDECL(CUFSetDefaultStream)(cudaStream_t);
|
|
cudaStream_t RTDECL(CUFGetDefaultStream)();
|
|
}
|
|
|
|
void *CUFAllocPinned(std::size_t, std::int64_t *);
|
|
void CUFFreePinned(void *);
|
|
|
|
void *CUFAllocDevice(std::size_t, std::int64_t *);
|
|
void CUFFreeDevice(void *);
|
|
|
|
void *CUFAllocManaged(std::size_t, std::int64_t *);
|
|
void CUFFreeManaged(void *);
|
|
|
|
void *CUFAllocUnified(std::size_t, std::int64_t *);
|
|
void CUFFreeUnified(void *);
|
|
|
|
} // namespace Fortran::runtime::cuda
|
|
#endif // FORTRAN_RUNTIME_CUDA_ALLOCATOR_H_
|