From fcb94863f7c4c04d7cb072d6acb3c1eebe9fc939 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Thu, 10 Nov 2016 11:35:40 +0530 Subject: [PATCH] hipDeviceGetByPCIBusId support for HIP/NVCC Change-Id: I8f82890e88d2a15f592bff192179e7d5c5362722 --- include/hip/nvcc_detail/hip_runtime_api.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/hip/nvcc_detail/hip_runtime_api.h b/include/hip/nvcc_detail/hip_runtime_api.h index 0d73bae199..0d15dfcb01 100644 --- a/include/hip/nvcc_detail/hip_runtime_api.h +++ b/include/hip/nvcc_detail/hip_runtime_api.h @@ -764,6 +764,11 @@ inline static hipError_t hipDeviceGetPCIBusId(int *pciBusId,int len,hipDevice_t return hipCUResultTohipError(cuDeviceGetPCIBusId((char*)pciBusId,len,device)); } +inline static hipError_t hipDeviceGetByPCIBusId(int* device, const int *pciBusId) +{ + return hipCUDAErrorTohipError(cudaDeviceGetByPCIBusId(device,(char*)pciBusId)); +} + inline static hipError_t hipDeviceGetLimit(size_t *pValue, hipLimit_t limit) { return hipCUDAErrorTohipError(cudaDeviceGetLimit(pValue, limit));