diff --git a/openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h b/openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h --- a/openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h +++ b/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 *); diff --git a/openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp b/openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp --- a/openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp +++ b/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);