CMS 3D CMS Logo

chooseDevice.cc
Go to the documentation of this file.
3 
4 #include "chooseDevice.h"
5 
6 namespace cms::cuda {
8  edm::Service<CUDAService> cudaService;
9 
10  // For startes we "statically" assign the device based on
11  // edm::Stream number. This is suboptimal if the number of
12  // edm::Streams is not a multiple of the number of CUDA devices
13  // (and even then there is no load balancing).
14  //
15  // TODO: improve the "assignment" logic
16  return id % cudaService->numberOfDevices();
17  }
18 } // namespace cms::cuda
cms::cuda
Definition: Product.h:14
edm::StreamID
Definition: StreamID.h:30
cms::cuda::chooseDevice
int chooseDevice(edm::StreamID id)
Definition: chooseDevice.cc:7
chooseDevice.h
CUDAService::numberOfDevices
int numberOfDevices() const
Definition: CUDAService.h:24
Service.h
edm::Service
Definition: Service.h:30
CUDAService.h