diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts index 43fee6630..f0db2a77e 100644 --- a/benchmarks/build.gradle.kts +++ b/benchmarks/build.gradle.kts @@ -60,13 +60,14 @@ kotlin { dependencies { implementation(projects.kmathCommons) implementation(projects.kmathEjml) - implementation(projects.kmathNd4j) implementation(projects.kmathKotlingrad) implementation(projects.kmathViktor) implementation(projects.kmathOjalgo) implementation(projects.kmath.kmathTensorflow) implementation(projects.kmathMultik) implementation(libs.tensorflow.core.platform) +// implementation(projects.kmathNd4j) + // implementation(libs.nd4j.native.platform) // uncomment if your system supports AVX2 // val os = System.getProperty("os.name") diff --git a/benchmarks/src/jvmMain/kotlin/space/kscience/kmath/benchmarks/NDFieldBenchmark.kt b/benchmarks/src/jvmMain/kotlin/space/kscience/kmath/benchmarks/NDFieldBenchmark.kt index 06089ef2e..b0d4f9a22 100644 --- a/benchmarks/src/jvmMain/kotlin/space/kscience/kmath/benchmarks/NDFieldBenchmark.kt +++ b/benchmarks/src/jvmMain/kotlin/space/kscience/kmath/benchmarks/NDFieldBenchmark.kt @@ -15,7 +15,6 @@ import org.jetbrains.kotlinx.multik.ndarray.data.DN import org.jetbrains.kotlinx.multik.ndarray.data.DataType import space.kscience.kmath.UnsafeKMathAPI import space.kscience.kmath.nd.* -import space.kscience.kmath.nd4j.nd4j import space.kscience.kmath.operations.Float64Field import space.kscience.kmath.structures.Float64 import space.kscience.kmath.tensors.core.DoubleTensor @@ -32,7 +31,6 @@ internal class NDFieldBenchmark { private val shape = ShapeND(dim, dim) private val specializedField = Float64Field.ndAlgebra private val genericField = BufferedFieldOpsND(Float64Field) - private val nd4jField = Float64Field.nd4j private val viktorField = Float64Field.viktorAlgebra } diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index f90b2707c..41b555ff4 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -23,7 +23,6 @@ dependencies { implementation(project(":kmath-viktor")) implementation(project(":kmath-dimensions")) implementation(project(":kmath-ejml")) - implementation(project(":kmath-nd4j")) implementation(project(":kmath-tensors")) implementation(project(":kmath-symja")) implementation(project(":kmath-for-real")) @@ -32,9 +31,10 @@ dependencies { implementation(libs.multik.default) //datetime - implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0") + implementation(spclibs.kotlinx.datetime) - implementation("org.nd4j:nd4j-native:1.0.0-beta7") +// implementation(project(":kmath-nd4j")) +// implementation("org.nd4j:nd4j-native:1.0.0-beta7") // uncomment if your system supports AVX2 // val os = System.getProperty("os.name") @@ -44,7 +44,7 @@ dependencies { // os == "Linux" -> implementation("org.nd4j:nd4j-native:1.0.0-beta7:linux-x86_64-avx2") // os == "Mac OS X" -> implementation("org.nd4j:nd4j-native:1.0.0-beta7:macosx-x86_64-avx2") // } else - implementation("org.nd4j:nd4j-native-platform:1.0.0-beta7") +// implementation("org.nd4j:nd4j-native-platform:1.0.0-beta7") implementation("org.slf4j:slf4j-simple:1.7.32") // plotting diff --git a/examples/src/main/kotlin/space/kscience/kmath/structures/NDField.kt b/examples/src/main/kotlin/space/kscience/kmath/structures/NDField.kt index 2c65c2287..7c53c9152 100644 --- a/examples/src/main/kotlin/space/kscience/kmath/structures/NDField.kt +++ b/examples/src/main/kotlin/space/kscience/kmath/structures/NDField.kt @@ -7,9 +7,7 @@ package space.kscience.kmath.structures import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope -import org.nd4j.linalg.factory.Nd4j import space.kscience.kmath.nd.* -import space.kscience.kmath.nd4j.nd4j import space.kscience.kmath.operations.Float64Field import space.kscience.kmath.operations.invoke import space.kscience.kmath.viktor.ViktorFieldND @@ -26,7 +24,6 @@ internal inline fun measureAndPrint(title: String, block: () -> Unit) { @OptIn(DelicateCoroutinesApi::class) fun main() { // initializing Nd4j - Nd4j.zeros(0) val dim = 1000 val n = 1000 val shape = ShapeND(dim, dim) @@ -36,8 +33,6 @@ fun main() { val doubleField = Float64Field.ndAlgebra //A generic field. It should be used for objects, not primitives. val genericField = BufferedFieldOpsND(Float64Field) - // Nd4j specialized field. - val nd4jField = Float64Field.nd4j //viktor field val viktorField = ViktorFieldND(dim, dim) //parallel processing based on Java Streams @@ -57,13 +52,6 @@ fun main() { } } - measureAndPrint("Nd4j specialized addition") { - nd4jField { - var res: StructureND<Float64> = one(shape) - repeat(n) { res += 1.0 } - } - } - measureAndPrint("Viktor addition") { viktorField { var res: StructureND<Float64> = one diff --git a/settings.gradle.kts b/settings.gradle.kts index 950505c0f..6db7ee86b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -50,7 +50,7 @@ include( ":kmath-tensorflow", ":kmath-optimization", ":kmath-stat", - ":kmath-nd4j", +// ":kmath-nd4j", ":kmath-dimensions", ":kmath-for-real", ":kmath-geometry",