Skip to content

Commit f137cdd

Browse files
Thomas KoopmanJordyAaldering
authored andcommitted
Compile .cu files via cctools as well, rather than nvcc directly. Also fix some warnings while I am at it
1 parent a599572 commit f137cdd

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,11 @@ IF ("${TARGET}" MATCHES "^cuda.*" OR "${TARGET}" MATCHES "multi_gpu")
344344
MAIN_DEPENDENCY "${src}"
345345
IMPLICIT_DEPENDS C "${src}"
346346
COMMAND
347-
nvcc -I${CMAKE_CURRENT_SOURCE_DIR}/${dir}
348-
-I${CMAKE_CURRENT_BINARY_DIR}/${dir}
349-
-O3
350-
--compiler-options -fPIC
351-
-c "${src}"
352-
-o "${dst}"
347+
${SAC2C} -Xc -I${CMAKE_CURRENT_SOURCE_DIR}/${dir}
348+
-Xc -I${CMAKE_CURRENT_BINARY_DIR}/${dir}
349+
-cc ccrmod
350+
"${src}"
351+
-o "${dst}"
353352
WORKING_DIRECTORY
354353
"${CMAKE_CURRENT_BINARY_DIR}/${dir}"
355354
COMMENT "Generating ${dst} for target `${TARGET}'"

src/auxiliary/src/CudaBenchmarking/bench.cu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
extern "C" {
66

77
#include <stdarg.h>
8+
#include <sacinterface.h>
89
#include <string.h>
910
#include <time.h>
1011
#include <cuda.h>
@@ -80,7 +81,7 @@ void benchCreate( struct cudabench** interval)
8081
/* benchGetInterval actually creates the data structure */
8182
}
8283

83-
struct cudabench* benchGetInterval_si(char * name, sac_int num)
84+
struct cudabench* benchGetInterval_si(const char * name, sac_int num)
8485
{
8586
struct cudabench *interval;
8687
char* newName;
@@ -100,14 +101,14 @@ struct cudabench* benchGetInterval_i( sac_int num)
100101
return( interval);
101102
}
102103

103-
struct cudabench* benchGetInterval_s( char *name)
104+
struct cudabench* benchGetInterval_s(const char *name)
104105
{
105106
struct cudabench *interval;
106107
interval = benchGetInterval_si(name, -1);
107108
return( interval);
108109
}
109110

110-
struct cudabench* benchGetInterval_siu(char * name, sac_int num, sac_int timeunit)
111+
struct cudabench* benchGetInterval_siu(const char * name, sac_int num, sac_int timeunit)
111112
{
112113
struct cudabench *interval;
113114
char* newName;
@@ -127,7 +128,7 @@ struct cudabench* benchGetInterval_iu( sac_int num, sac_int timeunit)
127128
return( interval);
128129
}
129130

130-
struct cudabench* benchGetInterval_su( char *name, sac_int timeunit)
131+
struct cudabench* benchGetInterval_su(const char *name, sac_int timeunit)
131132
{
132133
struct cudabench *interval;
133134
interval = benchGetInterval_siu(name, -1, timeunit);

0 commit comments

Comments
 (0)