From 01429d6a31abfc89d6737c8d4dbc6ecb0f1030c3 Mon Sep 17 00:00:00 2001 From: fehrmann <henning.fehrmann@aei.mpg.de> Date: Fri, 29 Jan 2021 10:06:10 +0100 Subject: [PATCH] outsource parts which are also needed for FFTWs --- blas.c | 69 +--------------------------------------------------------- 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/blas.c b/blas.c index 6dfd65e..6f2f5fe 100644 --- a/blas.c +++ b/blas.c @@ -16,11 +16,11 @@ */ #include "hardware_settings.h" +#include "profiler.h" #include <stdio.h> #include <stdlib.h> #include <math.h> -#include <time.h> #include <omp.h> #define __MALLOC(P, size) P = malloc(size); \ @@ -34,73 +34,6 @@ size_t m = 10000; size_t n = 10000; size_t k = 10000; -static unsigned long x=123456789, y=362436069, z=521288629; - -unsigned long -xorshf96 -( - void -) -{ - // NOT thread save - unsigned long t; - x ^= x << 16; - x ^= x >> 5; - x ^= x << 1; - - t = x; - x = y; - y = z; - z = t ^ x ^ y; - return z; -} - -struct runtime -{ - struct timespec start; - struct timespec stop; - char tag[128]; -}; - - -void -timer_start -( - struct runtime * timer, - char tag[128] -) -{ - struct timespec start; - sprintf(timer->tag,"%s", tag); - clock_gettime(CLOCK_REALTIME , &start); - timer->start = start; -// printf("--------> start timer: %s\n", timer->tag); -} - -double -timer_stop -( - struct runtime * timer -) -{ - struct timespec stop; - clock_gettime(CLOCK_REALTIME , &stop); - timer->stop = stop; - double res= (double) - ( - (timer->stop).tv_sec - (timer->start).tv_sec - )*1000. - + - (double) - ( - (timer->stop).tv_nsec - (timer->start).tv_nsec - )/1000000. - ; - // printf("--------> stop timer %s: %g ms\n", timer->tag, res ); - return res; -} - - void multiplication ( -- GitLab