From 25f8a682cc9f5b5682efa82852bf77017f1039e7 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Fri, 28 Feb 2020 23:26:52 +0100 Subject: [PATCH] Rename numberOfCUDADevices() to cms::cuda::numberOfDevices --- .../CUDAServices/interface/numberOfCUDADevices.h | 9 --------- .../CUDAServices/interface/numberOfDevices.h | 14 ++++++++++++++ .../CUDAServices/src/numberOfCUDADevices.cc | 8 -------- .../CUDAServices/src/numberOfDevices.cc | 10 ++++++++++ 4 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 HeterogeneousCore/CUDAServices/interface/numberOfCUDADevices.h create mode 100644 HeterogeneousCore/CUDAServices/interface/numberOfDevices.h delete mode 100644 HeterogeneousCore/CUDAServices/src/numberOfCUDADevices.cc create mode 100644 HeterogeneousCore/CUDAServices/src/numberOfDevices.cc diff --git a/HeterogeneousCore/CUDAServices/interface/numberOfCUDADevices.h b/HeterogeneousCore/CUDAServices/interface/numberOfCUDADevices.h deleted file mode 100644 index b563b98b516cf..0000000000000 --- a/HeterogeneousCore/CUDAServices/interface/numberOfCUDADevices.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HeterogeneousCore_CUDAServices_numberOfCUDADevices_h -#define HeterogeneousCore_CUDAServices_numberOfCUDADevices_h - -// Returns the number of CUDA devices -// The difference wrt. the standard CUDA function is that if -// CUDAService is disabled, this function returns 0. -int numberOfCUDADevices(); - -#endif diff --git a/HeterogeneousCore/CUDAServices/interface/numberOfDevices.h b/HeterogeneousCore/CUDAServices/interface/numberOfDevices.h new file mode 100644 index 0000000000000..fb6f4ef310f7e --- /dev/null +++ b/HeterogeneousCore/CUDAServices/interface/numberOfDevices.h @@ -0,0 +1,14 @@ +#ifndef HeterogeneousCore_CUDAServices_numberOfDevices_h +#define HeterogeneousCore_CUDAServices_numberOfDevices_h + +namespace cms { + namespace cuda { + // Returns the number of CUDA devices + // The difference wrt. the standard CUDA function or + // cms::cuda::deviceCount() is that if CUDAService is disabled, + // this function returns 0. + int numberOfDevices(); + } // namespace cuda +} // namespace cms + +#endif diff --git a/HeterogeneousCore/CUDAServices/src/numberOfCUDADevices.cc b/HeterogeneousCore/CUDAServices/src/numberOfCUDADevices.cc deleted file mode 100644 index a0bbc503c3451..0000000000000 --- a/HeterogeneousCore/CUDAServices/src/numberOfCUDADevices.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include "HeterogeneousCore/CUDAServices/interface/numberOfCUDADevices.h" -#include "HeterogeneousCore/CUDAServices/interface/CUDAService.h" -#include "FWCore/ServiceRegistry/interface/Service.h" - -int numberOfCUDADevices() { - edm::Service cs; - return cs->enabled() ? cs->numberOfDevices() : 0; -} diff --git a/HeterogeneousCore/CUDAServices/src/numberOfDevices.cc b/HeterogeneousCore/CUDAServices/src/numberOfDevices.cc new file mode 100644 index 0000000000000..4bc852f3a60c4 --- /dev/null +++ b/HeterogeneousCore/CUDAServices/src/numberOfDevices.cc @@ -0,0 +1,10 @@ +#include "HeterogeneousCore/CUDAServices/interface/numberOfDevices.h" +#include "HeterogeneousCore/CUDAServices/interface/CUDAService.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +namespace cms::cuda { + int numberOfDevices() { + edm::Service cs; + return cs->enabled() ? cs->numberOfDevices() : 0; + } +} // namespace cms::cuda