Java Code Examples for org.nd4j.linalg.factory.Nd4j#isFallbackModeEnabled()

The following examples show how to use org.nd4j.linalg.factory.Nd4j#isFallbackModeEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CpuLevel3.java    From nd4j with Apache License 2.0 5 votes vote down vote up
@Override
protected void sgemm(char Order, char TransA, char TransB, int M, int N, int K, float alpha, INDArray A, int lda,
                INDArray B, int ldb, float beta, INDArray C, int ldc) {
    if (!Nd4j.isFallbackModeEnabled()) {
        cblas_sgemm(convertOrder('f'), convertTranspose(TransA), convertTranspose(TransB), M, N, K, alpha,
                        (FloatPointer) A.data().addressPointer(), lda, (FloatPointer) B.data().addressPointer(),
                        ldb, beta, (FloatPointer) C.data().addressPointer(), ldc);
    } else {
        Nd4j.getExecutioner()
                        .exec(new AggregateGEMM('f', TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc));
    }
}
 
Example 2
Source File: CpuLevel3.java    From nd4j with Apache License 2.0 5 votes vote down vote up
@Override
protected void dgemm(char Order, char TransA, char TransB, int M, int N, int K, double alpha, INDArray A, int lda,
                INDArray B, int ldb, double beta, INDArray C, int ldc) {
    if (!Nd4j.isFallbackModeEnabled()) {
        cblas_dgemm(convertOrder('f'), convertTranspose(TransA), convertTranspose(TransB), M, N, K, alpha,
                        (DoublePointer) A.data().addressPointer(), lda, (DoublePointer) B.data().addressPointer(),
                        ldb, beta, (DoublePointer) C.data().addressPointer(), ldc);
    } else {
        Nd4j.getExecutioner()
                        .exec(new AggregateGEMM('f', TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc));
    }
}
 
Example 3
Source File: CpuLevel3.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Override
protected void sgemm(char Order, char TransA, char TransB, int M, int N, int K, float alpha, INDArray A, int lda,
                INDArray B, int ldb, float beta, INDArray C, int ldc) {
    if (!Nd4j.isFallbackModeEnabled()) {
        cblas_sgemm(convertOrder('f'), convertTranspose(TransA), convertTranspose(TransB), M, N, K, alpha,
                        (FloatPointer) A.data().addressPointer(), lda, (FloatPointer) B.data().addressPointer(),
                        ldb, beta, (FloatPointer) C.data().addressPointer(), ldc);
    } else {
        Nd4j.getExecutioner()
                        .exec(new AggregateGEMM('f', TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc));
    }
}
 
Example 4
Source File: CpuLevel3.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Override
protected void dgemm(char Order, char TransA, char TransB, int M, int N, int K, double alpha, INDArray A, int lda,
                INDArray B, int ldb, double beta, INDArray C, int ldc) {
    if (!Nd4j.isFallbackModeEnabled()) {
        cblas_dgemm(convertOrder('f'), convertTranspose(TransA), convertTranspose(TransB), M, N, K, alpha,
                        (DoublePointer) A.data().addressPointer(), lda, (DoublePointer) B.data().addressPointer(),
                        ldb, beta, (DoublePointer) C.data().addressPointer(), ldc);
    } else {
        Nd4j.getExecutioner()
                        .exec(new AggregateGEMM('f', TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc));
    }
}