From ad9775132792b93e33c143cbfe38b347bc26abf3 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 4 Sep 2022 20:59:30 +0300 Subject: [PATCH] Refactor for build tools 0.13.0 --- build.gradle.kts | 11 ++++++++-- .../kmath/structures/StreamDoubleFieldND.kt | 4 ++++ .../kscience/kmath/tensors/OLSWithSVD.kt | 2 ++ .../kscience/kmath/tensors/neuralNetwork.kt | 3 +++ gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- kmath-ast/build.gradle.kts | 7 +++++-- .../ast/rendering/multiplatformToString.kt | 9 ++++++++ .../kscience/kmath/ast/runCompilerTest.kt | 10 +++++++++ kmath-commons/build.gradle.kts | 3 +-- kmath-complex/build.gradle.kts | 12 ++++++----- kmath-core/build.gradle.kts | 21 +++++++------------ kmath-coroutines/build.gradle.kts | 8 ++++--- kmath-dimensions/build.gradle.kts | 5 ++++- kmath-ejml/build.gradle.kts | 3 +-- .../space/kscience/kmath/ejml/_generated.kt | 4 ++-- kmath-for-real/build.gradle.kts | 8 ++++--- kmath-functions/build.gradle.kts | 8 ++++--- kmath-geometry/build.gradle.kts | 5 ++++- kmath-histograms/build.gradle.kts | 5 ++++- kmath-kotlingrad/build.gradle.kts | 3 +-- kmath-memory/build.gradle.kts | 5 ++++- .../kscience/kmath/multik/MultikNDTest.kt | 2 ++ kmath-nd4j/build.gradle.kts | 3 +-- .../kscience/kmath/nd4j/Nd4jArrayAlgebra.kt | 2 ++ .../kscience/kmath/nd4j/Nd4jTensorAlgebra.kt | 3 +++ kmath-optimization/build.gradle.kts | 5 ++++- kmath-polynomial/build.gradle.kts | 6 ++++-- kmath-stat/build.gradle.kts | 5 ++++- kmath-symja/build.gradle.kts | 3 +-- .../tensorflow/DoubleTensorFlowAlgebra.kt | 1 + .../kmath/tensorflow/DoubleTensorFlowOps.kt | 2 ++ kmath-tensors/build.gradle.kts | 8 ++++--- kmath-trajectory/build.gradle.kts | 8 ++++--- kmath-viktor/build.gradle.kts | 5 ++--- .../kscience/kmath/viktor/ViktorBuffer.kt | 2 +- test-utils/build.gradle.kts | 5 ++++- 37 files changed, 136 insertions(+), 64 deletions(-) create mode 100644 kmath-ast/src/nativeMain/kotlin/space/kscience/kmath/ast/rendering/multiplatformToString.kt create mode 100644 kmath-ast/src/nativeTest/kotlin/space/kscience/kmath/ast/runCompilerTest.kt diff --git a/build.gradle.kts b/build.gradle.kts index 04cb76285..4a083b437 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,6 @@ +import space.kscience.gradle.useApache2Licence +import space.kscience.gradle.useSPCTeam + plugins { id("space.kscience.gradle.project") id("org.jetbrains.kotlinx.kover") version "0.5.0" @@ -68,8 +71,12 @@ subprojects { readme.readmeTemplate = file("docs/templates/README-TEMPLATE.md") ksciencePublish { - github("kmath", addToRelease = false) - space() + pom("https://github.com/SciProgCentre/kmath") { + useApache2Licence() + useSPCTeam() + } + github("kmath", "SciProgCentre", addToRelease = false) + space("https://maven.pkg.jetbrains.space/mipt-npm/p/sci/dev") sonatype() } diff --git a/examples/src/main/kotlin/space/kscience/kmath/structures/StreamDoubleFieldND.kt b/examples/src/main/kotlin/space/kscience/kmath/structures/StreamDoubleFieldND.kt index aed0a7868..4aa420305 100644 --- a/examples/src/main/kotlin/space/kscience/kmath/structures/StreamDoubleFieldND.kt +++ b/examples/src/main/kotlin/space/kscience/kmath/structures/StreamDoubleFieldND.kt @@ -5,6 +5,7 @@ package space.kscience.kmath.structures +import space.kscience.kmath.misc.PerformancePitfall import space.kscience.kmath.nd.* import space.kscience.kmath.operations.DoubleField import space.kscience.kmath.operations.ExtendedField @@ -49,6 +50,7 @@ class StreamDoubleFieldND(override val shape: IntArray) : FieldND.map( transform: DoubleField.(Double) -> Double, ): BufferND { @@ -56,6 +58,7 @@ class StreamDoubleFieldND(override val shape: IntArray) : FieldND.mapIndexed( transform: DoubleField.(index: IntArray, Double) -> Double, ): BufferND { @@ -69,6 +72,7 @@ class StreamDoubleFieldND(override val shape: IntArray) : FieldND, right: StructureND, diff --git a/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt b/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt index f7c5bb4b7..8082ed8e2 100644 --- a/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt +++ b/examples/src/main/kotlin/space/kscience/kmath/tensors/OLSWithSVD.kt @@ -5,6 +5,7 @@ package space.kscience.kmath.tensors +import space.kscience.kmath.misc.PerformancePitfall import space.kscience.kmath.operations.invoke import space.kscience.kmath.tensors.core.DoubleTensor import space.kscience.kmath.tensors.core.DoubleTensorAlgebra @@ -13,6 +14,7 @@ import kotlin.math.abs // OLS estimator using SVD +@OptIn(PerformancePitfall::class) fun main() { //seed for random val randSeed = 100500L diff --git a/examples/src/main/kotlin/space/kscience/kmath/tensors/neuralNetwork.kt b/examples/src/main/kotlin/space/kscience/kmath/tensors/neuralNetwork.kt index cbc83c336..502f6d53f 100644 --- a/examples/src/main/kotlin/space/kscience/kmath/tensors/neuralNetwork.kt +++ b/examples/src/main/kotlin/space/kscience/kmath/tensors/neuralNetwork.kt @@ -3,8 +3,11 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ +@file:OptIn(PerformancePitfall::class) + package space.kscience.kmath.tensors +import space.kscience.kmath.misc.PerformancePitfall import space.kscience.kmath.operations.invoke import space.kscience.kmath.tensors.core.BroadcastDoubleTensorAlgebra import space.kscience.kmath.tensors.core.DoubleTensor diff --git a/gradle.properties b/gradle.properties index b3e3f4cda..0d1506980 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,4 +12,4 @@ org.gradle.configureondemand=true org.gradle.parallel=true org.gradle.jvmargs=-Xmx4096m -toolsVersion=0.12.0-kotlin-1.7.20-Beta +toolsVersion=0.13.0-kotlin-1.7.20-Beta diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fcea..8049c684f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/kmath-ast/build.gradle.kts b/kmath-ast/build.gradle.kts index c1333eba5..7fd0f43f7 100644 --- a/kmath-ast/build.gradle.kts +++ b/kmath-ast/build.gradle.kts @@ -1,6 +1,9 @@ plugins { - kotlin("multiplatform") - id("space.kscience.gradle.common") + id("space.kscience.gradle.mpp") +} + +kscience{ + native() } kotlin.js { diff --git a/kmath-ast/src/nativeMain/kotlin/space/kscience/kmath/ast/rendering/multiplatformToString.kt b/kmath-ast/src/nativeMain/kotlin/space/kscience/kmath/ast/rendering/multiplatformToString.kt new file mode 100644 index 000000000..ec66be830 --- /dev/null +++ b/kmath-ast/src/nativeMain/kotlin/space/kscience/kmath/ast/rendering/multiplatformToString.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2018-2022 KMath contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package space.kscience.kmath.ast.rendering + +internal actual fun Double.multiplatformToString(): String = toString() +internal actual fun Float.multiplatformToString(): String = toString() diff --git a/kmath-ast/src/nativeTest/kotlin/space/kscience/kmath/ast/runCompilerTest.kt b/kmath-ast/src/nativeTest/kotlin/space/kscience/kmath/ast/runCompilerTest.kt new file mode 100644 index 000000000..0674b0492 --- /dev/null +++ b/kmath-ast/src/nativeTest/kotlin/space/kscience/kmath/ast/runCompilerTest.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2018-2022 KMath contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package space.kscience.kmath.ast + +internal actual inline fun runCompilerTest(action: CompilerTestContext.() -> Unit) { + //doNothing +} \ No newline at end of file diff --git a/kmath-commons/build.gradle.kts b/kmath-commons/build.gradle.kts index 643307b48..50fef7ac8 100644 --- a/kmath-commons/build.gradle.kts +++ b/kmath-commons/build.gradle.kts @@ -1,6 +1,5 @@ plugins { - kotlin("jvm") - id("space.kscience.gradle.common") + id("space.kscience.gradle.jvm") } description = "Commons math binding for kmath" diff --git a/kmath-complex/build.gradle.kts b/kmath-complex/build.gradle.kts index dbe96b153..b63def0a7 100644 --- a/kmath-complex/build.gradle.kts +++ b/kmath-complex/build.gradle.kts @@ -1,7 +1,9 @@ plugins { - kotlin("multiplatform") - id("space.kscience.gradle.common") - id("space.kscience.gradle.native") + id("space.kscience.gradle.mpp") +} + +kscience { + native() } kotlin.sourceSets { @@ -20,14 +22,14 @@ readme { feature( id = "complex", ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt" - ){ + ) { "Complex numbers operations" } feature( id = "quaternion", ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt" - ){ + ) { "Quaternions and their composition" } } diff --git a/kmath-core/build.gradle.kts b/kmath-core/build.gradle.kts index d055b5350..f33d33324 100644 --- a/kmath-core/build.gradle.kts +++ b/kmath-core/build.gradle.kts @@ -1,6 +1,13 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience{ + native() + + dependencies { + api(project(":kmath-memory")) + } } kotlin.sourceSets { @@ -10,20 +17,8 @@ kotlin.sourceSets { it.optIn("space.kscience.kmath.misc.PerformancePitfall") it.optIn("space.kscience.kmath.misc.UnstableKMathAPI") } - - commonMain { - dependencies { - api(project(":kmath-memory")) - } - } } -//generateUml { -// classTree { -// -// } -//} - readme { description = "Core classes, algebra definitions, basic linear algebra" maturity = space.kscience.gradle.Maturity.DEVELOPMENT diff --git a/kmath-coroutines/build.gradle.kts b/kmath-coroutines/build.gradle.kts index 104adf268..529084619 100644 --- a/kmath-coroutines/build.gradle.kts +++ b/kmath-coroutines/build.gradle.kts @@ -1,7 +1,9 @@ plugins { - kotlin("multiplatform") - id("space.kscience.gradle.common") - id("space.kscience.gradle.native") + id("space.kscience.gradle.mpp") +} + +kscience{ + native() } kotlin.sourceSets { diff --git a/kmath-dimensions/build.gradle.kts b/kmath-dimensions/build.gradle.kts index 1c042ab70..29c0eccb6 100644 --- a/kmath-dimensions/build.gradle.kts +++ b/kmath-dimensions/build.gradle.kts @@ -1,6 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience{ + native() } description = "A proof of concept module for adding type-safe dimensions to structures" diff --git a/kmath-ejml/build.gradle.kts b/kmath-ejml/build.gradle.kts index d400d6600..d7f780d79 100644 --- a/kmath-ejml/build.gradle.kts +++ b/kmath-ejml/build.gradle.kts @@ -1,8 +1,7 @@ import space.kscience.kmath.ejml.codegen.ejmlCodegen plugins { - kotlin("jvm") - id("space.kscience.gradle.common") + id("space.kscience.gradle.jvm") } dependencies { diff --git a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt index 5426055b3..aac327a84 100644 --- a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt +++ b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt @@ -1,6 +1,6 @@ /* - * Copyright 2018-2022 KMath contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + * Copyright 2018-2021 KMath contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. */ /* This file is generated with buildSrc/src/main/kotlin/space/kscience/kmath/ejml/codegen/ejmlCodegen.kt */ diff --git a/kmath-for-real/build.gradle.kts b/kmath-for-real/build.gradle.kts index 6b6242c24..308b8d732 100644 --- a/kmath-for-real/build.gradle.kts +++ b/kmath-for-real/build.gradle.kts @@ -1,7 +1,9 @@ plugins { - kotlin("multiplatform") - id("space.kscience.gradle.common") - id("space.kscience.gradle.native") + id("space.kscience.gradle.mpp") +} + +kscience{ + native() } kotlin.sourceSets.commonMain { diff --git a/kmath-functions/build.gradle.kts b/kmath-functions/build.gradle.kts index c68102c2e..2e7b023c1 100644 --- a/kmath-functions/build.gradle.kts +++ b/kmath-functions/build.gradle.kts @@ -1,7 +1,9 @@ plugins { - kotlin("multiplatform") - id("space.kscience.gradle.common") - id("space.kscience.gradle.native") + id("space.kscience.gradle.mpp") +} + +kscience{ + native() } description = "Functions, integration and interpolation" diff --git a/kmath-geometry/build.gradle.kts b/kmath-geometry/build.gradle.kts index c2057bcbe..b868af8d0 100644 --- a/kmath-geometry/build.gradle.kts +++ b/kmath-geometry/build.gradle.kts @@ -1,6 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience{ + native() } kotlin.sourceSets.commonMain { diff --git a/kmath-histograms/build.gradle.kts b/kmath-histograms/build.gradle.kts index 94d1f5fb7..d31526a74 100644 --- a/kmath-histograms/build.gradle.kts +++ b/kmath-histograms/build.gradle.kts @@ -1,6 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience{ + native() } //apply(plugin = "kotlinx-atomicfu") diff --git a/kmath-kotlingrad/build.gradle.kts b/kmath-kotlingrad/build.gradle.kts index a7f4ee37f..cf4a4bc1d 100644 --- a/kmath-kotlingrad/build.gradle.kts +++ b/kmath-kotlingrad/build.gradle.kts @@ -1,6 +1,5 @@ plugins { - kotlin("jvm") - id("space.kscience.gradle.common") + id("space.kscience.gradle.jvm") } kotlin.sourceSets diff --git a/kmath-memory/build.gradle.kts b/kmath-memory/build.gradle.kts index 55a7ff6aa..50eb448a7 100644 --- a/kmath-memory/build.gradle.kts +++ b/kmath-memory/build.gradle.kts @@ -1,6 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience { + native() } readme { diff --git a/kmath-multik/src/commonTest/kotlin/space/kscience/kmath/multik/MultikNDTest.kt b/kmath-multik/src/commonTest/kotlin/space/kscience/kmath/multik/MultikNDTest.kt index 8ad220221..392532d8e 100644 --- a/kmath-multik/src/commonTest/kotlin/space/kscience/kmath/multik/MultikNDTest.kt +++ b/kmath-multik/src/commonTest/kotlin/space/kscience/kmath/multik/MultikNDTest.kt @@ -6,6 +6,7 @@ package space.kscience.kmath.multik import org.jetbrains.kotlinx.multik.default.DefaultEngine +import space.kscience.kmath.misc.PerformancePitfall import space.kscience.kmath.nd.StructureND import space.kscience.kmath.nd.one import space.kscience.kmath.operations.DoubleField @@ -14,6 +15,7 @@ import space.kscience.kmath.tensors.core.tensorAlgebra import kotlin.test.Test import kotlin.test.assertTrue +@OptIn(PerformancePitfall::class) internal class MultikNDTest { val multikAlgebra = MultikDoubleAlgebra(DefaultEngine()) diff --git a/kmath-nd4j/build.gradle.kts b/kmath-nd4j/build.gradle.kts index 11af7d6dc..e5c4af891 100644 --- a/kmath-nd4j/build.gradle.kts +++ b/kmath-nd4j/build.gradle.kts @@ -1,6 +1,5 @@ plugins { - kotlin("jvm") - id("space.kscience.gradle.common") + id("space.kscience.gradle.jvm") } description = "ND4J NDStructure implementation and according NDAlgebra classes" diff --git a/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt b/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt index f359b9115..859773211 100644 --- a/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt +++ b/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt @@ -45,6 +45,7 @@ public sealed interface Nd4jArrayAlgebra> : AlgebraND.mapIndexed( transform: C.(index: IntArray, T) -> T, ): Nd4jArrayStructure { @@ -53,6 +54,7 @@ public sealed interface Nd4jArrayAlgebra> : AlgebraND, right: StructureND, diff --git a/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jTensorAlgebra.kt b/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jTensorAlgebra.kt index 5ecfe30d6..b6a2029e7 100644 --- a/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jTensorAlgebra.kt +++ b/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jTensorAlgebra.kt @@ -40,12 +40,15 @@ public sealed interface Nd4jTensorAlgebra> : AnalyticTe override fun structureND(shape: Shape, initializer: A.(IntArray) -> T): Nd4jArrayStructure + @OptIn(PerformancePitfall::class) override fun StructureND.map(transform: A.(T) -> T): Nd4jArrayStructure = structureND(shape) { index -> elementAlgebra.transform(get(index)) } + @OptIn(PerformancePitfall::class) override fun StructureND.mapIndexed(transform: A.(index: IntArray, T) -> T): Nd4jArrayStructure = structureND(shape) { index -> elementAlgebra.transform(index, get(index)) } + @OptIn(PerformancePitfall::class) override fun zip(left: StructureND, right: StructureND, transform: A.(T, T) -> T): Nd4jArrayStructure { require(left.shape.contentEquals(right.shape)) return structureND(left.shape) { index -> elementAlgebra.transform(left[index], right[index]) } diff --git a/kmath-optimization/build.gradle.kts b/kmath-optimization/build.gradle.kts index 53f379830..f4256b9aa 100644 --- a/kmath-optimization/build.gradle.kts +++ b/kmath-optimization/build.gradle.kts @@ -1,6 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience{ + native() } kotlin.sourceSets { diff --git a/kmath-polynomial/build.gradle.kts b/kmath-polynomial/build.gradle.kts index c6946878c..4e469f0d1 100644 --- a/kmath-polynomial/build.gradle.kts +++ b/kmath-polynomial/build.gradle.kts @@ -1,7 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - // Disable native target to avoid CI crashes -// id("space.kscience.gradle.native") +} + +kscience{ + native() } description = "Polynomials, rational functions, and utilities" diff --git a/kmath-stat/build.gradle.kts b/kmath-stat/build.gradle.kts index 1d1831047..f6ca54e17 100644 --- a/kmath-stat/build.gradle.kts +++ b/kmath-stat/build.gradle.kts @@ -1,6 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience{ + native() } kotlin.sourceSets { diff --git a/kmath-symja/build.gradle.kts b/kmath-symja/build.gradle.kts index 1984236ca..8741de2ae 100644 --- a/kmath-symja/build.gradle.kts +++ b/kmath-symja/build.gradle.kts @@ -4,8 +4,7 @@ */ plugins { - kotlin("jvm") - id("space.kscience.gradle.common") + id("space.kscience.gradle.jvm") } description = "Symja integration module" diff --git a/kmath-tensorflow/src/main/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowAlgebra.kt b/kmath-tensorflow/src/main/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowAlgebra.kt index fa7050d2a..c4d192792 100644 --- a/kmath-tensorflow/src/main/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowAlgebra.kt +++ b/kmath-tensorflow/src/main/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowAlgebra.kt @@ -93,6 +93,7 @@ public fun DoubleField.produceWithTF( * * The resulting tensors are available outside of scope */ +@OptIn(UnstableKMathAPI::class) public fun DoubleField.produceMapWithTF( block: DoubleTensorFlowAlgebra.() -> Map>, ): Map> = Graph().use { graph -> diff --git a/kmath-tensorflow/src/test/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowOps.kt b/kmath-tensorflow/src/test/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowOps.kt index 21340a8db..a35556be1 100644 --- a/kmath-tensorflow/src/test/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowOps.kt +++ b/kmath-tensorflow/src/test/kotlin/space/kscience/kmath/tensorflow/DoubleTensorFlowOps.kt @@ -6,6 +6,7 @@ package space.kscience.kmath.tensorflow import org.junit.jupiter.api.Test +import space.kscience.kmath.misc.UnstableKMathAPI import space.kscience.kmath.nd.get import space.kscience.kmath.nd.structureND import space.kscience.kmath.operations.DoubleField @@ -13,6 +14,7 @@ import space.kscience.kmath.tensors.core.DoubleTensorAlgebra import space.kscience.kmath.tensors.core.DoubleTensorAlgebra.Companion.sum import kotlin.test.assertEquals +@OptIn(UnstableKMathAPI::class) class DoubleTensorFlowOps { @Test fun basicOps() { diff --git a/kmath-tensors/build.gradle.kts b/kmath-tensors/build.gradle.kts index b2a4c36bd..3d92f07b6 100644 --- a/kmath-tensors/build.gradle.kts +++ b/kmath-tensors/build.gradle.kts @@ -1,7 +1,9 @@ plugins { - kotlin("multiplatform") - id("space.kscience.gradle.common") - id("space.kscience.gradle.native") + id("space.kscience.gradle.mpp") +} + +kscience{ + native() } kotlin.sourceSets { diff --git a/kmath-trajectory/build.gradle.kts b/kmath-trajectory/build.gradle.kts index f4dba25ab..5ee0a241d 100644 --- a/kmath-trajectory/build.gradle.kts +++ b/kmath-trajectory/build.gradle.kts @@ -1,7 +1,9 @@ plugins { - kotlin("multiplatform") - id("space.kscience.gradle.common") - id("space.kscience.gradle.native") + id("space.kscience.gradle.mpp") +} + +kscience{ + native() } kotlin.sourceSets.commonMain { diff --git a/kmath-viktor/build.gradle.kts b/kmath-viktor/build.gradle.kts index 1b22e9c38..7a135f316 100644 --- a/kmath-viktor/build.gradle.kts +++ b/kmath-viktor/build.gradle.kts @@ -1,13 +1,12 @@ plugins { - kotlin("jvm") - id("space.kscience.gradle.common") + id("space.kscience.gradle.jvm") } description = "Binding for https://github.com/JetBrains-Research/viktor" dependencies { api(project(":kmath-core")) - api("org.jetbrains.bio:viktor:1.1.0") + api("org.jetbrains.bio:viktor:1.2.0") } readme { diff --git a/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorBuffer.kt b/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorBuffer.kt index 90d5ad9a9..52dc1e192 100644 --- a/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorBuffer.kt +++ b/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorBuffer.kt @@ -13,7 +13,7 @@ import space.kscience.kmath.structures.MutableBuffer @JvmInline public value class ViktorBuffer(public val flatArray: F64FlatArray) : MutableBuffer { override val size: Int - get() = flatArray.size + get() = flatArray.length override inline fun get(index: Int): Double = flatArray[index] diff --git a/test-utils/build.gradle.kts b/test-utils/build.gradle.kts index 49c4758e3..98bd7328d 100644 --- a/test-utils/build.gradle.kts +++ b/test-utils/build.gradle.kts @@ -1,6 +1,9 @@ plugins { id("space.kscience.gradle.mpp") - id("space.kscience.gradle.native") +} + +kscience{ + native() } kotlin.sourceSets {