HeterogeneousCore
CUDACore
src
chooseDevice.cc
Go to the documentation of this file.
1
#include "
FWCore/ServiceRegistry/interface/Service.h
"
2
#include "
HeterogeneousCore/CUDAServices/interface/CUDAService.h
"
3
4
#include "
chooseDevice.h
"
5
6
namespace
cms::cuda
{
7
int
chooseDevice
(
edm::StreamID
id
) {
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
Generated for CMSSW Reference Manual by
1.8.16