From 47771d55092b02fd91394e420d21cb95892fed49 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 29 Aug 2023 13:40:56 +0200 Subject: [PATCH] Reorganising build.gradle for CUDA 12 Signed-off-by: brian --- .../java/org/nd4j/nativeblas/cuda/Nd4jCudaPresets.java | 3 +-- cavis-native/cavis-native-lib/build.gradle | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cavis-native/cavis-native-cuda-presets/src/main/java/org/nd4j/nativeblas/cuda/Nd4jCudaPresets.java b/cavis-native/cavis-native-cuda-presets/src/main/java/org/nd4j/nativeblas/cuda/Nd4jCudaPresets.java index e6474877e..4784a2ac2 100644 --- a/cavis-native/cavis-native-cuda-presets/src/main/java/org/nd4j/nativeblas/cuda/Nd4jCudaPresets.java +++ b/cavis-native/cavis-native-cuda-presets/src/main/java/org/nd4j/nativeblas/cuda/Nd4jCudaPresets.java @@ -136,8 +136,7 @@ import java.util.List; @Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}), @Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}), @Platform(value = "linux-ppc64", preloadpath = {"/usr/powerpc64-linux-gnu/lib/", "/usr/powerpc64le-linux-gnu/lib/", "/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}), - @Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6", "libnd4jcuda"}), - @Platform(extension = {"-avx512", "-avx2"}) + @Platform(value = "windows", preload = {"libwinpthread-1", "libgcc_s_seh-1", "libgomp-1", "libstdc++-6", "libnd4jcuda"}) }) public class Nd4jCudaPresets implements LoadEnabled, InfoMapper { diff --git a/cavis-native/cavis-native-lib/build.gradle b/cavis-native/cavis-native-lib/build.gradle index 90585cead..72b325ac8 100644 --- a/cavis-native/cavis-native-lib/build.gradle +++ b/cavis-native/cavis-native-lib/build.gradle @@ -229,10 +229,7 @@ chipList.each { String thisChip -> /* Get VCVARS in case we want to build CUDA * MinGW64 g++ on MSYS is used otherwise */ - if (thisChip.equals('cuda') && osdetector.os.startsWith("win") - && project.hasProperty("skip-native") - && !project.getProperty("skip-native").equals("true") - && !VISUAL_STUDIO_INSTALL_DIR.isEmpty()) { + if (thisChip.equals('cuda') && osdetector.os.startsWith("win") && !VISUAL_STUDIO_INSTALL_DIR.isEmpty()) { def proc = ["cmd.exe", "/c", "${VISUAL_STUDIO_VCVARS_CMD} > nul && set"].execute() it.environmentVariables = it.environmentVariables ?: [:] def lines = proc.text.split("\\r?\\n") @@ -306,8 +303,7 @@ chipList.each { String thisChip -> 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()) { + if(thisChip.equals('cuda') && osdetector.os.startsWith("win") && !VISUAL_STUDIO_INSTALL_DIR.isEmpty()) { def proc = ["cmd.exe", "/c", "${VISUAL_STUDIO_VCVARS_CMD} > nul && where.exe cl.exe"].execute() def outp = proc.text def cl = "\"" + outp.replace("\\", "\\\\").trim() + "\""