diff --git a/include/ap_common.h b/include/ap_common.h index 7080c14..94c3a01 100644 --- a/include/ap_common.h +++ b/include/ap_common.h @@ -22,6 +22,21 @@ // Forward declaration of all AP types. #include +// TODO Undefine in open-source release. +#define _AP_ENABLE_HALF_ 1 + +#ifdef _AP_ENABLE_HALF_ +// Before ap_private definition. +#ifdef __SYNTHESIS__ +#define _HLS_HALF_DEFINED_ +typedef __fp16 half; +#else +class half; +#endif // __SYNTHESIS__ +#endif // _AP_ENABLE_HALF_ + +// ---------------------------------------------------------------------- + // Macro functions #define AP_MAX(a, b) ((a) > (b) ? (a) : (b)) #define AP_MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -560,18 +575,6 @@ static inline unsigned char guess_radix(const char* s) { // ---------------------------------------------------------------------- -#ifdef _AP_ENABLE_HALF_ -// Before ap_private definition. -#ifdef __SYNTHESIS__ -#define _HLS_HALF_DEFINED_ -typedef __fp16 half; -#else -class half; -#endif -#endif - -// ---------------------------------------------------------------------- - // Basic integral struct upon which ap_int and ap_fixed are defined. #ifdef __SYNTHESIS__ // Use ssdm_int, a compiler dependent, attribute constrained integeral type as