Skip to content

Commit

Permalink
Update to JavaCPP 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Mar 29, 2018
1 parent e3635a7 commit 7823a8e
Show file tree
Hide file tree
Showing 6 changed files with 2,241 additions and 1,564 deletions.
8 changes: 5 additions & 3 deletions change-cuda-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ CUDA_90_VERSION="9\.0"
CUDA_91_VERSION="9\.1"
CUDNN_60_VERSION="6\.0"
CUDNN_70_VERSION="7\.0"
CUDNN_71_VERSION="7\.1"
JAVACPP_13_VERSION="1\.3"
JAVACPP_14_VERSION="1\.4"
JAVACPP_141_VERSION="1\.4\.1"

usage() {
echo "Usage: $(basename $0) [-h|--help] <cuda version to be used>
Expand Down Expand Up @@ -57,8 +59,8 @@ check_cuda_version "$VERSION"
case $VERSION in
9.1)
VERSION=$CUDA_91_VERSION
VERSION2=$CUDNN_70_VERSION
VERSION3=$JAVACPP_14_VERSION
VERSION2=$CUDNN_71_VERSION
VERSION3=$JAVACPP_141_VERSION
;;
9.0)
VERSION=$CUDA_90_VERSION
Expand Down Expand Up @@ -100,6 +102,6 @@ find "$BASEDIR" -name 'pom.xml' -not -path '*target*' \

#JavaCPP versions, like <javacpp-presets.cuda.version>1.4</javacpp-presets.cuda.version>
find "$BASEDIR" -name 'pom.xml' -not -path '*target*' \
-exec bash -c "sed_i 's/\(javacpp-presets.cuda.version>\)...<\/javacpp-presets.cuda.version>/\1'$VERSION3'<\/javacpp-presets.cuda.version>/g' {}" \;
-exec bash -c "sed_i 's/\(javacpp-presets.cuda.version>\).*<\/javacpp-presets.cuda.version>/\1'$VERSION3'<\/javacpp-presets.cuda.version>/g' {}" \;

echo "Done updating CUDA versions.";
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Targeted by JavaCPP version 1.4.1-SNAPSHOT: DO NOT EDIT THIS FILE
// Targeted by JavaCPP version 1.4.1: DO NOT EDIT THIS FILE

package org.nd4j.nativeblas;

Expand Down Expand Up @@ -6013,6 +6013,11 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public native void printIndexedBuffer();
public native void printIndexedBuffer(@Cast("char*") BytePointer msg/*=nullptr*/, int limit/*=-1*/);

public native @StdString BytePointer asIndexedString(int limit/*=-1*/);
public native @StdString BytePointer asIndexedString();
public native @StdString BytePointer asString(int limit/*=-1*/);
public native @StdString BytePointer asString();

/**
* this method assigns values of given array to this one
*/
Expand Down Expand Up @@ -6059,6 +6064,9 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
* dimensions - array of dimensions to calculate sum over
* keepDims - if true then put unities in place of reduced dimensions
*/
public native FloatNDArray sum(@StdVector IntPointer dimensions);
public native FloatNDArray sum(@StdVector IntBuffer dimensions);
public native FloatNDArray sum(@StdVector int[] dimensions);

/**
* method reduces array by excluding its shapes along dimensions present in given dimensions vector, result is stored in new array to be returned
Expand Down Expand Up @@ -7090,6 +7098,11 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public native void printIndexedBuffer();
public native void printIndexedBuffer(@Cast("char*") BytePointer msg/*=nullptr*/, int limit/*=-1*/);

public native @StdString BytePointer asIndexedString(int limit/*=-1*/);
public native @StdString BytePointer asIndexedString();
public native @StdString BytePointer asString(int limit/*=-1*/);
public native @StdString BytePointer asString();

/**
* this method assigns values of given array to this one
*/
Expand Down Expand Up @@ -7136,6 +7149,9 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
* dimensions - array of dimensions to calculate sum over
* keepDims - if true then put unities in place of reduced dimensions
*/
public native HalfNDArray sum(@StdVector IntPointer dimensions);
public native HalfNDArray sum(@StdVector IntBuffer dimensions);
public native HalfNDArray sum(@StdVector int[] dimensions);

/**
* method reduces array by excluding its shapes along dimensions present in given dimensions vector, result is stored in new array to be returned
Expand Down Expand Up @@ -8167,6 +8183,11 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public native void printIndexedBuffer();
public native void printIndexedBuffer(@Cast("char*") BytePointer msg/*=nullptr*/, int limit/*=-1*/);

public native @StdString BytePointer asIndexedString(int limit/*=-1*/);
public native @StdString BytePointer asIndexedString();
public native @StdString BytePointer asString(int limit/*=-1*/);
public native @StdString BytePointer asString();

/**
* this method assigns values of given array to this one
*/
Expand Down Expand Up @@ -8213,6 +8234,9 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
* dimensions - array of dimensions to calculate sum over
* keepDims - if true then put unities in place of reduced dimensions
*/
public native DoubleNDArray sum(@StdVector IntPointer dimensions);
public native DoubleNDArray sum(@StdVector IntBuffer dimensions);
public native DoubleNDArray sum(@StdVector int[] dimensions);

/**
* method reduces array by excluding its shapes along dimensions present in given dimensions vector, result is stored in new array to be returned
Expand Down Expand Up @@ -9091,7 +9115,7 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
// still the definition of inline function must be in header file



//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -9357,7 +9381,6 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
return (FloatNDArrayFactory)super.position(position);
}


public static native FloatNDArray createUninitialized(FloatNDArray other);

public static native FloatResultSet multipleTensorsAlongDimension(FloatNDArray ndArray, @StdVector IntPointer indices, @StdVector IntPointer dimensions);
Expand Down Expand Up @@ -9385,9 +9408,15 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public static native FloatNDArray tensorDot(@Const FloatNDArray A, @Const FloatNDArray B, @StdVector IntBuffer axesA, @StdVector IntBuffer axesB);
public static native FloatNDArray tensorDot(@Const FloatNDArray A, @Const FloatNDArray B, @StdVector int[] axesA, @StdVector int[] axesB);

public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector IntPointer axesA, @StdVector IntPointer axesB);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector IntBuffer axesA, @StdVector IntBuffer axesB);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector int[] axesA, @StdVector int[] axesB);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector IntPointer axes_a, @StdVector IntPointer axes_b, @StdVector IntPointer permutForC/*={}*/);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector IntPointer axes_a, @StdVector IntPointer axes_b);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector IntBuffer axes_a, @StdVector IntBuffer axes_b, @StdVector IntBuffer permutForC/*={}*/);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector IntBuffer axes_a, @StdVector IntBuffer axes_b);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector int[] axes_a, @StdVector int[] axes_b, @StdVector int[] permutForC/*={}*/);
public static native void tensorDot(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, @StdVector int[] axes_a, @StdVector int[] axes_b);

// #ifndef __JAVACPP_HACK__
// #endif

public static native FloatNDArray linspace(float from, float to, @Cast("Nd4jIndex") long numElements);

Expand All @@ -9406,7 +9435,6 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public static native FloatNDArray concat(@Const @ByRef FloatNDArrayVector vectors);

public static native FloatNDArray simpleMMul(@Const FloatNDArray a, @Const FloatNDArray b, FloatNDArray c, float alpha, float beta);

}
@Name("nd4j::NDArrayFactory<float16>") public static class HalfNDArrayFactory extends Pointer {
static { Loader.load(); }
Expand All @@ -9422,7 +9450,6 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
return (HalfNDArrayFactory)super.position(position);
}


public static native HalfNDArray createUninitialized(HalfNDArray other);

public static native HalfResultSet multipleTensorsAlongDimension(HalfNDArray ndArray, @StdVector IntPointer indices, @StdVector IntPointer dimensions);
Expand Down Expand Up @@ -9450,9 +9477,15 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public static native HalfNDArray tensorDot(@Const HalfNDArray A, @Const HalfNDArray B, @StdVector IntBuffer axesA, @StdVector IntBuffer axesB);
public static native HalfNDArray tensorDot(@Const HalfNDArray A, @Const HalfNDArray B, @StdVector int[] axesA, @StdVector int[] axesB);

public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector IntPointer axesA, @StdVector IntPointer axesB);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector IntBuffer axesA, @StdVector IntBuffer axesB);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector int[] axesA, @StdVector int[] axesB);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector IntPointer axes_a, @StdVector IntPointer axes_b, @StdVector IntPointer permutForC/*={}*/);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector IntPointer axes_a, @StdVector IntPointer axes_b);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector IntBuffer axes_a, @StdVector IntBuffer axes_b, @StdVector IntBuffer permutForC/*={}*/);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector IntBuffer axes_a, @StdVector IntBuffer axes_b);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector int[] axes_a, @StdVector int[] axes_b, @StdVector int[] permutForC/*={}*/);
public static native void tensorDot(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @StdVector int[] axes_a, @StdVector int[] axes_b);

// #ifndef __JAVACPP_HACK__
// #endif

public static native HalfNDArray linspace(@Cast("float16") short from, @Cast("float16") short to, @Cast("Nd4jIndex") long numElements);

