Reorganising build.gradle for CUDA 12

Signed-off-by: brian <brian@brutex.de>
CUDA12
Brian Rosenberger 2023-08-28 11:54:32 +02:00
parent 2c0c3d01a0
commit 0eb56ef45f
3 changed files with 15 additions and 15 deletions

View File

@ -128,7 +128,7 @@ import java.util.List;
"cnpy/cnpy.h"
},
compiler = {"cpp11", "nowarnings"},
library = "jnind4jcuda",
library = "jni_nd4jcuda",
link = "nd4jcuda"),
@Platform(value = "linux", preload = "gomp@.1", preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/", "/usr/local/cuda/lib64"}),

View File

@ -41,6 +41,7 @@ dependencies {
tasks.named("compileJava").configure {
dependsOn ":cavis-native:cavis-native-lib:javacppCudaSupportBuildParser",
":cavis-native:cavis-native-lib:compileCudaGeneratedJava"
":cavis-native:cavis-native-lib:cudaJar"
}

View File

@ -290,20 +290,19 @@ chipList.each { String thisChip ->
// Generates jnijavacpp.cpp and jniNativeLibrary.cpp, compiles and links it
tasks.register("javacpp${thisChip.capitalize()}SupportBuildCompiler", org.bytedeco.gradle.javacpp.BuildTask) {
tasks.register("javacpp${thisChip.capitalize()}SupportBuildCompiler", org.bytedeco.gradle.javacpp.BuildTask) {org.bytedeco.gradle.javacpp.BuildTask it ->
if (project.hasProperty("skip-native") && project.getProperty("skip-native").equals("true")) {
enabled = false
}
def thisTask = (org.bytedeco.gradle.javacpp.BuildTask) it
thisTask.linkPath = ["${projectDir}/blasbuild/${thisChip}/${avxExtension}/output"]
thisTask.includePath = ["${projectDir}/src/main/cpp/blas/",
linkPath = ["${projectDir}/blasbuild/${thisChip}/${avxExtension}/output"]
includePath = ["${projectDir}/src/main/cpp/blas/",
"${projectDir}/blasbuild/${thisChip}/${avxExtension}/src/main/include/",
"${projectDir}/blasbuild/${thisChip}/${avxExtension}/flatbuffers-src/include",
"${projectDir}/blasbuild/${thisChip}/${avxExtension}/cpu_features-src/include",
"${projectDir}/blasbuild/${thisChip}/${avxExtension}/mkldnn-src/include"]
thisTask.properties = getBuildPlatform( thisChip, thisTask )
properties = getBuildPlatform( thisChip, it )
if(thisChip.equals('cuda') && osdetector.os.startsWith("win") && project.hasProperty("skip-native")
&& !project.getProperty("skip-native").equals("true") && !VISUAL_STUDIO_INSTALL_DIR.isEmpty()) {
@ -339,16 +338,16 @@ chipList.each { String thisChip ->
}
thisTask.buildPath = ["${buildDir}/generated/sources/javacpp/${thisChip}/${javacppPlatform}${javacppPlatformExtension}/"]
thisTask.copyLibs = true
thisTask.deleteJniFiles(false)
outputName = "jnind4j${thisChip}"
thisTask.outputDirectory = file("${buildDir}/generated/sources/javacpp/${thisChip}/${javacppPlatform}${javacppPlatformExtension}/")
thisTask.classOrPackageNames= ["org.nd4j.nativeblas.Nd4j${thisChip.capitalize()}"]
buildPath = ["${buildDir}/generated/sources/javacpp/${thisChip}/${javacppPlatform}${javacppPlatformExtension}/"]
copyLibs = true
deleteJniFiles(false)
//outputName = "jnind4j${thisChip}"
outputDirectory = file("${buildDir}/generated/sources/javacpp/${thisChip}/${javacppPlatform}${javacppPlatformExtension}/")
classOrPackageNames= ["org.nd4j.nativeblas.Nd4j${thisChip.capitalize()}"]
thisTask.configDirectory = file("${buildDir}/classes/java/${thisChip}Support/META-INF/native-image/${javacppPlatform}")
thisTask.classPath = sourceSets.named("${thisChip}Generated").get().compileClasspath.collect()
thisTask.classPath += "${buildDir}/classes/java/main/"
configDirectory = file("${buildDir}/classes/java/${thisChip}Support/META-INF/native-image/${javacppPlatform}")
classPath = sourceSets.named("${thisChip}Generated").get().compileClasspath.collect()
classPath += "${buildDir}/classes/java/main/"
}
// Create Jar with classifier