Refs #929. Deal with zero and NaNs for scale.
authorZhang Xianyi <traits.zhang@gmail.com>
Thu, 18 Aug 2016 17:24:42 +0000 (10:24 -0700)
committerZhang Xianyi <traits.zhang@gmail.com>
Thu, 18 Aug 2016 17:24:42 +0000 (10:24 -0700)
kernel/power/KERNEL.POWER8
kernel/power/zscal.c

index 323b67d..dacff7a 100644 (file)
@@ -137,7 +137,7 @@ DROTKERNEL   = drot.c
 #
 SSCALKERNEL  = sscal.c
 DSCALKERNEL  = dscal.c
-#CSCALKERNEL  = ../arm/zscal.c
+CSCALKERNEL  = zscal.c
 ZSCALKERNEL  = zscal.c
 #
 SSWAPKERNEL  = sswap.c
index 213839a..410fc98 100644 (file)
@@ -39,8 +39,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #pragma GCC optimize "O1"
 
 #if defined(POWER8)
+#if defined(DOUBLE)
 #include "zscal_microk_power8.c"
 #endif
+#endif
 
 
 #ifndef HAVE_KERNEL_8
@@ -123,6 +125,21 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, F
        if ( inc_x <= 0 )
                return(0);
 
+       if (da_r == ZERO && da_i == ZERO) {
+         //clear the vector and return
+         if (inc_x == 1) {
+           memset(x, 0, n*COMPSIZE*SIZE);
+         }else{
+           inc_x2 = 2 * inc_x;
+           for(i=0; i<n; i++){
+             x[ip]=ZERO; 
+             x[ip+1]=ZERO;
+             ip += inc_x2;
+           }
+         }
+         return 0;
+       }
+
        if ( inc_x == 1 )
        {