From f0c3ef359f7c6c1687fb2671cb35deb346e00597 Mon Sep 17 00:00:00 2001 From: Kiran V Date: Thu, 4 Oct 2018 16:32:21 +0530 Subject: [PATCH] This is a fix to floating-point exception error for BLIS SGEMM with larger matrix sizes. BUG No: CPUPL-197 fixed by Thangaraj Santanu The bli_clock_min_diff() function in BLIS assumed that if the time taken is greater than 1 hour then the reading must be wrong. However this is not the case in general, while the other checks such as time taken closer to zero or nsec is ofcourse valid. gerrit review: http://git.amd.com:8080/#/c/118694/1/frame/base/bli_clock.c Change-Id: I9dc313d7c5fdc20684f67a516bf3237de3e0694a --- frame/base/bli_clock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frame/base/bli_clock.c b/frame/base/bli_clock.c index 6f92d907b..216367975 100644 --- a/frame/base/bli_clock.c +++ b/frame/base/bli_clock.c @@ -5,6 +5,7 @@ libraries. Copyright (C) 2014, The University of Texas at Austin + Copyright (c) 2018, Advanced Micro Devices, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -59,7 +60,9 @@ double bli_clock_min_diff( double time_min, double time_start ) // - under a nanosecond // is actually garbled due to the clocks being taken too closely together. if ( time_min <= 0.0 ) time_min = time_min_prev; - else if ( time_min > 3600.0 ) time_min = time_min_prev; + // To genuinely measure time for an application taking more than an hour, the below + // line is commented. If wrongly measuring higher time we could always use previous_min. + /* else if ( time_min > 3600.0 ) time_min = time_min_prev; */ else if ( time_min < 1.0e-9 ) time_min = time_min_prev; return time_min;