@@ -0,0 +1,46 @@ | |||
ifndef SNRM2KERNEL | |||
SNRM2KERNEL = nrm2.c | |||
endif | |||
ifndef DNRM2KERNEL | |||
DNRM2KERNEL = nrm2.c | |||
endif | |||
ifndef CNRM2KERNEL | |||
CNRM2KERNEL = znrm2.c | |||
endif | |||
ifndef ZNRM2KERNEL | |||
ZNRM2KERNEL = znrm2.c | |||
endif | |||
ifndef SCABS_KERNEL | |||
SCABS_KERNEL = ../generic/cabs.c | |||
endif | |||
ifndef DCABS_KERNEL | |||
DCABS_KERNEL = ../generic/cabs.c | |||
endif | |||
ifndef QCABS_KERNEL | |||
QCABS_KERNEL = ../generic/cabs.c | |||
endif | |||
ifndef LSAME_KERNEL | |||
LSAME_KERNEL = ../generic/lsame.c | |||
endif | |||
ifndef SGEMM_BETA | |||
SGEMM_BETA = ../generic/gemm_beta.c | |||
endif | |||
ifndef DGEMM_BETA | |||
DGEMM_BETA = ../generic/gemm_beta.c | |||
endif | |||
ifndef CGEMM_BETA | |||
CGEMM_BETA = ../generic/zgemm_beta.c | |||
endif | |||
ifndef ZGEMM_BETA | |||
ZGEMM_BETA = ../generic/zgemm_beta.c | |||
endif | |||
@@ -0,0 +1,143 @@ | |||
SAMAXKERNEL = ../arm/amax.c | |||
DAMAXKERNEL = ../arm/amax.c | |||
CAMAXKERNEL = ../arm/zamax.c | |||
ZAMAXKERNEL = ../arm/zamax.c | |||
SAMINKERNEL = ../arm/amin.c | |||
DAMINKERNEL = ../arm/amin.c | |||
CAMINKERNEL = ../arm/zamin.c | |||
ZAMINKERNEL = ../arm/zamin.c | |||
SMAXKERNEL = ../arm/max.c | |||
DMAXKERNEL = ../arm/max.c | |||
SMINKERNEL = ../arm/min.c | |||
DMINKERNEL = ../arm/min.c | |||
ISAMAXKERNEL = ../arm/iamax.c | |||
IDAMAXKERNEL = ../arm/iamax.c | |||
ICAMAXKERNEL = ../arm/izamax.c | |||
IZAMAXKERNEL = ../arm/izamax.c | |||
ISAMINKERNEL = ../arm/iamin.c | |||
IDAMINKERNEL = ../arm/iamin.c | |||
ICAMINKERNEL = ../arm/izamin.c | |||
IZAMINKERNEL = ../arm/izamin.c | |||
ISMAXKERNEL = ../arm/imax.c | |||
IDMAXKERNEL = ../arm/imax.c | |||
ISMINKERNEL = ../arm/imin.c | |||
IDMINKERNEL = ../arm/imin.c | |||
SSWAPKERNEL = ../arm/swap.c | |||
DSWAPKERNEL = ../arm/swap.c | |||
CSWAPKERNEL = ../arm/zswap.c | |||
ZSWAPKERNEL = ../arm/zswap.c | |||
SASUMKERNEL = ../arm/asum.c | |||
DASUMKERNEL = ../arm/asum.c | |||
CASUMKERNEL = ../arm/zasum.c | |||
ZASUMKERNEL = ../arm/zasum.c | |||
SAXPYKERNEL = ../arm/axpy.c | |||
DAXPYKERNEL = ../arm/axpy.c | |||
CAXPYKERNEL = ../arm/zaxpy.c | |||
ZAXPYKERNEL = ../arm/zaxpy.c | |||
SCOPYKERNEL = ../arm/copy.c | |||
DCOPYKERNEL = ../arm/copy.c | |||
CCOPYKERNEL = ../arm/zcopy.c | |||
ZCOPYKERNEL = ../arm/zcopy.c | |||
SDOTKERNEL = ../arm/dot.c | |||
DDOTKERNEL = ../arm/dot.c | |||
CDOTKERNEL = ../arm/zdot.c | |||
ZDOTKERNEL = ../arm/zdot.c | |||
SNRM2KERNEL = ../arm/nrm2.c | |||
DNRM2KERNEL = ../arm/nrm2.c | |||
CNRM2KERNEL = ../arm/znrm2.c | |||
ZNRM2KERNEL = ../arm/znrm2.c | |||
SROTKERNEL = ../arm/rot.c | |||
DROTKERNEL = ../arm/rot.c | |||
CROTKERNEL = ../arm/zrot.c | |||
ZROTKERNEL = ../arm/zrot.c | |||
SSCALKERNEL = ../arm/scal.c | |||
DSCALKERNEL = ../arm/scal.c | |||
CSCALKERNEL = ../arm/zscal.c | |||
ZSCALKERNEL = ../arm/zscal.c | |||
SGEMVNKERNEL = gemv_n.c | |||
DGEMVNKERNEL = gemv_n.c | |||
CGEMVNKERNEL = zgemv_n.c | |||
ZGEMVNKERNEL = zgemv_n.c | |||
SGEMVTKERNEL = gemv_t.c | |||
DGEMVTKERNEL = gemv_t.c | |||
CGEMVTKERNEL = zgemv_t.c | |||
ZGEMVTKERNEL = zgemv_t.c | |||
STRMMKERNEL = ../generic/trmmkernel_2x2.c | |||
DTRMMKERNEL = dtrmm_kernel_8x2_vfpv3.S | |||
CTRMMKERNEL = ../generic/ztrmmkernel_2x2.c | |||
ZTRMMKERNEL = ../generic/ztrmmkernel_2x2.c | |||
SGEMMKERNEL = ../generic/gemmkernel_2x2.c | |||
SGEMMONCOPY = ../generic/gemm_ncopy_2.c | |||
SGEMMOTCOPY = ../generic/gemm_tcopy_2.c | |||
SGEMMONCOPYOBJ = sgemm_oncopy.o | |||
SGEMMOTCOPYOBJ = sgemm_otcopy.o | |||
#DGEMMKERNEL = ../generic/gemmkernel_2x2.c | |||
#DGEMMKERNEL = dgemm_kernel_4x2_vfpv2.S | |||
DGEMMKERNEL = dgemm_kernel_8x2_vfpv3.S | |||
DGEMMINCOPY = ../generic/gemm_ncopy_8.c | |||
DGEMMITCOPY = ../generic/gemm_tcopy_8.c | |||
DGEMMONCOPY = ../generic/gemm_ncopy_2.c | |||
DGEMMOTCOPY = ../generic/gemm_tcopy_2.c | |||
DGEMMINCOPYOBJ = dgemm_incopy.o | |||
DGEMMITCOPYOBJ = dgemm_itcopy.o | |||
DGEMMONCOPYOBJ = dgemm_oncopy.o | |||
DGEMMOTCOPYOBJ = dgemm_otcopy.o | |||
CGEMMKERNEL = ../generic/zgemmkernel_2x2.c | |||
CGEMMONCOPY = ../generic/zgemm_ncopy_2.c | |||
CGEMMOTCOPY = ../generic/zgemm_tcopy_2.c | |||
CGEMMONCOPYOBJ = cgemm_oncopy.o | |||
CGEMMOTCOPYOBJ = cgemm_otcopy.o | |||
ZGEMMKERNEL = ../generic/zgemmkernel_2x2.c | |||
ZGEMMONCOPY = ../generic/zgemm_ncopy_2.c | |||
ZGEMMOTCOPY = ../generic/zgemm_tcopy_2.c | |||
ZGEMMONCOPYOBJ = zgemm_oncopy.o | |||
ZGEMMOTCOPYOBJ = zgemm_otcopy.o | |||
STRSMKERNEL_LN = ../generic/trsm_kernel_LN.c | |||
STRSMKERNEL_LT = ../generic/trsm_kernel_LT.c | |||
STRSMKERNEL_RN = ../generic/trsm_kernel_RN.c | |||
STRSMKERNEL_RT = ../generic/trsm_kernel_RT.c | |||
DTRSMKERNEL_LN = ../generic/trsm_kernel_LN.c | |||
DTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c | |||
DTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c | |||
DTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c | |||
CTRSMKERNEL_LN = ../generic/trsm_kernel_LN.c | |||
CTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c | |||
CTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c | |||
CTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c | |||
ZTRSMKERNEL_LN = ../generic/trsm_kernel_LN.c | |||
ZTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c | |||
ZTRSMKERNEL_RN = ../generic/trsm_kernel_RN.c | |||
ZTRSMKERNEL_RT = ../generic/trsm_kernel_RT.c | |||
CGEMM3MKERNEL = zgemm3m_kernel_8x4_core2.S | |||
ZGEMM3MKERNEL = zgemm3m_kernel_4x4_core2.S | |||
@@ -0,0 +1,73 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT maxf=0.0; | |||
if (n < 0 || inc_x < 1 ) return(maxf); | |||
maxf=ABS(x[0]); | |||
while(i < n) | |||
{ | |||
if( ABS(x[ix]) > ABS(maxf) ) | |||
{ | |||
maxf = ABS(x[ix]); | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(maxf); | |||
} | |||
@@ -0,0 +1,73 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT minf=0.0; | |||
if (n < 0 || inc_x < 1 ) return(minf); | |||
minf=ABS(x[0]); | |||
while(i < n) | |||
{ | |||
if( ABS(x[ix]) < ABS(minf) ) | |||
{ | |||
minf = ABS(x[ix]); | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(minf); | |||
} | |||
@@ -0,0 +1,67 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
FLOAT sumf = 0.0; | |||
if (n < 0 || inc_x < 1 ) return(sumf); | |||
n *= inc_x; | |||
while(i < n) | |||
{ | |||
sumf += ABS(x[i]); | |||
i += inc_x; | |||
} | |||
return(sumf); | |||
} | |||
@@ -0,0 +1,64 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix,iy; | |||
if ( n < 0 ) return(0); | |||
if ( da == 0.0 ) return(0); | |||
ix = 0; | |||
iy = 0; | |||
while(i < n) | |||
{ | |||
y[iy] += da * x[ix] ; | |||
ix += inc_x ; | |||
iy += inc_y ; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,59 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
if ( n < 0 ) return(0); | |||
while(i < n) | |||
{ | |||
y[iy] = x[ix] ; | |||
ix += inc_x ; | |||
iy += inc_y ; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,64 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#if defined(DSDOT) | |||
double CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) | |||
#else | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) | |||
#endif | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
double dot = 0.0 ; | |||
if ( n < 0 ) return(dot); | |||
while(i < n) | |||
{ | |||
dot += y[iy] * x[ix] ; | |||
ix += inc_x ; | |||
iy += inc_y ; | |||
i++ ; | |||
} | |||
return(dot); | |||
} | |||
@@ -0,0 +1,67 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* * 2013/09/14 Saar | |||
* * BLASTEST float : OK | |||
* * BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* * | |||
* **************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer) | |||
{ | |||
BLASLONG i; | |||
BLASLONG ix,iy; | |||
BLASLONG j; | |||
FLOAT *a_ptr; | |||
FLOAT temp; | |||
ix = 0; | |||
a_ptr = a; | |||
for (j=0; j<n; j++) | |||
{ | |||
temp = alpha * x[ix]; | |||
iy = 0; | |||
for (i=0; i<m; i++) | |||
{ | |||
y[iy] += temp * a_ptr[i]; | |||
iy += inc_y; | |||
} | |||
a_ptr += lda; | |||
ix += inc_x; | |||
} | |||
} | |||
@@ -0,0 +1,67 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* * 2013/09/14 Saar | |||
* * BLASTEST float : OK | |||
* * BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* * | |||
* **************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer) | |||
{ | |||
BLASLONG i; | |||
BLASLONG ix,iy; | |||
BLASLONG j; | |||
FLOAT *a_ptr; | |||
FLOAT temp; | |||
iy = 0; | |||
a_ptr = a; | |||
for (j=0; j<n; j++) | |||
{ | |||
temp = 0.0; | |||
ix = 0; | |||
for (i=0; i<m; i++) | |||
{ | |||
temp += a_ptr[i] * x[ix]; | |||
ix += inc_x; | |||
} | |||
y[iy] += alpha * temp; | |||
iy += inc_y; | |||
a_ptr += lda; | |||
} | |||
} | |||
@@ -0,0 +1,75 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : NoTest | |||
* BLASTEST double : NoTest | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT maxf=0.0; | |||
BLASLONG max=0; | |||
if (n < 0 || inc_x < 1 ) return(max); | |||
maxf=ABS(x[0]); | |||
while(i < n) | |||
{ | |||
if( ABS(x[ix]) > ABS(maxf) ) | |||
{ | |||
max = i; | |||
maxf = ABS(x[ix]); | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(max+1); | |||
} | |||
@@ -0,0 +1,75 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : NoTest | |||
* BLASTEST double : NoTest | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT minf=0.0; | |||
BLASLONG min=0; | |||
if (n < 0 || inc_x < 1 ) return(min); | |||
minf=ABS(x[0]); | |||
while(i < n) | |||
{ | |||
if( ABS(x[ix]) < ABS(minf) ) | |||
{ | |||
min = i; | |||
minf = ABS(x[ix]); | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(min+1); | |||
} | |||
@@ -0,0 +1,67 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : NoTest | |||
* BLASTEST double : NoTest | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT maxf=0.0; | |||
BLASLONG max=0; | |||
if (n < 0 || inc_x < 1 ) return(max); | |||
maxf=x[0]; | |||
while(i < n) | |||
{ | |||
if( x[ix] > maxf ) | |||
{ | |||
max = i; | |||
maxf = x[ix]; | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(max+1); | |||
} | |||
@@ -0,0 +1,65 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/08/19 Saar | |||
* BLASTEST float | |||
* BLASTEST double | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT minf=0.0; | |||
BLASLONG min=0; | |||
if (n < 0 || inc_x < 1 ) return(min); | |||
minf=x[0]; | |||
while(i < n) | |||
{ | |||
if( x[ix] > minf ) | |||
{ | |||
min = i; | |||
minf = x[ix]; | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(min+1); | |||
} | |||
@@ -0,0 +1,81 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : NoTest | |||
* BLASTEST double : NoTest | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1]) | |||
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT maxf[2]; | |||
BLASLONG max=0; | |||
BLASLONG inc_x2; | |||
if (n < 0 || inc_x < 1 ) return(max); | |||
inc_x2 = 2 * inc_x; | |||
maxf[0] = ABS(x[ix]); | |||
maxf[1] = ABS(x[ix+1]); | |||
while(i < n) | |||
{ | |||
if( CABS1(x,ix) > CABS1(maxf,0) ) | |||
{ | |||
max = i; | |||
maxf[0] = ABS(x[ix]); | |||
maxf[1] = ABS(x[ix+1]); | |||
} | |||
ix += inc_x2; | |||
i++; | |||
} | |||
return(max+1); | |||
} | |||
@@ -0,0 +1,81 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : NoTest | |||
* BLASTEST double : NoTest | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1]) | |||
BLASLONG CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT minf[2]; | |||
BLASLONG min=0; | |||
BLASLONG inc_x2; | |||
if (n < 0 || inc_x < 1 ) return(min); | |||
inc_x2 = 2 * inc_x; | |||
minf[0] = ABS(x[ix]); | |||
minf[1] = ABS(x[ix+1]); | |||
while(i < n) | |||
{ | |||
if( CABS1(x,ix) < CABS1(minf,0) ) | |||
{ | |||
min = i; | |||
minf[0] = ABS(x[ix]); | |||
minf[1] = ABS(x[ix+1]); | |||
} | |||
ix += inc_x2; | |||
i++; | |||
} | |||
return(min+1); | |||
} | |||
@@ -0,0 +1,63 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : NoTest | |||
* BLASTEST double : NoTest | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT maxf=0.0; | |||
if (n < 0 || inc_x < 1 ) return(maxf); | |||
maxf=x[0]; | |||
while(i < n) | |||
{ | |||
if( x[ix] > maxf ) | |||
{ | |||
maxf = x[ix]; | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(maxf); | |||
} | |||
@@ -0,0 +1,63 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : NoTest | |||
* BLASTEST double : NoTest | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT minf=0.0; | |||
if (n < 0 || inc_x < 1 ) return(minf); | |||
minf=x[0]; | |||
while(i < n) | |||
{ | |||
if( x[ix] < minf ) | |||
{ | |||
minf = x[ix]; | |||
} | |||
ix += inc_x; | |||
i++; | |||
} | |||
return(minf); | |||
} | |||
@@ -0,0 +1,88 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/13 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
FLOAT scale = 0.0; | |||
FLOAT ssq = 1.0; | |||
FLOAT absxi = 0.0; | |||
if (n < 0 || inc_x < 1 ) return(0.0); | |||
if ( n == 1 ) return( ABS(x[0]) ); | |||
n *= inc_x; | |||
while(i < n) | |||
{ | |||
if ( x[i] != 0.0 ) | |||
{ | |||
absxi = ABS( x[i] ); | |||
if ( scale < absxi ) | |||
{ | |||
ssq = 1 + ssq * ( scale / absxi ) * ( scale / absxi ); | |||
scale = absxi ; | |||
} | |||
else | |||
{ | |||
ssq += ( absxi/scale ) * ( absxi/scale ); | |||
} | |||
} | |||
i += inc_x; | |||
} | |||
scale = scale * sqrt( ssq ); | |||
return(scale); | |||
} | |||
@@ -0,0 +1,62 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT c, FLOAT s) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
FLOAT temp; | |||
if ( n <= 0 ) return(0); | |||
while(i < n) | |||
{ | |||
temp = c*x[ix] + s*y[iy] ; | |||
y[iy] = c*y[iy] - s*x[ix] ; | |||
x[ix] = temp ; | |||
ix += inc_x ; | |||
iy += inc_y ; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,58 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) | |||
{ | |||
BLASLONG i=0; | |||
if ( n < 0 || inc_x < 1 ) return(0); | |||
if ( da == 1.0 ) return(0); | |||
n *= inc_x; | |||
while(i < n) | |||
{ | |||
x[i] = da * x[i] ; | |||
i += inc_x ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,62 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/08/20 Saar | |||
* BLASTEST float OK | |||
* BLASTEST double OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <stdio.h> | |||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT dummy3, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
FLOAT temp; | |||
if ( n < 0 ) return(0); | |||
while(i < n) | |||
{ | |||
temp = x[ix] ; | |||
x[ix] = y[iy] ; | |||
y[iy] = temp ; | |||
ix += inc_x ; | |||
iy += inc_y ; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,81 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1]) | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT maxf[2]; | |||
BLASLONG max=0; | |||
BLASLONG inc_x2; | |||
if (n < 0 || inc_x < 1 ) return(0.0); | |||
inc_x2 = 2 * inc_x; | |||
maxf[0] = ABS(x[ix]); | |||
maxf[1] = ABS(x[ix+1]); | |||
while(i < n) | |||
{ | |||
if( CABS1(x,ix) > CABS1(maxf,0) ) | |||
{ | |||
max = i; | |||
maxf[0] = ABS(x[ix]); | |||
maxf[1] = ABS(x[ix+1]); | |||
} | |||
ix += inc_x2; | |||
i++; | |||
} | |||
return(CABS1(maxf,0)); | |||
} | |||
@@ -0,0 +1,81 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : NoTest | |||
* TEST : NoTest | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1]) | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0; | |||
FLOAT minf[2]; | |||
BLASLONG min=0; | |||
BLASLONG inc_x2; | |||
if (n < 0 || inc_x < 1 ) return(0.0); | |||
inc_x2 = 2 * inc_x; | |||
minf[0] = ABS(x[ix]); | |||
minf[1] = ABS(x[ix+1]); | |||
while(i < n) | |||
{ | |||
if( CABS1(x,ix) < CABS1(minf,0) ) | |||
{ | |||
min = i; | |||
minf[0] = ABS(x[ix]); | |||
minf[1] = ABS(x[ix+1]); | |||
} | |||
ix += inc_x2; | |||
i++; | |||
} | |||
return(CABS1(minf,0)); | |||
} | |||
@@ -0,0 +1,71 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
#define CABS1(x,i) ABS(x[i])+ABS(x[i+1]) | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
FLOAT sumf = 0.0; | |||
BLASLONG inc_x2; | |||
if (n < 0 || inc_x < 1 ) return(sumf); | |||
inc_x2 = 2 * inc_x; | |||
n *= inc_x2; | |||
while(i < n) | |||
{ | |||
sumf += CABS1(x,i); | |||
i += inc_x2; | |||
} | |||
return(sumf); | |||
} | |||
@@ -0,0 +1,72 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/15 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r, FLOAT da_i, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix,iy; | |||
if ( n < 0 ) return(0); | |||
if ( da_r == 0.0 && da_i == 0.0 ) return(0); | |||
ix = 0; | |||
iy = 0; | |||
BLASLONG inc_x2 = 2 * inc_x; | |||
BLASLONG inc_y2 = 2 * inc_y; | |||
while(i < n) | |||
{ | |||
#if !defined(CONJ) | |||
y[iy] += ( da_r * x[ix] - da_i * x[ix+1] ) ; | |||
y[iy+1] += ( da_r * x[ix+1] + da_i * x[ix] ) ; | |||
#else | |||
y[iy] += ( da_r * x[ix] + da_i * x[ix+1] ) ; | |||
y[iy+1] -= ( da_r * x[ix+1] - da_i * x[ix] ) ; | |||
#endif | |||
ix += inc_x2 ; | |||
iy += inc_y2 ; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,63 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
if ( n < 0 ) return(0); | |||
BLASLONG inc_x2 = 2 * inc_x; | |||
BLASLONG inc_y2 = 2 * inc_y; | |||
while(i < n) | |||
{ | |||
y[iy] = x[ix] ; | |||
y[iy+1] = x[ix+1] ; | |||
ix += inc_x2; | |||
iy += inc_y2; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,78 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : FAIL | |||
* BLASTEST double : FAIL | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <complex.h> | |||
FLOAT _Complex CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
FLOAT dot[2]; | |||
FLOAT _Complex result; | |||
dot[0]=0.0; | |||
dot[1]=0.0; | |||
__real__ result = 0.0 ; | |||
__imag__ result = 0.0 ; | |||
if ( n < 1 ) return(result); | |||
BLASLONG inc_x2 = 2 * inc_x ; | |||
BLASLONG inc_y2 = 2 * inc_y ; | |||
while(i < n) | |||
{ | |||
#if !defined(CONJ) | |||
dot[0] += ( x[ix] * y[iy] - x[ix+1] * y[iy+1] ) ; | |||
dot[1] += ( x[ix+1] * y[iy] + x[ix] * y[iy+1] ) ; | |||
#else | |||
dot[0] += ( x[ix] * y[iy] + x[ix+1] * y[iy+1] ) ; | |||
dot[1] -= ( x[ix+1] * y[iy] - x[ix] * y[iy+1] ) ; | |||
#endif | |||
ix += inc_x2 ; | |||
iy += inc_y2 ; | |||
i++ ; | |||
} | |||
__real__ result = dot[0]; | |||
__imag__ result = dot[1]; | |||
return(result); | |||
} | |||
@@ -0,0 +1,125 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* * 2013/09/15 Saar | |||
* * BLASTEST float : OK | |||
* * BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* * | |||
* **************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer) | |||
{ | |||
BLASLONG i; | |||
BLASLONG ix,iy; | |||
BLASLONG j; | |||
FLOAT *a_ptr; | |||
FLOAT temp_r,temp_i; | |||
BLASLONG inc_x2,inc_y2; | |||
BLASLONG lda2; | |||
BLASLONG i2; | |||
if( alpha_r == 0.0 && alpha_i == 0.0 ) return(0); | |||
lda2 = 2*lda; | |||
inc_x2 = 2 * inc_x; | |||
inc_y2 = 2 * inc_y; | |||
ix = 0; | |||
a_ptr = a; | |||
#if !defined(CONJ) | |||
for (j=0; j<n; j++) | |||
{ | |||
#if !defined(XCONJ) | |||
temp_r = alpha_r * x[ix] - alpha_i * x[ix+1]; | |||
temp_i = alpha_r * x[ix+1] + alpha_i * x[ix]; | |||
#else | |||
temp_r = alpha_r * x[ix] + alpha_i * x[ix+1]; | |||
temp_i = alpha_r * x[ix+1] - alpha_i * x[ix]; | |||
#endif | |||
iy = 0; | |||
for (i=0; i<m; i++) | |||
{ | |||
i2 = 2*i; | |||
#if !defined(XCONJ) | |||
y[iy] += temp_r * a_ptr[i2] - temp_i * a_ptr[i2+1]; | |||
y[iy+1] += temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2]; | |||
#else | |||
y[iy] += temp_r * a_ptr[i2] + temp_i * a_ptr[i2+1]; | |||
y[iy+1] += temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2]; | |||
#endif | |||
iy += inc_y2; | |||
} | |||
a_ptr += lda2; | |||
ix += inc_x2; | |||
} | |||
#else | |||
for (j=0; j<n; j++) | |||
{ | |||
#if !defined(XCONJ) | |||
temp_r = alpha_r * x[ix] - alpha_i * x[ix+1]; | |||
temp_i = alpha_r * x[ix+1] + alpha_i * x[ix]; | |||
#else | |||
temp_r = alpha_r * x[ix] + alpha_i * x[ix+1]; | |||
temp_i = alpha_r * x[ix+1] - alpha_i * x[ix]; | |||
#endif | |||
iy = 0; | |||
for (i=0; i<m; i++) | |||
{ | |||
i2 = 2*i; | |||
#if !defined(XCONJ) | |||
y[iy] += temp_r * a_ptr[i2] + temp_i * a_ptr[i2+1]; | |||
y[iy+1] -= temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2]; | |||
#else | |||
y[iy] += temp_r * a_ptr[i2] - temp_i * a_ptr[i2+1]; | |||
y[iy+1] -= temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2]; | |||
#endif | |||
iy += inc_y2; | |||
} | |||
a_ptr += lda2; | |||
ix += inc_x2; | |||
} | |||
#endif | |||
return(0); | |||
} | |||
@@ -0,0 +1,131 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* * 2013/09/15 Saar | |||
* * BLASTEST float : OK | |||
* * BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* * | |||
* **************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer) | |||
{ | |||
BLASLONG i; | |||
BLASLONG ix,iy; | |||
BLASLONG j; | |||
FLOAT *a_ptr; | |||
FLOAT temp_r,temp_i; | |||
BLASLONG inc_x2,inc_y2; | |||
BLASLONG lda2; | |||
BLASLONG i2; | |||
if( alpha_r == 0.0 && alpha_i == 0.0 ) return(0); | |||
lda2 = 2*lda; | |||
inc_x2 = 2 * inc_x; | |||
inc_y2 = 2 * inc_y; | |||
iy = 0; | |||
a_ptr = a; | |||
#if !defined(CONJ) | |||
for (j=0; j<n; j++) | |||
{ | |||
temp_r = 0.0; | |||
temp_i = 0.0; | |||
ix = 0; | |||
for (i=0; i<m; i++) | |||
{ | |||
i2 = 2*i; | |||
#if !defined(XCONJ) | |||
temp_r += a_ptr[i2] * x[ix] - a_ptr[i2+1] * x[ix+1]; | |||
temp_i += a_ptr[i2] * x[ix+1] + a_ptr[i2+1] * x[ix]; | |||
#else | |||
temp_r += a_ptr[i2] * x[ix] + a_ptr[i2+1] * x[ix+1]; | |||
temp_i += a_ptr[i2] * x[ix+1] - a_ptr[i2+1] * x[ix]; | |||
#endif | |||
ix += inc_x2; | |||
} | |||
#if !defined(XCONJ) | |||
y[iy] += alpha_r * temp_r - alpha_i * temp_i; | |||
y[iy+1] += alpha_r * temp_i + alpha_i * temp_r; | |||
#else | |||
y[iy] += alpha_r * temp_r + alpha_i * temp_i; | |||
y[iy+1] -= alpha_r * temp_i - alpha_i * temp_r; | |||
#endif | |||
a_ptr += lda2; | |||
iy += inc_y2; | |||
} | |||
#else | |||
for (j=0; j<n; j++) | |||
{ | |||
temp_r = 0.0; | |||
temp_i = 0.0; | |||
ix = 0; | |||
for (i=0; i<m; i++) | |||
{ | |||
i2 = 2*i; | |||
#if !defined(XCONJ) | |||
temp_r += a_ptr[i2] * x[ix] + a_ptr[i2+1] * x[ix+1]; | |||
temp_i += a_ptr[i2] * x[ix+1] - a_ptr[i2+1] * x[ix]; | |||
#else | |||
temp_r += a_ptr[i2] * x[ix] - a_ptr[i2+1] * x[ix+1]; | |||
temp_i += a_ptr[i2] * x[ix+1] + a_ptr[i2+1] * x[ix]; | |||
#endif | |||
ix += inc_x2; | |||
} | |||
#if !defined(XCONJ) | |||
y[iy] += alpha_r * temp_r - alpha_i * temp_i; | |||
y[iy+1] += alpha_r * temp_i + alpha_i * temp_r; | |||
#else | |||
y[iy] += alpha_r * temp_r + alpha_i * temp_i; | |||
y[iy+1] -= alpha_r * temp_i - alpha_i * temp_r; | |||
#endif | |||
a_ptr += lda2; | |||
iy += inc_y2; | |||
} | |||
#endif | |||
return(0); | |||
} | |||
@@ -0,0 +1,106 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/13 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <math.h> | |||
#if defined(DOUBLE) | |||
#define ABS fabs | |||
#else | |||
#define ABS fabsf | |||
#endif | |||
FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x) | |||
{ | |||
BLASLONG i=0; | |||
FLOAT scale = 0.0; | |||
FLOAT ssq = 1.0; | |||
BLASLONG inc_x2; | |||
FLOAT temp; | |||
if (n < 0 || inc_x < 1 ) return(0.0); | |||
inc_x2 = 2 * inc_x; | |||
n *= inc_x2; | |||
while(i < n) | |||
{ | |||
if ( x[i] != 0.0 ) | |||
{ | |||
temp = ABS( x[i] ); | |||
if ( scale < temp ) | |||
{ | |||
ssq = 1 + ssq * ( scale / temp ) * ( scale / temp ); | |||
scale = temp ; | |||
} | |||
else | |||
{ | |||
ssq += ( temp / scale ) * ( temp / scale ); | |||
} | |||
} | |||
if ( x[i+1] != 0.0 ) | |||
{ | |||
temp = ABS( x[i+1] ); | |||
if ( scale < temp ) | |||
{ | |||
ssq = 1 + ssq * ( scale / temp ) * ( scale / temp ); | |||
scale = temp ; | |||
} | |||
else | |||
{ | |||
ssq += ( temp / scale ) * ( temp / scale ); | |||
} | |||
} | |||
i += inc_x2; | |||
} | |||
scale = scale * sqrt( ssq ); | |||
return(scale); | |||
} | |||
@@ -0,0 +1,68 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT c, FLOAT s) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
FLOAT temp[2]; | |||
if ( n <= 0 ) return(0); | |||
BLASLONG inc_x2 = 2 * inc_x ; | |||
BLASLONG inc_y2 = 2 * inc_y ; | |||
while(i < n) | |||
{ | |||
temp[0] = c*x[ix] + s*y[iy] ; | |||
temp[1] = c*x[ix+1] + s*y[iy+1] ; | |||
y[iy] = c*y[iy] - s*x[ix] ; | |||
y[iy+1] = c*y[iy+1] - s*x[ix+1] ; | |||
x[ix] = temp[0] ; | |||
x[ix+1] = temp[1] ; | |||
ix += inc_x2 ; | |||
iy += inc_y2 ; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,64 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da_r,FLOAT da_i, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG inc_x2; | |||
BLASLONG ip = 0; | |||
FLOAT temp; | |||
if ( n < 0 || inc_x < 1 ) return(0); | |||
inc_x2 = 2 * inc_x; | |||
for ( i=0; i<n; i++ ) | |||
{ | |||
temp = da_r * x[ip] - da_i * x[ip+1] ; | |||
x[ip+1] = da_r * x[ip+1] + da_i * x[ip] ; | |||
x[ip] = temp; | |||
ip += inc_x2; | |||
} | |||
return(0); | |||
} | |||
@@ -0,0 +1,70 @@ | |||
/*************************************************************************** | |||
Copyright (c) 2013, The OpenBLAS Project | |||
All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
1. Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
2. Redistributions in binary form must reproduce the above copyright | |||
notice, this list of conditions and the following disclaimer in | |||
the documentation and/or other materials provided with the | |||
distribution. | |||
3. Neither the name of the OpenBLAS project nor the names of | |||
its contributors may be used to endorse or promote products | |||
derived from this software without specific prior written permission. | |||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||
ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE | |||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*****************************************************************************/ | |||
/************************************************************************************** | |||
* 2013/09/14 Saar | |||
* BLASTEST float : OK | |||
* BLASTEST double : OK | |||
* CTEST : OK | |||
* TEST : OK | |||
* | |||
**************************************************************************************/ | |||
#include "common.h" | |||
#include <stdio.h> | |||
int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT dummy3, FLOAT dummy4, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) | |||
{ | |||
BLASLONG i=0; | |||
BLASLONG ix=0,iy=0; | |||
FLOAT temp[2]; | |||
if ( n < 0 ) return(0); | |||
BLASLONG inc_x2 = 2 * inc_x; | |||
BLASLONG inc_y2 = 2 * inc_y; | |||
while(i < n) | |||
{ | |||
temp[0] = x[ix] ; | |||
temp[1] = x[ix+1] ; | |||
x[ix] = y[iy] ; | |||
x[ix+1] = y[iy+1] ; | |||
y[iy] = temp[0] ; | |||
y[iy+1] = temp[1] ; | |||
ix += inc_x2 ; | |||
iy += inc_y2 ; | |||
i++ ; | |||
} | |||
return(0); | |||
} | |||