From 61dcd381ddbdb2573144db87d25dcb1a88540241 Mon Sep 17 00:00:00 2001 From: TysonRayJones Date: Sun, 9 Jun 2024 10:39:15 +1000 Subject: [PATCH] defined mode preprocessors - ENABLE_DISTRIBUTION - ENABLE_MULTITHREADING - ENABLE_DISTRIBUTION These names reflect that the compile-time processors _enable_ the corresponding modes but do not enforce required use; deployment can still be chosen at runtime / Qureg instantiation --- quest/include/modes.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/quest/include/modes.h b/quest/include/modes.h index 948eb4ea..9c98e4aa 100644 --- a/quest/include/modes.h +++ b/quest/include/modes.h @@ -7,4 +7,36 @@ +// ensure all mode flags are defined + +#ifndef ENABLE_DISTRIBUTION + #error "Compiler must define ENABLE_DISTRIBUTION" +#endif + +#ifndef ENABLE_MULTITHREADING + #error "Compiler must define ENABLE_MULTITHREADING" +#endif + +#ifndef ENABLE_GPU_ACCELERATION + #error "Compiler must define ENABLE_GPU_ACCELERATION" +#endif + + + +// ensure all mode flags are valid values + +#if ! (ENABLE_DISTRIBUTION == 0 || ENABLE_DISTRIBUTION == 1) + #error "Macro ENABLE_DISTRIBUTION must have value 0 or 1" +#endif + +#if ! (ENABLE_MULTITHREADING == 0 || ENABLE_MULTITHREADING == 1) + #error "Macro ENABLE_MULTITHREADING must have value 0 or 1" +#endif + +#if ! (ENABLE_GPU_ACCELERATION == 0 || ENABLE_GPU_ACCELERATION == 1) + #error "Macro ENABLE_GPU_ACCELERATION must have value 0 or 1" +#endif + + + #endif // MODES_H \ No newline at end of file