Markers for init and copy to investigate deviations
This commit is contained in:
14
src/copy.c
14
src/copy.c
@@ -26,6 +26,9 @@
|
||||
*/
|
||||
|
||||
#include <timing.h>
|
||||
#ifdef LIKWID
|
||||
#include <likwid.h>
|
||||
#endif
|
||||
|
||||
double copy(
|
||||
double * restrict a,
|
||||
@@ -36,10 +39,19 @@ double copy(
|
||||
double S, E;
|
||||
|
||||
S = getTimeStamp();
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel
|
||||
{
|
||||
#ifdef LIKWID
|
||||
LIKWID_MARKER_START("COPY");
|
||||
#endif
|
||||
#pragma omp for
|
||||
for (int i=0; i<N; i++) {
|
||||
a[i] = b[i];
|
||||
}
|
||||
#ifdef LIKWID
|
||||
LIKWID_MARKER_STOP("COPY");
|
||||
#endif
|
||||
}
|
||||
E = getTimeStamp();
|
||||
|
||||
return E-S;
|
||||
|
||||
15
src/init.c
15
src/init.c
@@ -26,6 +26,9 @@
|
||||
*/
|
||||
|
||||
#include <timing.h>
|
||||
#ifdef LIKWID
|
||||
#include <likwid.h>
|
||||
#endif
|
||||
|
||||
double init(
|
||||
double * restrict a,
|
||||
@@ -36,10 +39,20 @@ double init(
|
||||
double S, E;
|
||||
|
||||
S = getTimeStamp();
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel
|
||||
{
|
||||
#ifdef LIKWID
|
||||
LIKWID_MARKER_START("INIT");
|
||||
#endif
|
||||
#pragma omp for
|
||||
#pragma vector nontemporal
|
||||
for (int i=0; i<N; i++) {
|
||||
a[i] = scalar;
|
||||
}
|
||||
#ifdef LIKWID
|
||||
LIKWID_MARKER_STOP("INIT");
|
||||
#endif
|
||||
}
|
||||
E = getTimeStamp();
|
||||
|
||||
return E-S;
|
||||
|
||||
13
src/main.c
13
src/main.c
@@ -39,6 +39,10 @@
|
||||
#include <allocate.h>
|
||||
#include <affinity.h>
|
||||
|
||||
#ifdef LIKWID
|
||||
#include <likwid.h>
|
||||
#endif
|
||||
|
||||
#define HLINE "----------------------------------------------------------------------------\n"
|
||||
|
||||
#ifndef MIN
|
||||
@@ -105,6 +109,11 @@ int main (int argc, char** argv)
|
||||
{"SDaxpy: ", 4, 2}
|
||||
};
|
||||
|
||||
#ifdef LIKWID
|
||||
LIKWID_MARKER_INIT;
|
||||
LIKWID_MARKER_REGISTER("INIT");
|
||||
#endif
|
||||
|
||||
a = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||
b = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||
c = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||
@@ -201,6 +210,10 @@ int main (int argc, char** argv)
|
||||
|
||||
check(a, b, c, d, N);
|
||||
|
||||
#ifdef LIKWID
|
||||
LIKWID_MARKER_CLOSE;
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user