From e3da358a7e65ef379df999b4469ddf48b32c34b1 Mon Sep 17 00:00:00 2001 From: Thomas Koopman Date: Thu, 5 Feb 2026 13:27:35 +0100 Subject: [PATCH] Compile .cu files via cctools as well, rather than nvcc directly. Also fix some warnings while I am at it --- src/CMakeLists.txt | 11 +++++------ src/auxiliary/src/CudaBenchmarking/bench.cu | 9 +++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 36e9e284..96465df6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -344,12 +344,11 @@ IF ("${TARGET}" MATCHES "^cuda.*" OR "${TARGET}" MATCHES "multi_gpu") MAIN_DEPENDENCY "${src}" IMPLICIT_DEPENDS C "${src}" COMMAND - nvcc -I${CMAKE_CURRENT_SOURCE_DIR}/${dir} - -I${CMAKE_CURRENT_BINARY_DIR}/${dir} - -O3 - --compiler-options -fPIC - -c "${src}" - -o "${dst}" + ${SAC2C} -Xc -I${CMAKE_CURRENT_SOURCE_DIR}/${dir} + -Xc -I${CMAKE_CURRENT_BINARY_DIR}/${dir} + -cc ccrmod + "${src}" + -o "${dst}" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${dir}" COMMENT "Generating ${dst} for target `${TARGET}'" diff --git a/src/auxiliary/src/CudaBenchmarking/bench.cu b/src/auxiliary/src/CudaBenchmarking/bench.cu index b37407b6..5cf50550 100644 --- a/src/auxiliary/src/CudaBenchmarking/bench.cu +++ b/src/auxiliary/src/CudaBenchmarking/bench.cu @@ -5,6 +5,7 @@ extern "C" { #include +#include #include #include #include @@ -80,7 +81,7 @@ void benchCreate( struct cudabench** interval) /* benchGetInterval actually creates the data structure */ } -struct cudabench* benchGetInterval_si(char * name, sac_int num) +struct cudabench* benchGetInterval_si(const char * name, sac_int num) { struct cudabench *interval; char* newName; @@ -100,14 +101,14 @@ struct cudabench* benchGetInterval_i( sac_int num) return( interval); } -struct cudabench* benchGetInterval_s( char *name) +struct cudabench* benchGetInterval_s(const char *name) { struct cudabench *interval; interval = benchGetInterval_si(name, -1); return( interval); } -struct cudabench* benchGetInterval_siu(char * name, sac_int num, sac_int timeunit) +struct cudabench* benchGetInterval_siu(const char * name, sac_int num, sac_int timeunit) { struct cudabench *interval; char* newName; @@ -127,7 +128,7 @@ struct cudabench* benchGetInterval_iu( sac_int num, sac_int timeunit) return( interval); } -struct cudabench* benchGetInterval_su( char *name, sac_int timeunit) +struct cudabench* benchGetInterval_su(const char *name, sac_int timeunit) { struct cudabench *interval; interval = benchGetInterval_siu(name, -1, timeunit);