From 9ba9c47a952ce6966b333af579bd39c636080fbc Mon Sep 17 00:00:00 2001 From: JP Appel Date: Tue, 23 Apr 2024 15:58:54 -0400 Subject: added preprocessor to change precision at compile time --- src/precision.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/precision.h (limited to 'src/precision.h') diff --git a/src/precision.h b/src/precision.h new file mode 100644 index 0000000..e83122a --- /dev/null +++ b/src/precision.h @@ -0,0 +1,29 @@ +/* + * Header that allows conditional compilation into double floating point precisions ot extended double floating point precision + * + * CUDA does not support long double so cuda-fractals may fail to compile or have unexpected behavior if linked with code that was compiled with EXTENDED_PRECISION + */ +#pragma once + +#ifdef EXTENDED_PRECISION + +#define CBASE long double +#define CREAL creall +#define CIMAG cimagl +#define CPOW cpowl +#define CONJ conjl +#define CABS cabsl +#define CFORMAT "%Lf" + +#endif +#ifndef EXTENDED_PRECISION + +#define CBASE double +#define CREAL creal +#define CIMAG cimag +#define CPOW cpow +#define CONJ conj +#define CABS cabs +#define CFORMAT "%lf" + +#endif -- cgit v1.2.3