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 classNd4jBackend.NoAvailableBackendException
-
Field Summary
Fields Modifier and Type Field Description static intBACKEND_PRIORITY_AURORAstatic intBACKEND_PRIORITY_CPUstatic intBACKEND_PRIORITY_GPUstatic StringDYNAMIC_LOAD_CLASSPATHDeprecated.static StringDYNAMIC_LOAD_CLASSPATH_PROPERTYDeprecated.
-
Constructor Summary
Constructors Constructor Description Nd4jBackend()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanallowsOrder()Returns true if the backend allows order to be specified on blas operations (cblas)abstract StringbuildInfo()Get the build information of the backendabstract booleancanRun()Returns true if the backend can run on the os or notabstract ResourcegetConfigurationResource()Get the configuration resourceNd4jContextgetContext()abstract EnvironmentgetEnvironment()abstract ClassgetNDArrayClass()Get the actual (concrete/implementation) class for standard INDArrays for this backendabstract intgetPriority()Gets a priority number for the backend.PropertiesgetProperties()abstract booleanisAvailable()Determines whether a given backend is available in the current environment.static Nd4jBackendload()Loads the best available backend.static voidloadLibrary(File jar)Adds the supplied Java Archive library to java.class.path.abstract voidlogBackendInit()StringtoString()
-
-
-
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()
-
-