This commit is contained in:
Alexander Nozik 2024-06-04 10:31:42 +03:00
parent c418607bf6
commit c585c59552
4 changed files with 11 additions and 22 deletions

View File

@ -1,6 +1,5 @@
@file:Suppress("UNUSED_VARIABLE")
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
import space.kscience.kmath.benchmarks.addBenchmarkProperties
plugins {
@ -152,18 +151,12 @@ benchmark {
}
}
kotlin.sourceSets.all {
with(languageSettings) {
optIn("kotlin.contracts.ExperimentalContracts")
optIn("kotlin.ExperimentalUnsignedTypes")
optIn("space.kscience.kmath.UnstableKMathAPI")
}
}
tasks.withType<KotlinJvmCompile> {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all" + "-Xlambdas=indy"
kotlin {
jvmToolchain(11)
compilerOptions {
optIn.addAll(
"space.kscience.kmath.UnstableKMathAPI"
)
}
}

View File

@ -26,10 +26,8 @@ dependencies {
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
sourceSets.all {
languageSettings.optIn("kotlin.OptIn")
jvmToolchain(11)
compilerOptions {
optIn.add("kotlin.OptIn")
}
}

View File

@ -10,6 +10,6 @@ org.gradle.jvmargs=-Xmx4096m
org.gradle.parallel=true
org.gradle.workers.max=4
toolsVersion=0.15.2-kotlin-2.0.0-RC2
toolsVersion=0.15.4-kotlin-2.0.0
#kotlin.experimental.tryK2=true
#kscience.wasm.disabled=true

View File

@ -6,13 +6,11 @@
package space.kscience.kmath.nd
import space.kscience.kmath.UnsafeKMathAPI
import kotlin.jvm.JvmInline
/**
* A read-only ND shape
*/
@JvmInline
public value class ShapeND(@PublishedApi internal val array: IntArray) {
public class ShapeND(@PublishedApi internal val array: IntArray) {
public val size: Int get() = array.size
public operator fun get(index: Int): Int = array[index]
override fun toString(): String = array.contentToString()