Class ConcurrencyPlan
Object
ConcurrencyPlan
How many allocated CPUs and CPUs can be used concurrently for inference.
- Author:
- Owen Feehan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The default number of GPUs used fornumberGPUs
in certain constructors. -
Method Summary
Modifier and TypeMethodDescriptionDerive aConcurrencyPlan
that preserves the number of CPUs but disables all GPUs.static ConcurrencyPlan
multipleProcessors
(int maxNumberCPUs, int maxNumberGPUs) Creates a plan for a multiple CPU-processors.static ConcurrencyPlan
Creates a plan for no CPU processors with the default number of GPUs.int
The number of CPUs to be used in the plan.int
The number of GPUs to be used in the plan.static ConcurrencyPlan
Creates a plan for a single-CPU processor with the default number of GPUs.static ConcurrencyPlan
singleCPUProcessor
(int maxNumberGPUs) Creates a plan for a single-CPU processor - with a maximum number of GPUs.
-
Field Details
-
DEFAULT_NUMBER_GPUS
public static final int DEFAULT_NUMBER_GPUSThe default number of GPUs used fornumberGPUs
in certain constructors.- See Also:
-
-
Method Details
-
noCPUProcessor
Creates a plan for no CPU processors with the default number of GPUs.- Returns:
- a newly-created plan
-
singleCPUProcessor
Creates a plan for a single-CPU processor with the default number of GPUs.- Returns:
- a newly-created plan
-
singleCPUProcessor
Creates a plan for a single-CPU processor - with a maximum number of GPUs.- Parameters:
maxNumberGPUs
- the maximum number of available GPUs that may be used, if available.- Returns:
- a newly-created plan
-
multipleProcessors
Creates a plan for a multiple CPU-processors.- Parameters:
maxNumberCPUs
- the maximum number of CPU processors that may be used, if available.maxNumberGPUs
- the maximum number of GPU processors that may be used, if available.- Returns:
- a newly-created plan
-
disableGPUs
Derive aConcurrencyPlan
that preserves the number of CPUs but disables all GPUs.This operation is immutable.
- Returns:
- a newly recreated
ConcurrencyPlan
-
numberCPUs
public int numberCPUs()The number of CPUs to be used in the plan.- Returns:
- the number of CPUs
-
numberGPUs
public int numberGPUs()The number of GPUs to be used in the plan.- Returns:
- the number of GPUs
-