[Openmp-commits] [PATCH] D102169: [libomptarget] Add support for target allocators to dynamic cuda RTL
Jon Chesterfield via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Mon May 10 07:28:26 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6da348569cd2: [libomptarget] Add support for target allocators to dynamic cuda RTL (authored by JonChesterfield).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102169/new/
https://reviews.llvm.org/D102169
Files:
openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp
openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h
Index: openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h
===================================================================
--- openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h
+++ openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h
@@ -49,6 +49,12 @@
CU_CTX_SCHED_MASK = 0x07,
} CUctx_flags;
+typedef enum CUmemAttach_flags_enum {
+ CU_MEM_ATTACH_GLOBAL = 0x1,
+ CU_MEM_ATTACH_HOST = 0x2,
+ CU_MEM_ATTACH_SINGLE = 0x4,
+} CUmemAttach_flags;
+
CUresult cuCtxGetDevice(CUdevice *);
CUresult cuDeviceGet(CUdevice *, int);
CUresult cuDeviceGetAttribute(int *, CUdevice_attribute, CUdevice);
@@ -62,14 +68,18 @@
void **);
CUresult cuMemAlloc(CUdeviceptr *, size_t);
-CUresult cuMemcpyDtoDAsync(CUdeviceptr, CUdeviceptr, size_t, CUstream);
+CUresult cuMemAllocHost(void **, size_t);
+CUresult cuMemAllocManaged(CUdeviceptr *, size_t, unsigned int);
+CUresult cuMemcpyDtoDAsync(CUdeviceptr, CUdeviceptr, size_t, CUstream);
CUresult cuMemcpyDtoH(void *, CUdeviceptr, size_t);
CUresult cuMemcpyDtoHAsync(void *, CUdeviceptr, size_t, CUstream);
CUresult cuMemcpyHtoD(CUdeviceptr, const void *, size_t);
CUresult cuMemcpyHtoDAsync(CUdeviceptr, const void *, size_t, CUstream);
CUresult cuMemFree(CUdeviceptr);
+CUresult cuMemFreeHost(void *);
+
CUresult cuModuleGetFunction(CUfunction *, CUmodule, const char *);
CUresult cuModuleGetGlobal(CUdeviceptr *, size_t *, CUmodule, const char *);
Index: openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp
===================================================================
--- openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp
+++ openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp
@@ -32,14 +32,17 @@
DLWRAP(cuLaunchKernel, 11);
DLWRAP(cuMemAlloc, 2);
-DLWRAP(cuMemcpyDtoDAsync, 4);
+DLWRAP(cuMemAllocHost, 2);
+DLWRAP(cuMemAllocManaged, 3);
+DLWRAP(cuMemcpyDtoDAsync, 4);
DLWRAP(cuMemcpyDtoH, 3);
DLWRAP(cuMemcpyDtoHAsync, 4);
DLWRAP(cuMemcpyHtoD, 3);
DLWRAP(cuMemcpyHtoDAsync, 4);
DLWRAP(cuMemFree, 1);
+DLWRAP(cuMemFreeHost, 1);
DLWRAP(cuModuleGetFunction, 3);
DLWRAP(cuModuleGetGlobal, 4);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102169.344055.patch
Type: text/x-patch
Size: 2120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210510/94843bc7/attachment.bin>
More information about the Openmp-commits
mailing list