Browse Source

Rename the local utility function to my_?copy to avoid symbol clash with the BLAS function

pull/5027/head
Martin Kroeker GitHub 1 year ago
parent
commit
eab9a77c17
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
10 changed files with 6522 additions and 6522 deletions
  1. +259
    -259
      utest/test_extensions/common.c
  2. +76
    -76
      utest/test_extensions/common.h
  3. +822
    -822
      utest/test_extensions/test_cimatcopy.c
  4. +700
    -700
      utest/test_extensions/test_comatcopy.c
  5. +919
    -919
      utest/test_extensions/test_dimatcopy.c
  6. +644
    -644
      utest/test_extensions/test_domatcopy.c
  7. +919
    -919
      utest/test_extensions/test_simatcopy.c
  8. +644
    -644
      utest/test_extensions/test_somatcopy.c
  9. +822
    -822
      utest/test_extensions/test_zimatcopy.c
  10. +717
    -717
      utest/test_extensions/test_zomatcopy.c

+ 259
- 259
utest/test_extensions/common.c View File

@@ -1,259 +1,259 @@
/*****************************************************************************
Copyright (c) 2023, 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 COPYRIGHT OWNER 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.
**********************************************************************************/
#include "common.h"
/**
* Generate random array
*/
void srand_generate(float *alpha, blasint n)
{
blasint i;
for (i = 0; i < n; i++)
alpha[i] = (float)rand() / (float)RAND_MAX;
}
void drand_generate(double *alpha, blasint n)
{
blasint i;
for (i = 0; i < n; i++)
alpha[i] = (double)rand() / (double)RAND_MAX;
}
/**
* Find difference between two rectangle matrix
* return norm of differences
*/
float smatrix_difference(float *a, float *b, blasint cols, blasint rows, blasint ld)
{
blasint i = 0;
blasint j = 0;
blasint inc = 1;
float norm = 0.0f;
float *a_ptr = a;
float *b_ptr = b;
for(i = 0; i < rows; i++)
{
for (j = 0; j < cols; j++) {
a_ptr[j] -= b_ptr[j];
}
norm += BLASFUNC(snrm2)(&cols, a_ptr, &inc);
a_ptr += ld;
b_ptr += ld;
}
return norm/(float)(rows);
}
double dmatrix_difference(double *a, double *b, blasint cols, blasint rows, blasint ld)
{
blasint i = 0;
blasint j = 0;
blasint inc = 1;
double norm = 0.0;
double *a_ptr = a;
double *b_ptr = b;
for(i = 0; i < rows; i++)
{
for (j = 0; j < cols; j++) {
a_ptr[j] -= b_ptr[j];
}
norm += BLASFUNC(dnrm2)(&cols, a_ptr, &inc);
a_ptr += ld;
b_ptr += ld;
}
return norm/(double)(rows);
}
/**
* Complex conjugate operation for vector
*
* param n specifies number of elements in vector x
* param inc_x specifies increment of vector x
* param x_ptr specifies buffer holding vector x
*/
void cconjugate_vector(blasint n, blasint inc_x, float *x_ptr)
{
blasint i;
inc_x *= 2;
for (i = 0; i < n; i++)
{
x_ptr[1] *= (-1.0f);
x_ptr += inc_x;
}
}
void zconjugate_vector(blasint n, blasint inc_x, double *x_ptr)
{
blasint i;
inc_x *= 2;
for (i = 0; i < n; i++)
{
x_ptr[1] *= (-1.0);
x_ptr += inc_x;
}
}
/**
* Transpose matrix
*
* param rows specifies number of rows of A
* param cols specifies number of columns of A
* param alpha specifies scaling factor for matrix A
* param a_src - buffer holding input matrix A
* param lda_src - leading dimension of the matrix A
* param a_dst - buffer holding output matrix A
* param lda_dst - leading dimension of output matrix A
*/
void stranspose(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != cols; i++)
{
for (j = 0; j != rows; j++)
a_dst[i*lda_dst+j] = alpha*a_src[j*lda_src+i];
}
}
void dtranspose(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != cols; i++)
{
for (j = 0; j != rows; j++)
a_dst[i*lda_dst+j] = alpha*a_src[j*lda_src+i];
}
}
void ctranspose(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != cols*2; i+=2)
{
for (j = 0; j != rows*2; j+=2){
a_dst[(i/2)*lda_dst+j] = alpha[0] * a_src[(j/2)*lda_src+i] + conj * alpha[1] * a_src[(j/2)*lda_src+i+1];
a_dst[(i/2)*lda_dst+j+1] = (-1.0f) * conj * alpha[0] * a_src[(j/2)*lda_src+i+1] + alpha[1] * a_src[(j/2)*lda_src+i];
}
}
}
void ztranspose(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != cols*2; i+=2)
{
for (j = 0; j != rows*2; j+=2){
a_dst[(i/2)*lda_dst+j] = alpha[0] * a_src[(j/2)*lda_src+i] + conj * alpha[1] * a_src[(j/2)*lda_src+i+1];
a_dst[(i/2)*lda_dst+j+1] = (-1.0) * conj * alpha[0] * a_src[(j/2)*lda_src+i+1] + alpha[1] * a_src[(j/2)*lda_src+i];
}
}
}
/**
* Copy matrix from source A to destination A
*
* param rows specifies number of rows of A
* param cols specifies number of columns of A
* param alpha specifies scaling factor for matrix A
* param a_src - buffer holding input matrix A
* param lda_src - leading dimension of the matrix A
* param a_dst - buffer holding output matrix A
* param lda_dst - leading dimension of output matrix A
* param conj specifies conjugation
*/
void scopy(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols; j++)
a_dst[i*lda_dst+j] = alpha*a_src[i*lda_src+j];
}
}
void dcopy(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols; j++)
a_dst[i*lda_dst+j] = alpha*a_src[i*lda_src+j];
}
}
void ccopy(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols*2; j+=2){
a_dst[i*lda_dst+j] = alpha[0] * a_src[i*lda_src+j] + conj * alpha[1] * a_src[i*lda_src+j+1];
a_dst[i*lda_dst+j+1] = (-1.0f) * conj *alpha[0] * a_src[i*lda_src+j+1] + alpha[1] * a_src[i*lda_src+j];
}
}
}
void zcopy(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols*2; j+=2){
a_dst[i*lda_dst+j] = alpha[0] * a_src[i*lda_src+j] + conj * alpha[1] * a_src[i*lda_src+j+1];
a_dst[i*lda_dst+j+1] = (-1.0) * conj *alpha[0] * a_src[i*lda_src+j+1] + alpha[1] * a_src[i*lda_src+j];
}
}
}
/*****************************************************************************
Copyright (c) 2023, 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 COPYRIGHT OWNER 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.
**********************************************************************************/
#include "common.h"
/**
* Generate random array
*/
void srand_generate(float *alpha, blasint n)
{
blasint i;
for (i = 0; i < n; i++)
alpha[i] = (float)rand() / (float)RAND_MAX;
}
void drand_generate(double *alpha, blasint n)
{
blasint i;
for (i = 0; i < n; i++)
alpha[i] = (double)rand() / (double)RAND_MAX;
}
/**
* Find difference between two rectangle matrix
* return norm of differences
*/
float smatrix_difference(float *a, float *b, blasint cols, blasint rows, blasint ld)
{
blasint i = 0;
blasint j = 0;
blasint inc = 1;
float norm = 0.0f;
float *a_ptr = a;
float *b_ptr = b;
for(i = 0; i < rows; i++)
{
for (j = 0; j < cols; j++) {
a_ptr[j] -= b_ptr[j];
}
norm += BLASFUNC(snrm2)(&cols, a_ptr, &inc);
a_ptr += ld;
b_ptr += ld;
}
return norm/(float)(rows);
}
double dmatrix_difference(double *a, double *b, blasint cols, blasint rows, blasint ld)
{
blasint i = 0;
blasint j = 0;
blasint inc = 1;
double norm = 0.0;
double *a_ptr = a;
double *b_ptr = b;
for(i = 0; i < rows; i++)
{
for (j = 0; j < cols; j++) {
a_ptr[j] -= b_ptr[j];
}
norm += BLASFUNC(dnrm2)(&cols, a_ptr, &inc);
a_ptr += ld;
b_ptr += ld;
}
return norm/(double)(rows);
}
/**
* Complex conjugate operation for vector
*
* param n specifies number of elements in vector x
* param inc_x specifies increment of vector x
* param x_ptr specifies buffer holding vector x
*/
void cconjugate_vector(blasint n, blasint inc_x, float *x_ptr)
{
blasint i;
inc_x *= 2;
for (i = 0; i < n; i++)
{
x_ptr[1] *= (-1.0f);
x_ptr += inc_x;
}
}
void zconjugate_vector(blasint n, blasint inc_x, double *x_ptr)
{
blasint i;
inc_x *= 2;
for (i = 0; i < n; i++)
{
x_ptr[1] *= (-1.0);
x_ptr += inc_x;
}
}
/**
* Transpose matrix
*
* param rows specifies number of rows of A
* param cols specifies number of columns of A
* param alpha specifies scaling factor for matrix A
* param a_src - buffer holding input matrix A
* param lda_src - leading dimension of the matrix A
* param a_dst - buffer holding output matrix A
* param lda_dst - leading dimension of output matrix A
*/
void stranspose(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != cols; i++)
{
for (j = 0; j != rows; j++)
a_dst[i*lda_dst+j] = alpha*a_src[j*lda_src+i];
}
}
void dtranspose(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != cols; i++)
{
for (j = 0; j != rows; j++)
a_dst[i*lda_dst+j] = alpha*a_src[j*lda_src+i];
}
}
void ctranspose(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != cols*2; i+=2)
{
for (j = 0; j != rows*2; j+=2){
a_dst[(i/2)*lda_dst+j] = alpha[0] * a_src[(j/2)*lda_src+i] + conj * alpha[1] * a_src[(j/2)*lda_src+i+1];
a_dst[(i/2)*lda_dst+j+1] = (-1.0f) * conj * alpha[0] * a_src[(j/2)*lda_src+i+1] + alpha[1] * a_src[(j/2)*lda_src+i];
}
}
}
void ztranspose(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != cols*2; i+=2)
{
for (j = 0; j != rows*2; j+=2){
a_dst[(i/2)*lda_dst+j] = alpha[0] * a_src[(j/2)*lda_src+i] + conj * alpha[1] * a_src[(j/2)*lda_src+i+1];
a_dst[(i/2)*lda_dst+j+1] = (-1.0) * conj * alpha[0] * a_src[(j/2)*lda_src+i+1] + alpha[1] * a_src[(j/2)*lda_src+i];
}
}
}
/**
* Copy matrix from source A to destination A
*
* param rows specifies number of rows of A
* param cols specifies number of columns of A
* param alpha specifies scaling factor for matrix A
* param a_src - buffer holding input matrix A
* param lda_src - leading dimension of the matrix A
* param a_dst - buffer holding output matrix A
* param lda_dst - leading dimension of output matrix A
* param conj specifies conjugation
*/
void my_scopy(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols; j++)
a_dst[i*lda_dst+j] = alpha*a_src[i*lda_src+j];
}
}
void my_dcopy(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst)
{
blasint i, j;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols; j++)
a_dst[i*lda_dst+j] = alpha*a_src[i*lda_src+j];
}
}
void my_ccopy(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols*2; j+=2){
a_dst[i*lda_dst+j] = alpha[0] * a_src[i*lda_src+j] + conj * alpha[1] * a_src[i*lda_src+j+1];
a_dst[i*lda_dst+j+1] = (-1.0f) * conj *alpha[0] * a_src[i*lda_src+j+1] + alpha[1] * a_src[i*lda_src+j];
}
}
}
void my_zcopy(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj)
{
blasint i, j;
lda_dst *= 2;
lda_src *= 2;
for (i = 0; i != rows; i++)
{
for (j = 0; j != cols*2; j+=2){
a_dst[i*lda_dst+j] = alpha[0] * a_src[i*lda_src+j] + conj * alpha[1] * a_src[i*lda_src+j+1];
a_dst[i*lda_dst+j+1] = (-1.0) * conj *alpha[0] * a_src[i*lda_src+j+1] + alpha[1] * a_src[i*lda_src+j];
}
}
}

