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 intThe default number of GPUs used fornumberGPUsin certain constructors. -
Method Summary
Modifier and TypeMethodDescriptionDerive aConcurrencyPlanthat preserves the number of CPUs but disables all GPUs.static ConcurrencyPlanmultipleProcessors(int maxNumberCPUs, int maxNumberGPUs) Creates a plan for a multiple CPU-processors.static ConcurrencyPlanCreates a plan for no CPU processors with the default number of GPUs.intThe number of CPUs to be used in the plan.intThe number of GPUs to be used in the plan.static ConcurrencyPlanCreates a plan for a single-CPU processor with the default number of GPUs.static ConcurrencyPlansingleCPUProcessor(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 fornumberGPUsin 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 aConcurrencyPlanthat 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
-