Ref #285: added axpby kernels
This commit is contained in:
@@ -27,6 +27,7 @@ SBLAS1OBJS = \
|
||||
smax.$(SUFFIX) samax.$(SUFFIX) ismax.$(SUFFIX) isamax.$(SUFFIX) \
|
||||
smin.$(SUFFIX) samin.$(SUFFIX) ismin.$(SUFFIX) isamin.$(SUFFIX) \
|
||||
srot.$(SUFFIX) srotg.$(SUFFIX) srotm.$(SUFFIX) srotmg.$(SUFFIX) \
|
||||
saxpby.$(SUFFIX)
|
||||
|
||||
SBLAS2OBJS = \
|
||||
sgemv.$(SUFFIX) sger.$(SUFFIX) \
|
||||
@@ -44,11 +45,12 @@ SBLAS3OBJS = \
|
||||
DBLAS1OBJS = \
|
||||
daxpy.$(SUFFIX) dswap.$(SUFFIX) \
|
||||
dcopy.$(SUFFIX) dscal.$(SUFFIX) \
|
||||
ddot.$(SUFFIX) \
|
||||
ddot.$(SUFFIX) \
|
||||
dasum.$(SUFFIX) dnrm2.$(SUFFIX) \
|
||||
dmax.$(SUFFIX) damax.$(SUFFIX) idmax.$(SUFFIX) idamax.$(SUFFIX) \
|
||||
dmin.$(SUFFIX) damin.$(SUFFIX) idmin.$(SUFFIX) idamin.$(SUFFIX) \
|
||||
drot.$(SUFFIX) drotg.$(SUFFIX) drotm.$(SUFFIX) drotmg.$(SUFFIX) \
|
||||
daxpby.$(SUFFIX)
|
||||
|
||||
DBLAS2OBJS = \
|
||||
dgemv.$(SUFFIX) dger.$(SUFFIX) \
|
||||
@@ -71,6 +73,7 @@ CBLAS1OBJS = \
|
||||
scamax.$(SUFFIX) icamax.$(SUFFIX) \
|
||||
scamin.$(SUFFIX) icamin.$(SUFFIX) \
|
||||
csrot.$(SUFFIX) crotg.$(SUFFIX) \
|
||||
caxpby.$(SUFFIX)
|
||||
|
||||
CBLAS2OBJS = \
|
||||
cgemv.$(SUFFIX) cgeru.$(SUFFIX) cgerc.$(SUFFIX) \
|
||||
@@ -97,6 +100,7 @@ ZBLAS1OBJS = \
|
||||
dzamax.$(SUFFIX) izamax.$(SUFFIX) \
|
||||
dzamin.$(SUFFIX) izamin.$(SUFFIX) \
|
||||
zdrot.$(SUFFIX) zrotg.$(SUFFIX) \
|
||||
zaxpby.$(SUFFIX)
|
||||
|
||||
ZBLAS2OBJS = \
|
||||
zgemv.$(SUFFIX) zgeru.$(SUFFIX) zgerc.$(SUFFIX) \
|
||||
@@ -246,7 +250,7 @@ CSBLAS1OBJS = \
|
||||
cblas_isamax.$(SUFFIX) cblas_sasum.$(SUFFIX) cblas_saxpy.$(SUFFIX) \
|
||||
cblas_scopy.$(SUFFIX) cblas_sdot.$(SUFFIX) cblas_sdsdot.$(SUFFIX) cblas_dsdot.$(SUFFIX) \
|
||||
cblas_srot.$(SUFFIX) cblas_srotg.$(SUFFIX) cblas_srotm.$(SUFFIX) cblas_srotmg.$(SUFFIX) \
|
||||
cblas_sscal.$(SUFFIX) cblas_sswap.$(SUFFIX) cblas_snrm2.$(SUFFIX)
|
||||
cblas_sscal.$(SUFFIX) cblas_sswap.$(SUFFIX) cblas_snrm2.$(SUFFIX) cblas_saxpby.$(SUFFIX)
|
||||
|
||||
CSBLAS2OBJS = \
|
||||
cblas_sgemv.$(SUFFIX) cblas_sger.$(SUFFIX) cblas_ssymv.$(SUFFIX) cblas_strmv.$(SUFFIX) \
|
||||
@@ -262,7 +266,7 @@ CDBLAS1OBJS = \
|
||||
cblas_idamax.$(SUFFIX) cblas_dasum.$(SUFFIX) cblas_daxpy.$(SUFFIX) \
|
||||
cblas_dcopy.$(SUFFIX) cblas_ddot.$(SUFFIX) \
|
||||
cblas_drot.$(SUFFIX) cblas_drotg.$(SUFFIX) cblas_drotm.$(SUFFIX) cblas_drotmg.$(SUFFIX) \
|
||||
cblas_dscal.$(SUFFIX) cblas_dswap.$(SUFFIX) cblas_dnrm2.$(SUFFIX)
|
||||
cblas_dscal.$(SUFFIX) cblas_dswap.$(SUFFIX) cblas_dnrm2.$(SUFFIX) cblas_daxpby.$(SUFFIX)
|
||||
|
||||
CDBLAS2OBJS = \
|
||||
cblas_dgemv.$(SUFFIX) cblas_dger.$(SUFFIX) cblas_dsymv.$(SUFFIX) cblas_dtrmv.$(SUFFIX) \
|
||||
@@ -280,7 +284,8 @@ CCBLAS1OBJS = \
|
||||
cblas_cdotc.$(SUFFIX) cblas_cdotu.$(SUFFIX) \
|
||||
cblas_cdotc_sub.$(SUFFIX) cblas_cdotu_sub.$(SUFFIX) \
|
||||
cblas_cscal.$(SUFFIX) cblas_csscal.$(SUFFIX) \
|
||||
cblas_cswap.$(SUFFIX) cblas_scnrm2.$(SUFFIX)
|
||||
cblas_cswap.$(SUFFIX) cblas_scnrm2.$(SUFFIX) \
|
||||
cblas_caxpby.$(SUFFIX)
|
||||
|
||||
CCBLAS2OBJS = \
|
||||
cblas_cgemv.$(SUFFIX) cblas_cgerc.$(SUFFIX) cblas_cgeru.$(SUFFIX) \
|
||||
@@ -301,7 +306,8 @@ CZBLAS1OBJS = \
|
||||
cblas_zdotc.$(SUFFIX) cblas_zdotu.$(SUFFIX) \
|
||||
cblas_zdotc_sub.$(SUFFIX) cblas_zdotu_sub.$(SUFFIX) \
|
||||
cblas_zscal.$(SUFFIX) cblas_zdscal.$(SUFFIX) \
|
||||
cblas_zswap.$(SUFFIX) cblas_dznrm2.$(SUFFIX)
|
||||
cblas_zswap.$(SUFFIX) cblas_dznrm2.$(SUFFIX) \
|
||||
cblas_zaxpby.$(SUFFIX)
|
||||
|
||||
CZBLAS2OBJS = \
|
||||
cblas_zgemv.$(SUFFIX) cblas_zgerc.$(SUFFIX) cblas_zgeru.$(SUFFIX) \
|
||||
@@ -1991,3 +1997,32 @@ zlarf.$(SUFFIX) zlarf.$(PSUFFIX) : larf.c
|
||||
xlarf.$(SUFFIX) xlarf.$(PSUFFIX) : larf.c
|
||||
$(CC) -c $(CFLAGS) $< -o $(@F)
|
||||
|
||||
|
||||
############# BLAS EXTENSIONS #####################################
|
||||
|
||||
daxpby.$(SUFFIX) daxpby.$(PSUFFIX) : axpby.c
|
||||
$(CC) $(CFLAGS) -c $< -o $(@F)
|
||||
|
||||
cblas_daxpby.$(SUFFIX) cblas_daxpby.$(PSUFFIX) : axpby.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
|
||||
saxpby.$(SUFFIX) saxpby.$(PSUFFIX) : axpby.c
|
||||
$(CC) $(CFLAGS) -c $< -o $(@F)
|
||||
|
||||
cblas_saxpby.$(SUFFIX) cblas_saxpby.$(PSUFFIX) : axpby.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
|
||||
zaxpby.$(SUFFIX) zaxpby.$(PSUFFIX) : zaxpby.c
|
||||
$(CC) $(CFLAGS) -c $< -o $(@F)
|
||||
|
||||
cblas_zaxpby.$(SUFFIX) cblas_zaxpby.$(PSUFFIX) : zaxpby.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
|
||||
caxpby.$(SUFFIX) caxpby.$(PSUFFIX) : zaxpby.c
|
||||
$(CC) $(CFLAGS) -c $< -o $(@F)
|
||||
|
||||
cblas_caxpby.$(SUFFIX) cblas_caxpby.$(PSUFFIX) : zaxpby.c
|
||||
$(CC) $(CFLAGS) -DCBLAS -c $< -o $(@F)
|
||||
|
||||
|
||||
|
||||
|
||||
72
interface/axpby.c
Normal file
72
interface/axpby.c
Normal file
@@ -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.
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************
|
||||
2014/06/07 Saar
|
||||
******************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include "common.h"
|
||||
#ifdef FUNCTION_PROFILE
|
||||
#include "functable.h"
|
||||
#endif
|
||||
|
||||
#ifndef CBLAS
|
||||
|
||||
void NAME(blasint *N, FLOAT *ALPHA, FLOAT *x, blasint *INCX, FLOAT *BETA, FLOAT *y, blasint *INCY)
|
||||
{
|
||||
|
||||
BLASLONG n = *N;
|
||||
BLASLONG incx = *INCX;
|
||||
BLASLONG incy = *INCY;
|
||||
FLOAT alpha = *ALPHA;
|
||||
FLOAT beta = *BETA;
|
||||
|
||||
#else
|
||||
|
||||
void CNAME(blasint n, FLOAT alpha, FLOAT *x, blasint incx, FLOAT beta, FLOAT *y, blasint incy)
|
||||
{
|
||||
|
||||
#endif
|
||||
|
||||
if (n <= 0) return;
|
||||
|
||||
FUNCTION_PROFILE_START();
|
||||
|
||||
if (incx < 0) x -= (n - 1) * incx;
|
||||
if (incy < 0) y -= (n - 1) * incy;
|
||||
|
||||
AXPBY_K(n, alpha, x, incx, beta, y, incy);
|
||||
|
||||
FUNCTION_PROFILE_END(1, 2 * n, 2 * n);
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
74
interface/zaxpby.c
Normal file
74
interface/zaxpby.c
Normal file
@@ -0,0 +1,74 @@
|
||||
/***************************************************************************
|
||||
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.
|
||||
*****************************************************************************/
|
||||
|
||||
/**********************************************************************
|
||||
2014/06/07 Saar
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include "common.h"
|
||||
#ifdef FUNCTION_PROFILE
|
||||
#include "functable.h"
|
||||
#endif
|
||||
|
||||
#ifndef CBLAS
|
||||
|
||||
void NAME(blasint *N, FLOAT *ALPHA, FLOAT *x, blasint *INCX, FLOAT *BETA, FLOAT *y, blasint *INCY)
|
||||
{
|
||||
|
||||
blasint n = *N;
|
||||
blasint incx = *INCX;
|
||||
blasint incy = *INCY;
|
||||
|
||||
#else
|
||||
|
||||
void CNAME(blasint n, FLOAT *ALPHA, FLOAT *x, blasint incx, FLOAT *BETA, FLOAT *y, blasint incy)
|
||||
{
|
||||
|
||||
#endif
|
||||
|
||||
if (n <= 0) return;
|
||||
|
||||
FLOAT alpha_r = *(ALPHA + 0);
|
||||
FLOAT alpha_i = *(ALPHA + 1);
|
||||
FLOAT beta_r = *(BETA + 0);
|
||||
FLOAT beta_i = *(BETA + 1);
|
||||
|
||||
FUNCTION_PROFILE_START();
|
||||
|
||||
if (incx < 0) x -= (n - 1) * incx * 2;
|
||||
if (incy < 0) y -= (n - 1) * incy * 2;
|
||||
|
||||
AXPBY_K (n, alpha_r, alpha_i, x, incx, beta_r, beta_i, y, incy);
|
||||
|
||||
FUNCTION_PROFILE_END(4, 2 * n, 2 * n);
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user