Class ConcurrencyPlan

Object
ConcurrencyPlan

public class ConcurrencyPlan extends Object
How many allocated CPUs and CPUs can be used concurrently for inference.
Author:
Owen Feehan
  • Field Details

    • DEFAULT_NUMBER_GPUS

      public static final int DEFAULT_NUMBER_GPUS
      The default number of GPUs used for numberGPUs in certain constructors.
      See Also:
  • Method Details

    • noCPUProcessor

      public static ConcurrencyPlan noCPUProcessor()
      Creates a plan for no CPU processors with the default number of GPUs.
      Returns:
      a newly-created plan
    • singleCPUProcessor

      public static ConcurrencyPlan singleCPUProcessor()
      Creates a plan for a single-CPU processor with the default number of GPUs.
      Returns:
      a newly-created plan
    • singleCPUProcessor

      public static ConcurrencyPlan singleCPUProcessor(int maxNumberGPUs)
      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

      public static ConcurrencyPlan multipleProcessors(int maxNumberCPUs, int maxNumberGPUs)
      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

      public ConcurrencyPlan disableGPUs()
      Derive a ConcurrencyPlan 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