moved to torch 1.10.2

This commit is contained in:
Roland Grinis 2022-02-07 09:15:03 +00:00
parent 705b27aa4b
commit 9ca896b608
2 changed files with 8 additions and 5 deletions

View File

@ -26,6 +26,9 @@ $ ./gradlew -Dorg.gradle.java.home=/path/to/local/jdk -q publishToMavenLocal
``` ```
This will fetch and build the `JNI` wrapper `jnoa`. This will fetch and build the `JNI` wrapper `jnoa`.
The library has been tested with
[graalvm-ce-java11-linux-amd64-22.0.0.2.](https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java11-linux-amd64-22.0.0.2.tar.gz)
In your own application add the local dependency: In your own application add the local dependency:
```kotlin ```kotlin
repositories { repositories {
@ -34,12 +37,12 @@ repositories {
} }
dependencies { dependencies {
implementation("space.kscience:kmath-noa:0.3.0-dev-14") implementation("space.kscience:kmath-noa:0.3.0-dev-17")
} }
``` ```
To load the native library you will need to add to the VM options: To load the native library you will need to add to the VM options:
``` ```
-Djava.library.path=${HOME}/.konan/third-party/noa-v0.0.1/cpp-build/jnoa -Djava.library.path=${HOME}/.kmath/third-party/noa-v0.0.1/cpp-build/jnoa
``` ```
## Usage ## Usage

View File

@ -20,7 +20,7 @@ dependencies {
val home: String = System.getProperty("user.home") val home: String = System.getProperty("user.home")
val javaHome: String = System.getProperty("java.home") val javaHome: String = System.getProperty("java.home")
val thirdPartyDir = "$home/.konan/third-party/noa-v0.0.1" val thirdPartyDir = "$home/.kmath/third-party/noa-v0.0.1"
val cppBuildDir = "$thirdPartyDir/cpp-build" val cppBuildDir = "$thirdPartyDir/cpp-build"
val jNoaDir = "$thirdPartyDir/jnoa/noa-kmath" val jNoaDir = "$thirdPartyDir/jnoa/noa-kmath"
@ -72,8 +72,8 @@ val downloadClang by tasks.registering(Download::class) {
} }
val downloadTorch by tasks.registering(Download::class) { val downloadTorch by tasks.registering(Download::class) {
val torchVersion = "$torchArchive-shared-with-deps-1.9.0%2B" val torchVersion = "$torchArchive-shared-with-deps-1.10.2%2B"
val cudaUrl = "https://download.pytorch.org/libtorch/cu111/${torchVersion}cu111.zip" val cudaUrl = "https://download.pytorch.org/libtorch/cu113/${torchVersion}cu113.zip"
val cpuUrl = "https://download.pytorch.org/libtorch/cpu/${torchVersion}cpu.zip" val cpuUrl = "https://download.pytorch.org/libtorch/cpu/${torchVersion}cpu.zip"
val url = if (cudaFound) cudaUrl else cpuUrl val url = if (cudaFound) cudaUrl else cpuUrl
src(url) src(url)