Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xwuupb committed Apr 14, 2020
1 parent 1b2b8c3 commit 8ada85b
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 86 deletions.
4 changes: 2 additions & 2 deletions 01_accelQuery/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions 01_accelQuery/src/prtAccelInfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>
Expand Down Expand Up @@ -94,7 +90,3 @@ void prtAccelInfo(int iaccel)
printf("warp size : %d\n", dev.warpSize);
printf("============================================================\n");
}

#ifdef __cplusplus
}
#endif
4 changes: 2 additions & 2 deletions 02_dataTransRate/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions 02_dataTransRate/src/check1ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -30,7 +26,3 @@ void check1ns(void)
}
assert(1l == res.tv_nsec);
}

#ifdef __cplusplus
}
#endif
4 changes: 2 additions & 2 deletions 03_taskwait/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions 04_scalarAddition/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions 04_scalarAddition/src/check1ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -30,7 +26,3 @@ void check1ns(void)
}
assert(1l == res.tv_nsec);
}

#ifdef __cplusplus
}
#endif
4 changes: 2 additions & 2 deletions 05_saxpy/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
8 changes: 0 additions & 8 deletions 05_saxpy/src/asaxpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Expand Down Expand Up @@ -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
8 changes: 0 additions & 8 deletions 05_saxpy/src/check1ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -30,7 +26,3 @@ void check1ns(void)
}
assert(1l == res.tv_nsec);
}

#ifdef __cplusplus
}
#endif
8 changes: 0 additions & 8 deletions 05_saxpy/src/hsaxpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <time.h>
#ifdef _OPENMP
#include <omp.h>
Expand Down Expand Up @@ -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
8 changes: 0 additions & 8 deletions 05_saxpy/src/wtcalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include "wtcalc.h"

double wtcalc;

#ifdef __cplusplus
}
#endif
4 changes: 2 additions & 2 deletions 08_distThreads/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions 08_distThreads/src/gpuThreads.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#ifdef _OPENMP
Expand Down Expand Up @@ -415,7 +411,3 @@ void gpuThreads(int i)
*/
free(league);
}

#ifdef __cplusplus
}
#endif
4 changes: 2 additions & 2 deletions 09_matAdd/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
8 changes: 0 additions & 8 deletions 09_matAdd/src/matAddAB.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
* @copyright CC BY-SA 2.0
*/

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Expand Down Expand Up @@ -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

0 comments on commit 8ada85b

Please sign in to comment.