aboutsummaryrefslogtreecommitdiff
path: root/flang/runtime/CUDA/descriptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/runtime/CUDA/descriptor.cpp')
-rw-r--r--flang/runtime/CUDA/descriptor.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/flang/runtime/CUDA/descriptor.cpp b/flang/runtime/CUDA/descriptor.cpp
index 816b145..947eeb6 100644
--- a/flang/runtime/CUDA/descriptor.cpp
+++ b/flang/runtime/CUDA/descriptor.cpp
@@ -20,8 +20,7 @@ RT_EXT_API_GROUP_BEGIN
Descriptor *RTDEF(CUFAllocDescriptor)(
std::size_t sizeInBytes, const char *sourceFile, int sourceLine) {
- return reinterpret_cast<Descriptor *>(
- CUFAllocManaged(sizeInBytes, kCudaNoStream));
+ return reinterpret_cast<Descriptor *>(CUFAllocManaged(sizeInBytes));
}
void RTDEF(CUFFreeDescriptor)(
@@ -47,6 +46,13 @@ void RTDEF(CUFDescriptorSync)(Descriptor *dst, const Descriptor *src,
(void *)dst, (const void *)src, count, cudaMemcpyHostToDevice));
}
+void RTDEF(CUFSyncGlobalDescriptor)(
+ void *hostPtr, const char *sourceFile, int sourceLine) {
+ void *devAddr{RTNAME(CUFGetDeviceAddress)(hostPtr, sourceFile, sourceLine)};
+ RTNAME(CUFDescriptorSync)
+ ((Descriptor *)devAddr, (Descriptor *)hostPtr, sourceFile, sourceLine);
+}
+
RT_EXT_API_GROUP_END
}
} // namespace Fortran::runtime::cuda