Package org.nd4j.linalg.factory
Class Nd4jBackend
- java.lang.Object
-
- org.nd4j.linalg.factory.Nd4jBackend
-
public abstract class Nd4jBackend extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Nd4jBackend.NoAvailableBackendException
-
Field Summary
Fields Modifier and Type Field Description static int
BACKEND_PRIORITY_AURORA
static int
BACKEND_PRIORITY_CPU
static int
BACKEND_PRIORITY_GPU
static String
DYNAMIC_LOAD_CLASSPATH
Deprecated.static String
DYNAMIC_LOAD_CLASSPATH_PROPERTY
Deprecated.
-
Constructor Summary
Constructors Constructor Description Nd4jBackend()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
allowsOrder()
Returns true if the backend allows order to be specified on blas operations (cblas)abstract String
buildInfo()
Get the build information of the backendabstract boolean
canRun()
Returns true if the backend can run on the os or notabstract Resource
getConfigurationResource()
Get the configuration resourceNd4jContext
getContext()
abstract Environment
getEnvironment()
abstract Class
getNDArrayClass()
Get the actual (concrete/implementation) class for standard INDArrays for this backendabstract int
getPriority()
Gets a priority number for the backend.Properties
getProperties()
abstract boolean
isAvailable()
Determines whether a given backend is available in the current environment.static Nd4jBackend
load()
Loads the best available backend.static void
loadLibrary(File jar)
Adds the supplied Java Archive library to java.class.path.abstract void
logBackendInit()
String
toString()
-
-
-
Field Detail
-
BACKEND_PRIORITY_CPU
public static final int BACKEND_PRIORITY_CPU
-
BACKEND_PRIORITY_GPU
public static final int BACKEND_PRIORITY_GPU
-
BACKEND_PRIORITY_AURORA
public static final int BACKEND_PRIORITY_AURORA
-
DYNAMIC_LOAD_CLASSPATH
@Deprecated public static final String DYNAMIC_LOAD_CLASSPATH
Deprecated.- See Also:
- Constant Field Values
-
DYNAMIC_LOAD_CLASSPATH_PROPERTY
@Deprecated public static final String DYNAMIC_LOAD_CLASSPATH_PROPERTY
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
allowsOrder
public abstract boolean allowsOrder()
Returns true if the backend allows order to be specified on blas operations (cblas)- Returns:
- true if the backend allows order to be specified on blas operations
-
getPriority
public abstract int getPriority()
Gets a priority number for the backend. Backends are loaded in priority order (highest first).- Returns:
- a priority number.
-
isAvailable
public abstract boolean isAvailable()
Determines whether a given backend is available in the current environment.- Returns:
- true if the backend is available; false otherwise.
-
canRun
public abstract boolean canRun()
Returns true if the backend can run on the os or not- Returns:
-
getConfigurationResource
public abstract Resource getConfigurationResource()
Get the configuration resource- Returns:
-
getNDArrayClass
public abstract Class getNDArrayClass()
Get the actual (concrete/implementation) class for standard INDArrays for this backend
-
getEnvironment
public abstract Environment getEnvironment()
-
buildInfo
public abstract String buildInfo()
Get the build information of the backend
-
load
public static Nd4jBackend load() throws Nd4jBackend.NoAvailableBackendException
Loads the best available backend.- Returns:
- Throws:
Nd4jBackend.NoAvailableBackendException
-
loadLibrary
public static void loadLibrary(File jar) throws Nd4jBackend.NoAvailableBackendException
Adds the supplied Java Archive library to java.class.path. This is benign if the library is already loaded.- Parameters:
jar
- the jar file to add- Throws:
Nd4jBackend.NoAvailableBackendException
-
getProperties
public Properties getProperties() throws IOException
- Returns:
- Throws:
IOException
-
getContext
public Nd4jContext getContext() throws IOException
- Returns:
- Throws:
IOException
-
logBackendInit
public abstract void logBackendInit()
-
-