From 470a1583d1b5bc056539f845fe68edf061202da3 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Thu, 22 Sep 2016 12:55:41 -0500 Subject: [PATCH] added ipc runtime api for nvcc backend Change-Id: I3297c4c9db34e7bc3267fec64a6757f9ebf91905 --- hipamd/include/nvcc_detail/hip_runtime_api.h | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hipamd/include/nvcc_detail/hip_runtime_api.h b/hipamd/include/nvcc_detail/hip_runtime_api.h index 518c96ecd8..9fea77a904 100644 --- a/hipamd/include/nvcc_detail/hip_runtime_api.h +++ b/hipamd/include/nvcc_detail/hip_runtime_api.h @@ -64,6 +64,8 @@ hipMemcpyHostToHost typedef cudaEvent_t hipEvent_t; typedef cudaStream_t hipStream_t; +typedef cudaIpcEventHandle_t hipIpcEventHandle_t; +typedef cudaIpcMemHandle_t hipIpcMemHandle_t; typedef CUcontext hipCtx_t; typedef CUsharedconfig hipSharedMemConfig; typedef CUfunc_cache hipFuncCache; @@ -306,6 +308,26 @@ inline static hipError_t hipGetDevice(int * device){ return hipCUDAErrorTohipError(cudaGetDevice(device)); } +inline static hipError_t hipIpcCloseMemHandle(void *devPtr){ + return hipCUDAErrorTohipError(cudaIpcCloseMemHandle(devPtr)); +} + +inline static hipError_t hipIpcGetEventHandle(hipIpcEventHandle_t* handle, hipEvent_t event){ + return hipCUDAErrorTohipError(cudaIpcGetEventHandle(handle, event)); +} + +inline static hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* devPtr){ + return hipCUDAErrorTohipError(cudaIpcGetMemHandle(handle, devPtr)); +} + +inline static hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle){ + return hipCUDAErrorTohipError(cudaIpcOpenEventHandle(event, handle)); +} + +inline static hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned int flags){ + return hipCUDAErrorTohipError(cudaIpcOpenMemHandle(devPtr, handle, flags)); +} + inline static hipError_t hipMemset(void* devPtr,int value, size_t count) { return hipCUDAErrorTohipError(cudaMemset(devPtr, value, count)); }