Commit 7bf6790a authored by Jan Eitzinger's avatar Jan Eitzinger
Browse files

Change clang openmp flags. Formatting.

parent 89b2ecdb
...@@ -3,11 +3,11 @@ GCC = gcc ...@@ -3,11 +3,11 @@ GCC = gcc
LINKER = $(CC) LINKER = $(CC)
ifeq ($(ENABLE_OPENMP),true) ifeq ($(ENABLE_OPENMP),true)
OPENMP = -fopenmp OPENMP = -Xpreprocessor -fopenmp
LIBS = -lomp
endif endif
CFLAGS = -Ofast -ffreestanding -std=c99 $(OPENMP) CFLAGS = -Ofast -ffreestanding -std=c99 $(OPENMP)
LFLAGS = $(OPENMP) LFLAGS = $(OPENMP)
DEFINES = -D_GNU_SOURCE DEFINES = -D_GNU_SOURCE
INCLUDES = INCLUDES =
LIBS =
...@@ -38,9 +38,9 @@ double daxpy( ...@@ -38,9 +38,9 @@ double daxpy(
S = getTimeStamp(); S = getTimeStamp();
#pragma omp parallel for schedule(static) #pragma omp parallel for schedule(static)
for (int i=0; i<N; i++) { for (int i=0; i<N; i++) {
a[i] = a[i] + scalar * b[i]; a[i] = a[i] + scalar * b[i];
} }
E = getTimeStamp(); E = getTimeStamp();
return E-S; return E-S;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ======================================================================================= * =======================================================================================
* *
* Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Author: Jan Eitzinger (je), jan.eitzinger@fau.de
* Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * Copyright (c) 2020 RRZE, University Erlangen-Nuremberg
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
#define LIKWID_PROFILE(tag,call) \ #define LIKWID_PROFILE(tag,call) \
_Pragma ("omp parallel") \ _Pragma ("omp parallel") \
{LIKWID_MARKER_START(#tag);} \ {LIKWID_MARKER_START(#tag);} \
times[tag][k] = call; \ times[tag][k] = call; \
_Pragma ("omp parallel") \ _Pragma ("omp parallel") \
{LIKWID_MARKER_STOP(#tag);} {LIKWID_MARKER_STOP(#tag);}
typedef enum benchmark { typedef enum benchmark {
...@@ -115,7 +115,7 @@ int main (int argc, char** argv) ...@@ -115,7 +115,7 @@ int main (int argc, char** argv)
}; };
LIKWID_MARKER_INIT; LIKWID_MARKER_INIT;
_Pragma("omp parallel") _Pragma("omp parallel")
{ {
LIKWID_MARKER_REGISTER("INIT"); LIKWID_MARKER_REGISTER("INIT");
LIKWID_MARKER_REGISTER("SUM"); LIKWID_MARKER_REGISTER("SUM");
...@@ -146,7 +146,7 @@ _Pragma("omp parallel") ...@@ -146,7 +146,7 @@ _Pragma("omp parallel")
#ifdef _OPENMP #ifdef _OPENMP
printf(HLINE); printf(HLINE);
_Pragma("omp parallel") _Pragma("omp parallel")
{ {
int k = omp_get_num_threads(); int k = omp_get_num_threads();
int i = omp_get_thread_num(); int i = omp_get_thread_num();
...@@ -180,10 +180,8 @@ _Pragma("omp parallel") ...@@ -180,10 +180,8 @@ _Pragma("omp parallel")
LIKWID_PROFILE(INIT,init(b, scalar, N)); LIKWID_PROFILE(INIT,init(b, scalar, N));
tmp = a[10]; tmp = a[10];
LIKWID_PROFILE(SUM,sum(a, N)); LIKWID_PROFILE(SUM,sum(a, N));
a[10] = tmp; a[10] = tmp;
LIKWID_PROFILE(COPY,copy(c, a, N)); LIKWID_PROFILE(COPY,copy(c, a, N));
LIKWID_PROFILE(UPDATE,update(a, scalar, N)); LIKWID_PROFILE(UPDATE,update(a, scalar, N));
LIKWID_PROFILE(TRIAD,triad(a, b, c, scalar, N)); LIKWID_PROFILE(TRIAD,triad(a, b, c, scalar, N));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment