Class DefaultCPUBackend

java.lang.Object
org.episteme.core.technical.backend.cpu.DefaultCPUBackend
All Implemented Interfaces:
Backend, ComputeBackend, CPUBackend

@AutoService({Backend.class,ComputeBackend.class,CPUBackend.class}) public class DefaultCPUBackend extends Object implements CPUBackend
Default (always-available) CPU compute backend.

This is the lowest-priority fallback backend that uses pure Java implementations with multi-core parallel streams. It is always available on any JVM.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • DefaultCPUBackend

      public DefaultCPUBackend()
  • Method Details

    • getId

      public String getId()
      Description copied from interface: Backend
      Returns the unique identifier for this backend (e.g., "javafx", "jmol", "cuda").
      Specified by:
      getId in interface Backend
      Specified by:
      getId in interface ComputeBackend
    • getName

      public String getName()
      Description copied from interface: Backend
      Returns the display name for UI presentation.
      Specified by:
      getName in interface Backend
    • getDescription

      public String getDescription()
      Description copied from interface: Backend
      Returns a description of the backend.
      Specified by:
      getDescription in interface Backend
      Specified by:
      getDescription in interface ComputeBackend
    • isAvailable

      public boolean isAvailable()
      Description copied from interface: Backend
      Checks if this backend is currently available (libraries loaded, etc.).

      Default implementation checks Backend.isExplicitlyDisabled() and returns false if it is.

      Specified by:
      isAvailable in interface Backend
    • createContext

      public ExecutionContext createContext()
      Description copied from interface: ComputeBackend
      Creates an execution context for running operations.

      The context should be used within a try-with-resources block to ensure proper cleanup of resources.

      Specified by:
      createContext in interface ComputeBackend
      Returns:
      new execution context
    • getPriority

      public int getPriority()
      Description copied from interface: Backend
      Returns the priority for auto-selection (higher = preferred). Used when multiple backends are available.
      Specified by:
      getPriority in interface Backend