ap_common.h: move decl of half to front, too

This commit is contained in:
Yuanjie Huang 2018-11-28 22:17:39 -08:00
parent 7e637dcd71
commit 81f1c748b0

View file

@ -22,6 +22,21 @@
// Forward declaration of all AP types.
#include <ap_decl.h>
// 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