Browse Source

Refs #929. Deal with zero and NaNs for scale.

tags/v0.2.19^2
Zhang Xianyi 9 years ago
parent
commit
ae70b916f4
2 changed files with 18 additions and 1 deletions
  1. +1
    -1
      kernel/power/KERNEL.POWER8
  2. +17
    -0
      kernel/power/zscal.c

+ 1
- 1
kernel/power/KERNEL.POWER8 View 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


+ 17
- 0
kernel/power/zscal.c View 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 )
{



Loading…
Cancel
Save