Reorganising build.gradle for CUDA 12

Signed-off-by: brian <brian@brutex.de>
CUDA12
Brian Rosenberger 2023-08-28 11:39:46 +02:00
parent 43abd20b91
commit 2c0c3d01a0
5 changed files with 9 additions and 5 deletions

View File

@ -134,8 +134,8 @@ import java.util.List;
@Platform(value = "linux", preload = "gomp@.1", preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/", "/usr/local/cuda/lib64"}),
@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", "nd4jcuda"})
@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", "nd4jcuda"})
})
public class Nd4jCudaPresets implements LoadEnabled, InfoMapper {

View File

@ -20,7 +20,6 @@
package org.nd4j.jita.constant;
import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import org.nd4j.linalg.api.buffer.DataBuffer;
import org.nd4j.linalg.api.buffer.DataType;

View File

@ -24,6 +24,8 @@ option(FLATBUFFERS_BUILD_FLATC "Enable the build of the flatbuffers compiler" OF
set(FLATBUFFERS_BUILD_FLATC "OFF" CACHE STRING "Hack to disable flatc build" FORCE)
set(CMAKE_CXX_STANDARD 14)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
#///////////////////////////////////////////////////////////////////////////////
# genCompilation: Generates cpp, cu files

View File

@ -352,7 +352,7 @@ chipList.each { String thisChip ->
}
// Create Jar with classifier
tasks.getByName("${thisChip}Jar") { Jar thisTask ->
tasks.named("${thisChip}Jar").configure { Jar thisTask ->
dependsOn "javacpp${thisChip.capitalize()}SupportBuildCompiler"
dependsOn "javacpp${thisChip.capitalize()}SupportBuildCommand"
@ -374,6 +374,9 @@ chipList.each { String thisChip ->
from(sourceSets.named(thisChip).get().getOutput()) {
into "${javacppPlatform}/" //path within jar, we need it in a platform, that javacpp Loader understands
}
from(sourceSets.named("${thisChip}Generated").get().getOutput()) {
into "${javacppPlatform}/" //path within jar, we need it in a platform, that javacpp Loader understands
}
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}

View File

@ -331,7 +331,7 @@ if(SD_CUDA)
endif()
#target_link_libraries(${SD_LIBRARY_NAME} ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_cusolver_LIBRARY} ${CUDNN} ${MKLDNN})
target_link_libraries(${SD_LIBRARY_NAME} CUDA::cudart CUDA::cublas CUDA::cusolver CUDA::cublasLt ${CUDNN} ${MKLDNN})
target_link_libraries(${SD_LIBRARY_NAME} CUDA::cudart CUDA::cublas CUDA::cusolver CUDA::cublasLt Threads::Threads ${CUDNN} ${MKLDNN})
#target_link_libraries(${SD_LIBRARY_NAME} ${CUDNN} ${MKLDNN})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/cuda/${SD_EXTENSION})