Commit 9a0706e5 authored by Alexandru Dura's avatar Alexandru Dura

Add common header file

parent 3800bfb0
#ifndef _COMMON_H
#define _COMMON_H
#include <time.h>
#ifdef _OPENMP
#include <omp.h>
#endif
#ifdef _OPENMP
#define TIME_REGION(T, X) \
do { \
double __start_time, __end_time; \
__start_time = omp_get_wtime(); \
X; \
__end_time = omp_get_wtime(); \
T = __end_time - __start_time; \
} while(0);
#else
#define TIME_REGION(T, X) \
do { \
time_t __start_time, __end_time; \
time(&__start_time); \
X; \
time(&__end_time); \
T = difftime(__end_time, __start_time); \
} while(0);
#endif
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) < (y) ? (y) : (x))
#endif
Markdown is supported
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