2019-06-08 16:25:51 +03:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
kotlin("jvm")
|
2020-09-27 19:57:30 +03:00
|
|
|
kotlin("plugin.allopen")
|
|
|
|
id("kotlinx.benchmark")
|
2019-06-08 16:25:51 +03:00
|
|
|
}
|
|
|
|
|
2020-09-08 12:40:47 +03:00
|
|
|
allOpen.annotation("org.openjdk.jmh.annotations.State")
|
|
|
|
sourceSets.register("benchmarks")
|
2019-06-08 16:25:51 +03:00
|
|
|
|
|
|
|
dependencies {
|
2020-10-12 18:42:34 +03:00
|
|
|
implementation(project(":kmath-ast"))
|
2020-10-13 15:47:07 +03:00
|
|
|
implementation(project(":kmath-kotlingrad"))
|
2019-06-08 16:25:51 +03:00
|
|
|
implementation(project(":kmath-core"))
|
|
|
|
implementation(project(":kmath-coroutines"))
|
|
|
|
implementation(project(":kmath-commons"))
|
2020-10-28 09:16:21 +03:00
|
|
|
implementation(project(":kmath-stat"))
|
2019-12-08 15:48:25 +03:00
|
|
|
implementation(project(":kmath-viktor"))
|
2019-12-09 19:52:00 +03:00
|
|
|
implementation(project(":kmath-dimensions"))
|
2020-09-09 19:42:43 +03:00
|
|
|
implementation(project(":kmath-ejml"))
|
2020-09-27 19:57:30 +03:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-io:0.2.0-npm-dev-11")
|
2020-09-08 12:40:47 +03:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime:0.2.0-dev-20")
|
2020-09-21 16:56:30 +03:00
|
|
|
implementation("org.slf4j:slf4j-simple:1.7.30")
|
|
|
|
"benchmarksImplementation"("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:0.2.0-dev-8")
|
|
|
|
"benchmarksImplementation"(sourceSets.main.get().output + sourceSets.main.get().runtimeClasspath)
|
2019-06-08 16:25:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Configure benchmark
|
|
|
|
benchmark {
|
|
|
|
// Setup configurations
|
2020-09-27 19:57:30 +03:00
|
|
|
targets.register("benchmarks")
|
|
|
|
// This one matches sourceSet name above
|
2019-06-08 16:25:51 +03:00
|
|
|
|
2020-09-08 12:40:47 +03:00
|
|
|
configurations.register("fast") {
|
|
|
|
warmups = 5 // number of warmup iterations
|
|
|
|
iterations = 3 // number of iterations
|
|
|
|
iterationTime = 500 // time in seconds per iteration
|
|
|
|
iterationTimeUnit = "ms" // time unity for iterationTime, default is seconds
|
2019-06-08 16:25:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-22 12:49:21 +03:00
|
|
|
kotlin.sourceSets.all {
|
|
|
|
with(languageSettings) {
|
|
|
|
useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
|
|
|
|
useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
|
|
|
|
}
|
|
|
|
}
|
2019-06-08 16:25:51 +03:00
|
|
|
|
2020-09-09 05:55:26 +03:00
|
|
|
tasks.withType<KotlinCompile> { kotlinOptions.jvmTarget = "11" }
|