[flang-commits] [flang] [flang][cuda] Allocate local descriptor in managed memory (PR #102060)
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Mon Aug 5 14:47:41 PDT 2024
================
@@ -0,0 +1,28 @@
+//===-- runtime/CUDA/descriptor.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
+//
+//===----------------------------------------------------------------------===//
+
+#include "flang/Runtime/CUDA/descriptor.h"
+#include "flang/Runtime/CUDA/allocator.h"
+
+namespace Fortran::runtime::cuf {
+extern "C" {
+RT_EXT_API_GROUP_BEGIN
+
+Descriptor *RTDEF(CUFAllocDesciptor)(
+ std::size_t sizeInBytes, const char *sourceFile, int sourceLine) {
+ return reinterpret_cast<Descriptor *>(CUFAllocManaged(sizeInBytes));
+}
+
+void RTDECL(CUFFreeDesciptor)(
----------------
vzakhari wrote:
```suggestion
void RTDEF(CUFFreeDesciptor)(
```
https://github.com/llvm/llvm-project/pull/102060
More information about the flang-commits
mailing list