From 1ce054fcb3757e952423a09025c2f2a26023f8a5 Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Thu, 22 Oct 2015 11:07:35 -0500 Subject: [PATCH 1/2] Refs #669. Fixed the build bug with gcc on Mac OS X. --- driver/others/memory.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/driver/others/memory.c b/driver/others/memory.c index f75a47d65..fca516145 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -139,8 +139,13 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define BITMASK(a, b, c) ((((a) >> (b)) & (c))) +#if defined(OS_DARWIN) && defined(C_GCC) +#define CONSTRUCTOR __attribute__ ((constructor)) +#define DESTRUCTOR __attribute__ ((destructor)) +#else #define CONSTRUCTOR __attribute__ ((constructor(101))) #define DESTRUCTOR __attribute__ ((destructor(101))) +#endif #ifdef DYNAMIC_ARCH gotoblas_t *gotoblas = NULL; From 5a291606adaf425f34dc7223a7775b93518c08cf Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Sat, 24 Oct 2015 01:16:34 +0800 Subject: [PATCH 2/2] Refs #671. the return of i?max cannot larger than N. --- interface/imax.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/imax.c b/interface/imax.c index 55ffa7c6e..4378f1e22 100644 --- a/interface/imax.c +++ b/interface/imax.c @@ -136,6 +136,8 @@ blasint NAME(blasint *N, FLOAT *x, blasint *INCX){ ret = (blasint)MAX_K(n, x, incx); + if(ret > n) ret=n; + FUNCTION_PROFILE_END(COMPSIZE, n, 0); IDEBUG_END; @@ -159,6 +161,8 @@ CBLAS_INDEX CNAME(blasint n, FLOAT *x, blasint incx){ ret = MAX_K(n, x, incx); + if (ret > n) ret=n; + if (ret) ret --; FUNCTION_PROFILE_END(COMPSIZE, n, 0);