diff --git a/01_accelQuery/configure.ac b/01_accelQuery/configure.ac index 1704676..04518ba 100644 --- a/01_accelQuery/configure.ac +++ b/01_accelQuery/configure.ac @@ -23,10 +23,10 @@ fi ##############################################################################80 AC_PROG_CC([clang gcc]) AS_IF([test "${CC}" = gcc], - [CFLAGS="-Wall -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" + [CFLAGS="-Wall -O2 -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) AS_IF([test "${CC}" = clang], - [CFLAGS="-Wall -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ + [CFLAGS="-Wall -O2 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ -Xopenmp-target -march=sm_61 $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) ##############################################################################80 diff --git a/01_accelQuery/src/prtAccelInfo.c b/01_accelQuery/src/prtAccelInfo.c index f11dce1..0807275 100644 --- a/01_accelQuery/src/prtAccelInfo.c +++ b/01_accelQuery/src/prtAccelInfo.c @@ -9,10 +9,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -94,7 +90,3 @@ void prtAccelInfo(int iaccel) printf("warp size : %d\n", dev.warpSize); printf("============================================================\n"); } - -#ifdef __cplusplus -} -#endif diff --git a/02_dataTransRate/configure.ac b/02_dataTransRate/configure.ac index 82b0baa..befe143 100644 --- a/02_dataTransRate/configure.ac +++ b/02_dataTransRate/configure.ac @@ -23,10 +23,10 @@ fi ##############################################################################80 AC_PROG_CC([clang gcc]) AS_IF([test "${CC}" = gcc], - [CFLAGS="-Wall -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" + [CFLAGS="-Wall -O2 -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) AS_IF([test "${CC}" = clang], - [CFLAGS="-Wall -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ + [CFLAGS="-Wall -O2 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ -Xopenmp-target -march=sm_61 $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) ##############################################################################80 diff --git a/02_dataTransRate/src/check1ns.c b/02_dataTransRate/src/check1ns.c index daf8eee..c01f906 100644 --- a/02_dataTransRate/src/check1ns.c +++ b/02_dataTransRate/src/check1ns.c @@ -10,10 +10,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -30,7 +26,3 @@ void check1ns(void) } assert(1l == res.tv_nsec); } - -#ifdef __cplusplus -} -#endif diff --git a/03_taskwait/configure.ac b/03_taskwait/configure.ac index 762b1a1..5657924 100644 --- a/03_taskwait/configure.ac +++ b/03_taskwait/configure.ac @@ -23,10 +23,10 @@ fi ##############################################################################80 AC_PROG_CC([clang gcc]) AS_IF([test "${CC}" = gcc], - [CFLAGS="-Wall -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" + [CFLAGS="-Wall -O2 -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) AS_IF([test "${CC}" = clang], - [CFLAGS="-Wall -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ + [CFLAGS="-Wall -O2 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ -Xopenmp-target -march=sm_61 $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) ##############################################################################80 diff --git a/04_scalarAddition/configure.ac b/04_scalarAddition/configure.ac index bbbcfa2..a1d3ec6 100644 --- a/04_scalarAddition/configure.ac +++ b/04_scalarAddition/configure.ac @@ -23,10 +23,10 @@ fi ##############################################################################80 AC_PROG_CC([clang gcc]) AS_IF([test "${CC}" = gcc], - [CFLAGS="-Wall -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" + [CFLAGS="-Wall -O2 -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) AS_IF([test "${CC}" = clang], - [CFLAGS="-Wall -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ + [CFLAGS="-Wall -O2 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ -Xopenmp-target -march=sm_61 $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) ##############################################################################80 diff --git a/04_scalarAddition/src/check1ns.c b/04_scalarAddition/src/check1ns.c index daf8eee..c01f906 100644 --- a/04_scalarAddition/src/check1ns.c +++ b/04_scalarAddition/src/check1ns.c @@ -10,10 +10,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -30,7 +26,3 @@ void check1ns(void) } assert(1l == res.tv_nsec); } - -#ifdef __cplusplus -} -#endif diff --git a/05_saxpy/configure.ac b/05_saxpy/configure.ac index 2075c61..d16246a 100644 --- a/05_saxpy/configure.ac +++ b/05_saxpy/configure.ac @@ -39,9 +39,9 @@ LDFLAGS+="-L${CUDALIB} -L${MKLLIB}" # AC_PROG_CC([clang gcc]) AS_IF([test "${CC}" = gcc], - [CFLAGS="-Wall -fopenmp -foffload=nvptx-none $CFLAGS"]) + [CFLAGS="-Wall -O2 -fopenmp -foffload=nvptx-none $CFLAGS"]) AS_IF([test "${CC}" = clang], - [CFLAGS="-Wall -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda \ + [CFLAGS="-Wall -O2 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda \ -Xopenmp-target -march=sm_61 $CFLAGS"]) ##############################################################################80 # diff --git a/05_saxpy/src/asaxpy.c b/05_saxpy/src/asaxpy.c index 0a05ccf..eeb21bb 100644 --- a/05_saxpy/src/asaxpy.c +++ b/05_saxpy/src/asaxpy.c @@ -17,10 +17,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -267,7 +263,3 @@ for (int i = 0; i < m; ++i) { wtcalc += (rt[1].tv_sec - rt[0].tv_sec) + 1.0e-9 * (rt[1].tv_nsec - rt[0].tv_nsec); } } - -#ifdef __cplusplus -} -#endif diff --git a/05_saxpy/src/check1ns.c b/05_saxpy/src/check1ns.c index daf8eee..c01f906 100644 --- a/05_saxpy/src/check1ns.c +++ b/05_saxpy/src/check1ns.c @@ -10,10 +10,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -30,7 +26,3 @@ void check1ns(void) } assert(1l == res.tv_nsec); } - -#ifdef __cplusplus -} -#endif diff --git a/05_saxpy/src/hsaxpy.c b/05_saxpy/src/hsaxpy.c index 22bab18..5603ae9 100644 --- a/05_saxpy/src/hsaxpy.c +++ b/05_saxpy/src/hsaxpy.c @@ -17,10 +17,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #ifdef _OPENMP #include @@ -63,7 +59,3 @@ clock_gettime(CLOCK_REALTIME, rt + 1); wtcalc += (rt[1].tv_sec - rt[0].tv_sec) + 1.0e-9 * (rt[1].tv_nsec - rt[0].tv_nsec); } } - -#ifdef __cplusplus -} -#endif diff --git a/05_saxpy/src/wtcalc.c b/05_saxpy/src/wtcalc.c index bb00340..52385de 100644 --- a/05_saxpy/src/wtcalc.c +++ b/05_saxpy/src/wtcalc.c @@ -8,14 +8,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include "wtcalc.h" double wtcalc; - -#ifdef __cplusplus -} -#endif diff --git a/08_distThreads/configure.ac b/08_distThreads/configure.ac index 9737e23..fce9ef6 100644 --- a/08_distThreads/configure.ac +++ b/08_distThreads/configure.ac @@ -23,10 +23,10 @@ fi ##############################################################################80 AC_PROG_CC([clang gcc]) AS_IF([test "${CC}" = gcc], - [CFLAGS="-Wall -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" + [CFLAGS="-Wall -O2 -fopenmp -foffload=nvptx-none -I${CUDAINC} $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) AS_IF([test "${CC}" = clang], - [CFLAGS="-Wall -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ + [CFLAGS="-Wall -O2 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -I${CUDAINC} \ -Xopenmp-target -march=sm_61 $CFLAGS" LDFLAGS="-L${CUDALIB} $LDFLAGS"]) ##############################################################################80 diff --git a/08_distThreads/src/gpuThreads.c b/08_distThreads/src/gpuThreads.c index 2b462a8..3e1971b 100644 --- a/08_distThreads/src/gpuThreads.c +++ b/08_distThreads/src/gpuThreads.c @@ -9,10 +9,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #ifdef _OPENMP @@ -415,7 +411,3 @@ void gpuThreads(int i) */ free(league); } - -#ifdef __cplusplus -} -#endif diff --git a/09_matAdd/configure.ac b/09_matAdd/configure.ac index 4e5dad3..bcca20e 100644 --- a/09_matAdd/configure.ac +++ b/09_matAdd/configure.ac @@ -39,9 +39,9 @@ LDFLAGS+="-L${CUDALIB} -L${MKLLIB}" # AC_PROG_CC([clang gcc]) AS_IF([test "${CC}" = gcc], - [CFLAGS="-Wall -fopenmp -foffload=nvptx-none $CFLAGS"]) + [CFLAGS="-Wall -O2 -fopenmp -foffload=nvptx-none $CFLAGS"]) AS_IF([test "${CC}" = clang], - [CFLAGS="-Wall -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda \ + [CFLAGS="-Wall -O2 -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda \ -Xopenmp-target -march=sm_61 $CFLAGS"]) ##############################################################################80 # diff --git a/09_matAdd/src/matAddAB.c b/09_matAdd/src/matAddAB.c index 08eb26d..d580f7c 100644 --- a/09_matAdd/src/matAddAB.c +++ b/09_matAdd/src/matAddAB.c @@ -11,10 +11,6 @@ * @copyright CC BY-SA 2.0 */ -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -299,7 +295,3 @@ for (int i = iblk * NTHRDS8; wtcalc += (rt[1].tv_sec - rt[0].tv_sec) + 1.0e-9 * (rt[1].tv_nsec - rt[0].tv_nsec); } } - -#ifdef __cplusplus -} -#endif