2019-06-08 16:25:51 +03:00
|
|
|
import org.jetbrains.kotlin.allopen.gradle.AllOpenExtension
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
kotlin("jvm")
|
2019-11-20 16:12:41 +03:00
|
|
|
kotlin("plugin.allopen") version "1.3.60"
|
|
|
|
id("kotlinx.benchmark") version "0.2.0-dev-5"
|
2019-06-08 16:25:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
configure<AllOpenExtension> {
|
|
|
|
annotation("org.openjdk.jmh.annotations.State")
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
|
|
|
maven("http://dl.bintray.com/kyonifer/maven")
|
2019-07-17 14:21:37 +03:00
|
|
|
maven ("https://dl.bintray.com/orangy/maven")
|
|
|
|
|
2019-06-08 16:25:51 +03:00
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
register("benchmarks")
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(project(":kmath-core"))
|
|
|
|
implementation(project(":kmath-coroutines"))
|
|
|
|
implementation(project(":kmath-commons"))
|
|
|
|
implementation(project(":kmath-koma"))
|
|
|
|
implementation("com.kyonifer:koma-core-ejml:0.12")
|
2019-07-17 14:21:37 +03:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-io-jvm:${Scientifik.ioVersion}")
|
2019-06-08 16:25:51 +03:00
|
|
|
|
2019-07-17 14:21:37 +03:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime:0.2.0-dev-2")
|
2019-06-08 16:25:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
"benchmarksCompile"(sourceSets.main.get().compileClasspath)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Configure benchmark
|
|
|
|
benchmark {
|
|
|
|
// Setup configurations
|
|
|
|
targets {
|
|
|
|
// This one matches sourceSet name above
|
2019-07-17 14:21:37 +03:00
|
|
|
register("benchmarks")
|
2019-06-08 16:25:51 +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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tasks.withType<KotlinCompile> {
|
|
|
|
kotlinOptions {
|
2019-11-20 16:12:41 +03:00
|
|
|
jvmTarget = Scientifik.JVM_VERSION
|
2019-06-08 16:25:51 +03:00
|
|
|
}
|
|
|
|
}
|