Expand All @@ -9471,7 +9504,6 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public static native HalfNDArray concat(@Const @ByRef HalfNDArrayVector vectors);

public static native HalfNDArray simpleMMul(@Const HalfNDArray a, @Const HalfNDArray b, HalfNDArray c, @Cast("const float16") short alpha, @Cast("const float16") short beta);

}
@Name("nd4j::NDArrayFactory<double>") public static class DoubleNDArrayFactory extends Pointer {
static { Loader.load(); }
Expand All @@ -9487,7 +9519,6 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
return (DoubleNDArrayFactory)super.position(position);
}


public static native DoubleNDArray createUninitialized(DoubleNDArray other);

public static native DoubleResultSet multipleTensorsAlongDimension(DoubleNDArray ndArray, @StdVector IntPointer indices, @StdVector IntPointer dimensions);
Expand Down Expand Up @@ -9515,9 +9546,15 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public static native DoubleNDArray tensorDot(@Const DoubleNDArray A, @Const DoubleNDArray B, @StdVector IntBuffer axesA, @StdVector IntBuffer axesB);
public static native DoubleNDArray tensorDot(@Const DoubleNDArray A, @Const DoubleNDArray B, @StdVector int[] axesA, @StdVector int[] axesB);

public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector IntPointer axesA, @StdVector IntPointer axesB);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector IntBuffer axesA, @StdVector IntBuffer axesB);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector int[] axesA, @StdVector int[] axesB);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector IntPointer axes_a, @StdVector IntPointer axes_b, @StdVector IntPointer permutForC/*={}*/);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector IntPointer axes_a, @StdVector IntPointer axes_b);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector IntBuffer axes_a, @StdVector IntBuffer axes_b, @StdVector IntBuffer permutForC/*={}*/);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector IntBuffer axes_a, @StdVector IntBuffer axes_b);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector int[] axes_a, @StdVector int[] axes_b, @StdVector int[] permutForC/*={}*/);
public static native void tensorDot(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, @StdVector int[] axes_a, @StdVector int[] axes_b);

// #ifndef __JAVACPP_HACK__
// #endif

public static native DoubleNDArray linspace(double from, double to, @Cast("Nd4jIndex") long numElements);

Expand All @@ -9536,7 +9573,6 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi
public static native DoubleNDArray concat(@Const @ByRef DoubleNDArrayVector vectors);

public static native DoubleNDArray simpleMMul(@Const DoubleNDArray a, @Const DoubleNDArray b, DoubleNDArray c, double alpha, double beta);

}


Expand Down Expand Up @@ -15359,7 +15395,7 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi

/** graph definitions */
// #define REQUIRE_OK(A) if (nd4j::ops::resultHelper( (A), #A, __FILE__, __LINE__ ) != 0) return ND4J_STATUS_VALIDATION;
// #define REQUIRE_TRUE(...) if (nd4j::ops::conditionHelper(__FILE__, __LINE__, __VA_ARGS__) != 0) return ND4J_STATUS_VALIDATION;
// #define REQUIRE_TRUE(...) if (nd4j::ops::conditionHelper(__FILE__, __LINE__, __VA_ARGS__) != 0) throw std::invalid_argument("Op validation failed");

// #define DECLARE_ENTRY(NAME, ...) template struct ND4J_EXPORT __registratorFloat<NAME<float>>;
// template struct ND4J_EXPORT __registratorHalf<NAME<float16>>;
Expand Down Expand Up @@ -15857,6 +15893,8 @@ public native void execMetaPredicateReduceFloat(@Cast("Nd4jPointer*") PointerPoi

// #endif // CUDACC

// #define CHECK_ALLOC(PTR, MSG) if (PTR == nullptr) { nd4j_printf("%s\n", MSG); throw std::bad_alloc(); };

// #define LAMBDA_H(X, ...) [__VA_ARGS__] (float16 X) -> float16
// #define LAMBDA_HH(X, Y, ...) [__VA_ARGS__] (float16 X, float16 Y) -> float16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>openblas-platform</artifactId>
<version>${openblas.version}-1.4.1-SNAPSHOT</version>
<version>${openblas.version}-${javacpp-presets.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
Expand Down
4 changes: 2 additions & 2 deletions nd4j-backends/nd4j-backend-impls/nd4j-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>openblas</artifactId>
<version>${openblas.version}-1.4.1-SNAPSHOT</version>
<version>${openblas.version}-${javacpp-presets.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>openblas</artifactId>
<version>${openblas.version}-1.4.1-SNAPSHOT</version>
<version>${openblas.version}-${javacpp-presets.version}</version>
<classifier>${dependency.platform}</classifier>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 7823a8e

Please sign in to comment.