+ 76
- 76
utest/test_extensions/common.h View File

@@ -1,76 +1,76 @@
/*****************************************************************************
Copyright (c) 2023, 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 COPYRIGHT OWNER 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.
**********************************************************************************/
#ifndef _TEST_EXTENSION_COMMON_H_
#define _TEST_EXTENSION_COMMON_H_
#include <cblas.h>
#include <ctype.h>
#define TRUE 1
#define FALSE 0
#define INVALID -1
#define SINGLE_TOL 1e-02f
#define DOUBLE_TOL 1e-10
extern int check_error(void);
extern void set_xerbla(char* current_rout, int expected_info);
extern int BLASFUNC(xerbla)(char *name, blasint *info, blasint length);
extern void srand_generate(float *alpha, blasint n);
extern void drand_generate(double *alpha, blasint n);
extern float smatrix_difference(float *a, float *b, blasint cols, blasint rows, blasint ld);
extern double dmatrix_difference(double *a, double *b, blasint cols, blasint rows, blasint ld);
extern void cconjugate_vector(blasint n, blasint inc_x, float *x_ptr);
extern void zconjugate_vector(blasint n, blasint inc_x, double *x_ptr);
extern void stranspose(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst);
extern void dtranspose(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst);
extern void ctranspose(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj);
extern void ztranspose(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj);
extern void scopy(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst);
extern void dcopy(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst);
extern void ccopy(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj);
extern void zcopy(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj);
#endif
/*****************************************************************************
Copyright (c) 2023, 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 COPYRIGHT OWNER 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.
**********************************************************************************/
#ifndef _TEST_EXTENSION_COMMON_H_
#define _TEST_EXTENSION_COMMON_H_
#include <cblas.h>
#include <ctype.h>
#define TRUE 1
#define FALSE 0
#define INVALID -1
#define SINGLE_TOL 1e-02f
#define DOUBLE_TOL 1e-10
extern int check_error(void);
extern void set_xerbla(char* current_rout, int expected_info);
extern int BLASFUNC(xerbla)(char *name, blasint *info, blasint length);
extern void srand_generate(float *alpha, blasint n);
extern void drand_generate(double *alpha, blasint n);
extern float smatrix_difference(float *a, float *b, blasint cols, blasint rows, blasint ld);
extern double dmatrix_difference(double *a, double *b, blasint cols, blasint rows, blasint ld);
extern void cconjugate_vector(blasint n, blasint inc_x, float *x_ptr);
extern void zconjugate_vector(blasint n, blasint inc_x, double *x_ptr);
extern void stranspose(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst);
extern void dtranspose(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst);
extern void ctranspose(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj);
extern void ztranspose(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj);
extern void my_scopy(blasint rows, blasint cols, float alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst);
extern void my_dcopy(blasint rows, blasint cols, double alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst);
extern void my_ccopy(blasint rows, blasint cols, float *alpha, float *a_src, int lda_src,
float *a_dst, blasint lda_dst, int conj);
extern void my_zcopy(blasint rows, blasint cols, double *alpha, double *a_src, int lda_src,
double *a_dst, blasint lda_dst, int conj);
#endif

+ 822
- 822
utest/test_extensions/test_cimatcopy.c
File diff suppressed because it is too large
View File


+ 700
- 700
utest/test_extensions/test_comatcopy.c
File diff suppressed because it is too large
View File


+ 919
- 919
utest/test_extensions/test_dimatcopy.c
File diff suppressed because it is too large
View File


+ 644
- 644
utest/test_extensions/test_domatcopy.c
File diff suppressed because it is too large
View File


+ 919
- 919
utest/test_extensions/test_simatcopy.c
File diff suppressed because it is too large
View File


+ 644
- 644
utest/test_extensions/test_somatcopy.c
File diff suppressed because it is too large
View File


+ 822
- 822
utest/test_extensions/test_zimatcopy.c
File diff suppressed because it is too large
View File


+ 717
- 717
utest/test_extensions/test_zomatcopy.c
File diff suppressed because it is too large
View File


Loading…
Cancel
Save