mirror of
https://github.com/amd/blis.git
synced 2026-04-20 07:38:53 +00:00
Defined eqsc, eqv, eqm to test object equality.
Details:
- Defined eqsc, eqv, and eqm operations, which set a bool depending on
whether the two scalars, two vectors, or two matrix operands are equal
(element-wise). eqsc and eqv support implicit conjugation and eqm
supports diagonal offset, diag, uplo, and trans parameters (in a
manner consistent with other level-1m operations). These operations
are currently housed under frame/util, at least for now, because they
are not computational in nature.
- Redefined bli_obj_equals() in terms of eqsc, eqv, and eqm.
- Documented eqsc, eqv, and eqm in BLISObjectAPI.md and BLISTypedAPI.md.
Also:
- Documented getsc and setsc in both docs.
- Reordered entry for setijv in BLISTypedAPI.md, and added separator
bars to both docs.
- Added missing "Observed object properties" clauses to various
levle-1v entries in BLISObjectAPI.md.
- Defined bli_apply_trans() in bli_param_macro_defs.h.
- Defined supporting _check() function, bli_l0_xxbsc_check(), in
bli_l0_check.c for eqsc.
- Programming style and whitespace updates to bli_l1m_unb_var1.c.
- Whitespace updates to bli_l0_oapi.c, bli_l1m_oapi.c
- Consolidated redundant macro redefinition for copym function pointer
type in bli_l1m_ft.h.
- Added macros to bli_oapi_ba.h, _ex.h, and bli_tapi_ba.h, _ex.h that
allow oapi and tapi source files to forego defining certain expert
functions. (Certain operations such as printv and printm do not need
to have both basic expert interfaces. This also includes eqsc, eqv,
and eqm.)
This commit is contained in:
@@ -53,7 +53,7 @@ This index provides a quick way to jump directly to the description for each ope
|
||||
* **[Level-3](BLISObjectAPI.md#level-3-operations)**: Operations with matrices that are multiplication-like:
|
||||
* [gemm](BLISObjectAPI.md#gemm), [hemm](BLISObjectAPI.md#hemm), [herk](BLISObjectAPI.md#herk), [her2k](BLISObjectAPI.md#her2k), [symm](BLISObjectAPI.md#symm), [syrk](BLISObjectAPI.md#syrk), [syr2k](BLISObjectAPI.md#syr2k), [trmm](BLISObjectAPI.md#trmm), [trmm3](BLISObjectAPI.md#trmm3), [trsm](BLISObjectAPI.md#trsm)
|
||||
* **[Utility](BLISObjectAPI.md#Utility-operations)**: Miscellaneous operations on matrices and vectors:
|
||||
* [asumv](BLISObjectAPI.md#asumv), [norm1v](BLISObjectAPI.md#norm1v), [normfv](BLISObjectAPI.md#normfv), [normiv](BLISObjectAPI.md#normiv), [norm1m](BLISObjectAPI.md#norm1m), [normfm](BLISObjectAPI.md#normfm), [normim](BLISObjectAPI.md#normim), [mkherm](BLISObjectAPI.md#mkherm), [mksymm](BLISObjectAPI.md#mksymm), [mktrim](BLISObjectAPI.md#mktrim), [fprintv](BLISObjectAPI.md#fprintv), [fprintm](BLISObjectAPI.md#fprintm),[printv](BLISObjectAPI.md#printv), [printm](BLISObjectAPI.md#printm), [randv](BLISObjectAPI.md#randv), [randm](BLISObjectAPI.md#randm), [sumsqv](BLISObjectAPI.md#sumsqv), [getijv](BLISObjectAPI.md#getijv), [getijm](BLISObjectAPI.md#getijm), [setijv](BLISObjectAPI.md#setijv), [setijm](BLISObjectAPI.md#setijm)
|
||||
* [asumv](BLISObjectAPI.md#asumv), [norm1v](BLISObjectAPI.md#norm1v), [normfv](BLISObjectAPI.md#normfv), [normiv](BLISObjectAPI.md#normiv), [norm1m](BLISObjectAPI.md#norm1m), [normfm](BLISObjectAPI.md#normfm), [normim](BLISObjectAPI.md#normim), [mkherm](BLISObjectAPI.md#mkherm), [mksymm](BLISObjectAPI.md#mksymm), [mktrim](BLISObjectAPI.md#mktrim), [fprintv](BLISObjectAPI.md#fprintv), [fprintm](BLISObjectAPI.md#fprintm),[printv](BLISObjectAPI.md#printv), [printm](BLISObjectAPI.md#printm), [randv](BLISObjectAPI.md#randv), [randm](BLISObjectAPI.md#randm), [sumsqv](BLISObjectAPI.md#sumsqv), [getsc](BLISObjectAPI.md#getsc), [getijv](BLISObjectAPI.md#getijv), [getijm](BLISObjectAPI.md#getijm), [setsc](BLISObjectAPI.md#setsc), [setijv](BLISObjectAPI.md#setijv), [setijm](BLISObjectAPI.md#setijm), [eqsc](BLISObjectAPI.md#eqsc), [eqv](BLISObjectAPI.md#eqv), [eqm](BLISObjectAPI.md#eqm)
|
||||
|
||||
|
||||
|
||||
@@ -790,6 +790,8 @@ Perform
|
||||
```
|
||||
where `x` and `y` are vectors of length _n_.
|
||||
|
||||
Observed object properties: `conj?(x)`.
|
||||
|
||||
---
|
||||
|
||||
#### dotv
|
||||
@@ -807,6 +809,8 @@ Perform
|
||||
```
|
||||
where `x` and `y` are vectors of length _n_, and `rho` is a scalar.
|
||||
|
||||
Observed object properties: `conj?(x)`, `conj?(y)`.
|
||||
|
||||
---
|
||||
|
||||
#### dotxv
|
||||
@@ -826,6 +830,8 @@ Perform
|
||||
```
|
||||
where `x` and `y` are vectors of length _n_, and `alpha`, `beta`, and `rho` are scalars.
|
||||
|
||||
Observed object properties: `conj?(alpha)`, `conj?(beta)`, `conj?(x)`, `conj?(y)`.
|
||||
|
||||
---
|
||||
|
||||
#### invertv
|
||||
@@ -2125,6 +2131,19 @@ where, on entry, `scale` and `sumsq` contain `scale_old` and `sumsq_old`, respec
|
||||
|
||||
---
|
||||
|
||||
#### getsc
|
||||
```c
|
||||
void bli_getsc
|
||||
(
|
||||
obj_t* chi,
|
||||
double* zeta_r,
|
||||
double* zeta_i
|
||||
)
|
||||
```
|
||||
Copy the real and imaginary values from the scalar object `chi` to `zeta_r` and `zeta_i`. If `chi` is stored as a real type, then `zeta_i` is set to zero. (If `chi` is stored in single precision, the corresponding elements are typecast/promoted during the copy.)
|
||||
|
||||
---
|
||||
|
||||
#### getijv
|
||||
```c
|
||||
err_t bli_getijv
|
||||
@@ -2138,6 +2157,8 @@ err_t bli_getijv
|
||||
Copy the real and imaginary values at the `i`th element of vector object `x` to `ar` and `ai`. If elements of `x` are stored as real types, then only `ar` is overwritten and `ai` is left unchanged. (If `x` contains elements stored in single precision, the corresponding elements are typecast/promoted during the copy.)
|
||||
If either the element offset `i` is beyond the vector dimension of `x` or less than zero, the function returns `BLIS_FAILURE` without taking any action. Similarly, if `x` is a global scalar constant such as `BLIS_ONE`, the function returns `BLIS_FAILURE`.
|
||||
|
||||
---
|
||||
|
||||
#### getijm
|
||||
```c
|
||||
err_t bli_getijm
|
||||
@@ -2152,6 +2173,21 @@ err_t bli_getijm
|
||||
Copy the real and imaginary values at the (`i`,`j`) element of object `b` to `ar` and `ai`. If elements of `b` are stored as real types, then only `ar` is overwritten and `ai` is left unchanged. (If `b` contains elements stored in single precision, the corresponding elements are typecast/promoted during the copy.)
|
||||
If either the row offset `i` is beyond the _m_ dimension of `b` or less than zero, or column offset `j` is beyond the _n_ dimension of `b` or less than zero, the function returns `BLIS_FAILURE` without taking any action. Similarly, if `b` is a global scalar constant such as `BLIS_ONE`, the function returns `BLIS_FAILURE`.
|
||||
|
||||
---
|
||||
|
||||
#### setsc
|
||||
```c
|
||||
void bli_setsc
|
||||
(
|
||||
double* zeta_r,
|
||||
double* zeta_i,
|
||||
obj_t* chi
|
||||
);
|
||||
```
|
||||
Copy real and imaginary values `zeta_r` and `zeta_i` to the scalar object `chi`. If `chi` is stored as a real type, then `zeta_i` is ignored. (If `chi` is stored in single precision, the contents are typecast/demoted during the copy.)
|
||||
|
||||
---
|
||||
|
||||
#### setijv
|
||||
```c
|
||||
err_t bli_setijv
|
||||
@@ -2165,6 +2201,8 @@ err_t bli_setijv
|
||||
Copy real and imaginary values `ar` and `ai` to the `i`th element of vector object `x`. If elements of `x` are stored as real types, then only `ar` is copied and `ai` is ignored. (If `x` contains elements stored in single precision, the corresponding elements are typecast/demoted during the copy.)
|
||||
If the element offset `i` is beyond the vector dimension of `x` or less than zero, the function returns `BLIS_FAILURE` without taking any action. Similarly, if `x` is a global scalar constant such as `BLIS_ONE`, the function returns `BLIS_FAILURE`.
|
||||
|
||||
---
|
||||
|
||||
#### setijm
|
||||
```c
|
||||
err_t bli_setijm
|
||||
@@ -2179,6 +2217,58 @@ err_t bli_setijm
|
||||
Copy real and imaginary values `ar` and `ai` to the (`i`,`j`) element of object `b`. If elements of `b` are stored as real types, then only `ar` is copied and `ai` is ignored. (If `b` contains elements stored in single precision, the corresponding elements are typecast/demoted during the copy.)
|
||||
If either the row offset `i` is beyond the _m_ dimension of `b` or less than zero, or column offset `j` is beyond the _n_ dimension of `b` or less than zero, the function returns `BLIS_FAILURE` without taking any action. Similarly, if `b` is a global scalar constant such as `BLIS_ONE`, the function returns `BLIS_FAILURE`.
|
||||
|
||||
---
|
||||
|
||||
#### eqsc
|
||||
```c
|
||||
void bli_eqsc
|
||||
(
|
||||
obj_t chi,
|
||||
obj_t psi,
|
||||
bool* is_eq
|
||||
);
|
||||
```
|
||||
Perform an element-wise comparison between scalars `chi` and `psi` and store the boolean result in the `bool` pointed to by `is_eq`.
|
||||
If exactly one of `conj(chi)` or `conj(psi)` (but not both) indicate a conjugation, then one of the scalars will be implicitly conjugated for purposes of the comparision.
|
||||
|
||||
Observed object properties: `conj?(chi)`, `conj?(psi)`.
|
||||
|
||||
---
|
||||
|
||||
#### eqv
|
||||
```c
|
||||
void bli_eqv
|
||||
(
|
||||
obj_t x,
|
||||
obj_t y,
|
||||
bool* is_eq
|
||||
);
|
||||
```
|
||||
Perform an element-wise comparison between vectors `x` and `y` and store the boolean result in the `bool` pointed to by `is_eq`.
|
||||
If exactly one of `conj(x)` or `conj(y)` (but not both) indicate a conjugation, then one of the vectors will be implicitly conjugated for purposes of the comparision.
|
||||
|
||||
Observed object properties: `conj?(x)`, `conj?(y)`.
|
||||
|
||||
---
|
||||
|
||||
#### eqm
|
||||
```c
|
||||
void bli_eqm
|
||||
(
|
||||
obj_t a,
|
||||
obj_t b,
|
||||
bool* is_eq
|
||||
);
|
||||
```
|
||||
Perform an element-wise comparison between matrices `A` and `B` and store the boolean result in the `bool` pointed to by `is_eq`.
|
||||
Here, `A` is stored as a dense matrix, or lower- or upper-triangular/trapezoidal matrix with arbitrary diagonal offset and unit or non-unit diagonal.
|
||||
If `diag(A)` indicates a unit diagonal, the diagonals of both matrices will be ignored for purposes of the comparision.
|
||||
If `uplo(A)` indicates lower or upper storage, only that part of both matrices `A` and `B` will be referenced.
|
||||
If exactly one of `trans(A)` or `trans(B)` (but not both) indicate a transposition, then one of the matrices will be transposed for purposes of the comparison.
|
||||
Similarly, if exactly one of `trans(A)` or `trans(B)` (but not both) indicate a conjugation, then one of the matrices will be implicitly conjugated for purposes of the comparision.
|
||||
|
||||
Observed object properties: `diagoff(A)`, `diag(A)`, `uplo(A)`, `trans?(A)`, `trans?(B)`.
|
||||
|
||||
|
||||
|
||||
# Query function reference
|
||||
|
||||
@@ -48,7 +48,7 @@ This index provides a quick way to jump directly to the description for each ope
|
||||
* **[Level-3](BLISTypedAPI.md#level-3-operations)**: Operations with matrices that are multiplication-like:
|
||||
* [gemm](BLISTypedAPI.md#gemm), [hemm](BLISTypedAPI.md#hemm), [herk](BLISTypedAPI.md#herk), [her2k](BLISTypedAPI.md#her2k), [symm](BLISTypedAPI.md#symm), [syrk](BLISTypedAPI.md#syrk), [syr2k](BLISTypedAPI.md#syr2k), [trmm](BLISTypedAPI.md#trmm), [trmm3](BLISTypedAPI.md#trmm3), [trsm](BLISTypedAPI.md#trsm)
|
||||
* **[Utility](BLISTypedAPI.md#Utility-operations)**: Miscellaneous operations on matrices and vectors:
|
||||
* [asumv](BLISTypedAPI.md#asumv), [norm1v](BLISTypedAPI.md#norm1v), [normfv](BLISTypedAPI.md#normfv), [normiv](BLISTypedAPI.md#normiv), [norm1m](BLISTypedAPI.md#norm1m), [normfm](BLISTypedAPI.md#normfm), [normim](BLISTypedAPI.md#normim), [mkherm](BLISTypedAPI.md#mkherm), [mksymm](BLISTypedAPI.md#mksymm), [mktrim](BLISTypedAPI.md#mktrim), [fprintv](BLISTypedAPI.md#fprintv), [fprintm](BLISTypedAPI.md#fprintm),[printv](BLISTypedAPI.md#printv), [printm](BLISTypedAPI.md#printm), [randv](BLISTypedAPI.md#randv), [randm](BLISTypedAPI.md#randm), [sumsqv](BLISTypedAPI.md#sumsqv), [getijv](BLISTypedAPI.md#getijv), [getijm](BLISTypedAPI.md#getijm), [setijv](BLISTypedAPI.md#setijv), [setijm](BLISTypedAPI.md#setijm)
|
||||
* [asumv](BLISTypedAPI.md#asumv), [norm1v](BLISTypedAPI.md#norm1v), [normfv](BLISTypedAPI.md#normfv), [normiv](BLISTypedAPI.md#normiv), [norm1m](BLISTypedAPI.md#norm1m), [normfm](BLISTypedAPI.md#normfm), [normim](BLISTypedAPI.md#normim), [mkherm](BLISTypedAPI.md#mkherm), [mksymm](BLISTypedAPI.md#mksymm), [mktrim](BLISTypedAPI.md#mktrim), [fprintv](BLISTypedAPI.md#fprintv), [fprintm](BLISTypedAPI.md#fprintm),[printv](BLISTypedAPI.md#printv), [printm](BLISTypedAPI.md#printm), [randv](BLISTypedAPI.md#randv), [randm](BLISTypedAPI.md#randm), [sumsqv](BLISTypedAPI.md#sumsqv), [getsc](BLISTypedAPI.md#getsc), [getijv](BLISTypedAPI.md#getijv), [getijm](BLISTypedAPI.md#getijm), [setsc](BLISTypedAPI.md#setsc), [setijv](BLISTypedAPI.md#setijv), [setijm](BLISTypedAPI.md#setijm), [eqsc](BLISTypedAPI.md#eqsc), [eqv](BLISTypedAPI.md#eqv), [eqm](BLISTypedAPI.md#eqm)
|
||||
|
||||
|
||||
|
||||
@@ -1695,6 +1695,19 @@ where, on entry, `scale` and `sumsq` contain `scale_old` and `sumsq_old`, respec
|
||||
|
||||
---
|
||||
|
||||
#### getsc
|
||||
```c
|
||||
void bli_getsc
|
||||
(
|
||||
ctype* chi,
|
||||
double* zeta_r,
|
||||
double* zeta_i
|
||||
)
|
||||
```
|
||||
Copy the real and imaginary values from the scalar object `chi` to `zeta_r` and `zeta_i`. If `chi` is stored as a real type, then `zeta_i` is set to zero. (If `chi` is stored in single precision, the corresponding elements are typecast/promoted during the copy.)
|
||||
|
||||
---
|
||||
|
||||
#### getijv
|
||||
```c
|
||||
err_t bli_?getijv
|
||||
@@ -1708,18 +1721,7 @@ err_t bli_?getijv
|
||||
Copy the real and imaginary values at the `i`th element of vector `x` to `ar` and `ai`. For real domain invocations, only `ar` is overwritten and `ai` is left unchanged. (If `x` contains elements stored in single precision, the corresponding elements are typecast/promoted during the copy.)
|
||||
Note that the object-based analogue of [getijv](BLISObjectAPI.md#getijv) does bounds checking of the vector element offset `i` against the vector length while the typed functions specified above do not (since the vector length is not given).
|
||||
|
||||
#### setijv
|
||||
```c
|
||||
err_t bli_?setijv
|
||||
(
|
||||
double ar,
|
||||
double ai,
|
||||
dim_t i,
|
||||
ctype* x, incx
|
||||
);
|
||||
```
|
||||
Copy real and imaginary values `ar` and `ai` to the `i`th element of vector object `x`. For real domain invocations, only `ar` is copied and `ai` is ignored. (If `x` contains elements stored in single precision, the corresponding elements are typecast/demoted during the copy.)
|
||||
Note that the object-based analogue of [setijv](BLISObjectAPI.md#setijv) does bounds checking of the vector element offset `i` against the vector length while the typed functions specified above do not (since the vector length is not given).
|
||||
---
|
||||
|
||||
#### getijm
|
||||
```c
|
||||
@@ -1735,6 +1737,36 @@ err_t bli_?getijm
|
||||
Copy the real and imaginary values at the (`i`,`j`) element of object `b` to `ar` and `ai`. For real domain invocations, only `ar` is overwritten and `ai` is left unchanged. (If `b` contains elements stored in single precision, the corresponding elements are typecast/promoted during the copy.)
|
||||
Note that the object-based analogue of [getijm](BLISObjectAPI.md#getijm) does bounds checking of the matrix element offsets (`i`,`j`) against the matrix dimensions while the typed functions specified above do not (since the matrix dimensions are not given).
|
||||
|
||||
---
|
||||
|
||||
#### setsc
|
||||
```c
|
||||
void bli_setsc
|
||||
(
|
||||
double* zeta_r,
|
||||
double* zeta_i,
|
||||
ctype* chi
|
||||
);
|
||||
```
|
||||
Copy real and imaginary values `zeta_r` and `zeta_i` to the scalar object `chi`. If `chi` is stored as a real type, then `zeta_i` is ignored. (If `chi` is stored in single precision, the contents are typecast/demoted during the copy.)
|
||||
|
||||
---
|
||||
|
||||
#### setijv
|
||||
```c
|
||||
err_t bli_?setijv
|
||||
(
|
||||
double ar,
|
||||
double ai,
|
||||
dim_t i,
|
||||
ctype* x, incx
|
||||
);
|
||||
```
|
||||
Copy real and imaginary values `ar` and `ai` to the `i`th element of vector object `x`. For real domain invocations, only `ar` is copied and `ai` is ignored. (If `x` contains elements stored in single precision, the corresponding elements are typecast/demoted during the copy.)
|
||||
Note that the object-based analogue of [setijv](BLISObjectAPI.md#setijv) does bounds checking of the vector element offset `i` against the vector length while the typed functions specified above do not (since the vector length is not given).
|
||||
|
||||
---
|
||||
|
||||
#### setijm
|
||||
```c
|
||||
err_t bli_?setijm
|
||||
@@ -1749,6 +1781,62 @@ err_t bli_?setijm
|
||||
Copy real and imaginary values `ar` and `ai` to the (`i`,`j`) element of object `b`. For real domain invocations, only `ar` is copied and `ai` is ignored. (If `b` contains elements stored in single precision, the corresponding elements are typecast/demoted during the copy.)
|
||||
Note that the object-based analogue of [setijm](BLISObjectAPI.md#setijm) does bounds checking of the matrix element offsets (`i`,`j`) against the matrix dimensions while the typed functions specified above do not (since the matrix dimensions are not given).
|
||||
|
||||
---
|
||||
|
||||
#### eqsc
|
||||
```c
|
||||
void bli_?eqsc
|
||||
(
|
||||
conj_t conjchi,
|
||||
ctype* chi,
|
||||
ctype* psi,
|
||||
bool* is_eq
|
||||
);
|
||||
```
|
||||
Perform an element-wise comparison between scalars `chi` and `psi` and store the boolean result in the `bool` pointed to by `is_eq`.
|
||||
If `conjchi` indicates a conjugation, `chi` will be implicitly conjugated for purposes of the comparision.
|
||||
|
||||
---
|
||||
|
||||
#### eqv
|
||||
```c
|
||||
void bli_?eqv
|
||||
(
|
||||
conj_t conjx,
|
||||
dim_t n,
|
||||
ctype* x, inc_t incx,
|
||||
ctype* y, inc_t incy,
|
||||
bool* is_eq
|
||||
);
|
||||
```
|
||||
Perform an element-wise comparison between length _n_ vectors `x` and `y` and store the boolean result in the `bool` pointed to by `is_eq`.
|
||||
If `conjx` indicates a conjugation, `x` will be implicitly conjugated for purposes of the comparision.
|
||||
|
||||
---
|
||||
|
||||
#### eqm
|
||||
```c
|
||||
void bli_?eqm
|
||||
(
|
||||
doff_t diagoffa,
|
||||
diag_t diaga,
|
||||
uplo_t uploa,
|
||||
trans_t transa,
|
||||
dim_t m,
|
||||
dim_t n,
|
||||
ctype* a, inc_t rs_a, inc_t cs_a,
|
||||
ctype* b, inc_t rs_b, inc_t cs_b,
|
||||
bool* is_eq
|
||||
)
|
||||
```
|
||||
Perform an element-wise comparison between matrices `A` and `B` and store the boolean result in the `bool` pointed to by `is_eq`.
|
||||
Here, `B` is an _m x n_ matrix, `A` is stored as a dense matrix, or lower- or upper-triangular/trapezoidal matrix with arbitrary diagonal offset and unit or non-unit diagonal.
|
||||
If `diaga` indicates a unit diagonal, the diagonals of both matrices will be ignored for purposes of the comparision.
|
||||
If `uploa` indicates lower or upper storage, only that part of matrix `A` will be referenced in the comparison.
|
||||
If `transa` indicates a conjugation and/or transposition, then `A` will be conjugated and/or transposed for purposes of the comparison.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Level-3 microkernels
|
||||
|
||||
@@ -87,6 +87,7 @@ void PASTEMAC(opname,_check) \
|
||||
GENFRONT( absqsc )
|
||||
GENFRONT( normfsc )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_getsc_check
|
||||
(
|
||||
@@ -352,3 +353,37 @@ void bli_l0_xx2sc_check
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
|
||||
void bli_l0_xxbsc_check
|
||||
(
|
||||
obj_t* chi,
|
||||
obj_t* psi,
|
||||
bool* is_eq
|
||||
)
|
||||
{
|
||||
err_t e_val;
|
||||
|
||||
// Check object datatypes.
|
||||
|
||||
e_val = bli_check_noninteger_object( chi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_noninteger_object( psi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check object dimensions.
|
||||
|
||||
e_val = bli_check_scalar_object( chi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_scalar_object( psi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
// Check object buffers (for non-NULLness).
|
||||
|
||||
e_val = bli_check_object_buffer( chi );
|
||||
bli_check_error_code( e_val );
|
||||
|
||||
e_val = bli_check_object_buffer( psi );
|
||||
bli_check_error_code( e_val );
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,6 @@ void PASTEMAC(opname,_check) \
|
||||
|
||||
GENTPROT( zipsc )
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void bli_l0_xsc_check
|
||||
@@ -148,3 +147,10 @@ void bli_l0_xx2sc_check
|
||||
obj_t* chi,
|
||||
obj_t* norm
|
||||
);
|
||||
|
||||
void bli_l0_xxbsc_check
|
||||
(
|
||||
obj_t* chi,
|
||||
obj_t* psi,
|
||||
bool* is_eq
|
||||
);
|
||||
|
||||
@@ -175,4 +175,3 @@ typedef void (*PASTECH2(ch,opname,tsuf)) \
|
||||
|
||||
INSERT_GENTDEFR( zipsc )
|
||||
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
buf_chi, \
|
||||
buf_absq \
|
||||
buf_chi, \
|
||||
buf_absq \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -105,9 +105,9 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
conjchi, \
|
||||
buf_chi, \
|
||||
buf_psi \
|
||||
conjchi, \
|
||||
buf_chi, \
|
||||
buf_psi \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -142,8 +142,8 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
conjchi, \
|
||||
buf_chi \
|
||||
conjchi, \
|
||||
buf_chi \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -175,8 +175,8 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
buf_chi, \
|
||||
buf_psi \
|
||||
buf_chi, \
|
||||
buf_psi \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -218,9 +218,9 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
buf_chi, \
|
||||
zeta_r, \
|
||||
zeta_i \
|
||||
buf_chi, \
|
||||
zeta_r, \
|
||||
zeta_i \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -252,9 +252,9 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
zeta_r, \
|
||||
zeta_i, \
|
||||
buf_chi \
|
||||
zeta_r, \
|
||||
zeta_i, \
|
||||
buf_chi \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -295,9 +295,9 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
buf_chi, \
|
||||
buf_zeta_r, \
|
||||
buf_zeta_i \
|
||||
buf_chi, \
|
||||
buf_zeta_r, \
|
||||
buf_zeta_i \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -332,9 +332,9 @@ void PASTEMAC0(opname) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
buf_zeta_i, \
|
||||
buf_zeta_r, \
|
||||
buf_chi \
|
||||
buf_zeta_i, \
|
||||
buf_zeta_r, \
|
||||
buf_chi \
|
||||
); \
|
||||
}
|
||||
|
||||
|
||||
@@ -128,9 +128,3 @@ BLIS_EXPORT_BLIS void PASTEMAC0(opname) \
|
||||
|
||||
GENPROT( zipsc )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,25 +57,6 @@ typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \
|
||||
|
||||
INSERT_GENTDEF( addm )
|
||||
INSERT_GENTDEF( subm )
|
||||
|
||||
// copym
|
||||
|
||||
#undef GENTDEF
|
||||
#define GENTDEF( ctype, ch, opname, tsuf ) \
|
||||
\
|
||||
typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \
|
||||
( \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
trans_t transx, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
ctype* y, inc_t rs_y, inc_t cs_y \
|
||||
BLIS_TAPI_EX_PARAMS \
|
||||
);
|
||||
|
||||
INSERT_GENTDEF( copym )
|
||||
|
||||
// axpym
|
||||
|
||||
@@ -78,17 +78,17 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -146,18 +146,18 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_alpha, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_alpha, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -223,17 +223,17 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_alpha, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
cntx, \
|
||||
rntm \
|
||||
( \
|
||||
BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_alpha, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -285,17 +285,17 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_alpha, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
cntx, \
|
||||
rntm \
|
||||
( \
|
||||
BLIS_NO_CONJUGATE, /* internal conjugation applied during copy-cast. */ \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_alpha, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -354,18 +354,18 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
PASTEMAC2(opname,BLIS_TAPI_EX_SUF,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_beta, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_beta, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -420,17 +420,17 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_beta, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_beta, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
|
||||
@@ -57,15 +57,12 @@ void PASTEMAC(ch,opname) \
|
||||
{ \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
ctype* y1; \
|
||||
uplo_t uplox_eff; \
|
||||
conj_t conjx; \
|
||||
dim_t n_iter; \
|
||||
dim_t n_elem, n_elem_max; \
|
||||
dim_t n_elem_max; \
|
||||
inc_t ldx, incx; \
|
||||
inc_t ldy, incy; \
|
||||
dim_t j, i; \
|
||||
dim_t ij0, n_shift; \
|
||||
\
|
||||
/* Set various loop parameters. */ \
|
||||
@@ -88,62 +85,65 @@ void PASTEMAC(ch,opname) \
|
||||
/* Handle dense and upper/lower storage cases separately. */ \
|
||||
if ( bli_is_dense( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
y1 = y + (j )*ldy + (0 )*incy; \
|
||||
ctype* x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if ( bli_is_upper( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
const dim_t n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
\
|
||||
x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
y1 = y + (ij0+j )*ldy + (0 )*incy; \
|
||||
ctype* x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (ij0+j )*ldy + (0 )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else if ( bli_is_lower( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
n_elem = n_elem_max - i; \
|
||||
const dim_t offi = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
const dim_t n_elem = n_elem_max - offi; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (ij0+i )*incx; \
|
||||
y1 = y + (j )*ldy + (ij0+i )*incy; \
|
||||
ctype* x1 = x + (j )*ldx + (ij0+offi )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (ij0+offi )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
@@ -174,15 +174,12 @@ void PASTEMAC(ch,opname) \
|
||||
{ \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
ctype* y1; \
|
||||
uplo_t uplox_eff; \
|
||||
conj_t conjx; \
|
||||
dim_t n_iter; \
|
||||
dim_t n_elem, n_elem_max; \
|
||||
dim_t n_elem_max; \
|
||||
inc_t ldx, incx; \
|
||||
inc_t ldy, incy; \
|
||||
dim_t j, i; \
|
||||
dim_t ij0, n_shift; \
|
||||
\
|
||||
/* Set various loop parameters. */ \
|
||||
@@ -205,65 +202,68 @@ void PASTEMAC(ch,opname) \
|
||||
/* Handle dense and upper/lower storage cases separately. */ \
|
||||
if ( bli_is_dense( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
y1 = y + (j )*ldy + (0 )*incy; \
|
||||
ctype* x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if ( bli_is_upper( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
const dim_t n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
\
|
||||
x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
y1 = y + (ij0+j )*ldy + (0 )*incy; \
|
||||
ctype* x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (ij0+j )*ldy + (0 )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else if ( bli_is_lower( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
n_elem = n_elem_max - i; \
|
||||
const dim_t offi = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
const dim_t n_elem = n_elem_max - offi; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (ij0+i )*incx; \
|
||||
y1 = y + (j )*ldy + (ij0+i )*incy; \
|
||||
ctype* x1 = x + (j )*ldx + (ij0+offi )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (ij0+offi )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
@@ -292,12 +292,10 @@ void PASTEMAC(ch,opname) \
|
||||
{ \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
uplo_t uplox_eff; \
|
||||
dim_t n_iter; \
|
||||
dim_t n_elem, n_elem_max; \
|
||||
dim_t n_elem_max; \
|
||||
inc_t ldx, incx; \
|
||||
dim_t j, i; \
|
||||
dim_t ij0, n_shift; \
|
||||
\
|
||||
/* Set various loop parameters. */ \
|
||||
@@ -317,59 +315,62 @@ void PASTEMAC(ch,opname) \
|
||||
/* Handle dense and upper/lower storage cases separately. */ \
|
||||
if ( bli_is_dense( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype* x1 = x + (j )*ldx + (0 )*incx; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjalpha, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjalpha, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if ( bli_is_upper( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
const dim_t n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
\
|
||||
x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
ctype* x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjalpha, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjalpha, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else if ( bli_is_lower( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
n_elem = n_elem_max - i; \
|
||||
const dim_t offi = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
const dim_t n_elem = n_elem_max - offi; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (ij0+i )*incx; \
|
||||
ctype* x1 = x + (j )*ldx + (ij0+offi )*incx; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjalpha, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjalpha, \
|
||||
n_elem, \
|
||||
alpha, \
|
||||
x1, incx, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
@@ -399,15 +400,12 @@ void PASTEMAC(ch,opname) \
|
||||
{ \
|
||||
const num_t dt = PASTEMAC(ch,type); \
|
||||
\
|
||||
ctype* x1; \
|
||||
ctype* y1; \
|
||||
uplo_t uplox_eff; \
|
||||
conj_t conjx; \
|
||||
dim_t n_iter; \
|
||||
dim_t n_elem, n_elem_max; \
|
||||
dim_t n_elem_max; \
|
||||
inc_t ldx, incx; \
|
||||
inc_t ldy, incy; \
|
||||
dim_t j, i; \
|
||||
dim_t ij0, n_shift; \
|
||||
\
|
||||
/* Set various loop parameters. */ \
|
||||
@@ -430,65 +428,68 @@ void PASTEMAC(ch,opname) \
|
||||
/* Handle dense and upper/lower storage cases separately. */ \
|
||||
if ( bli_is_dense( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
y1 = y + (j )*ldy + (0 )*incy; \
|
||||
ctype* x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
beta, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
beta, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if ( bli_is_upper( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
const dim_t n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
\
|
||||
x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
y1 = y + (ij0+j )*ldy + (0 )*incy; \
|
||||
ctype* x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (ij0+j )*ldy + (0 )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
beta, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
beta, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
else if ( bli_is_lower( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
i = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
n_elem = n_elem_max - i; \
|
||||
const dim_t offi = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
const dim_t n_elem = n_elem_max - offi; \
|
||||
\
|
||||
x1 = x + (j )*ldx + (ij0+i )*incx; \
|
||||
y1 = y + (j )*ldy + (ij0+i )*incy; \
|
||||
ctype* x1 = x + (j )*ldx + (ij0+offi )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (ij0+offi )*incy; \
|
||||
\
|
||||
/* Invoke the kernel with the appropriate parameters. */ \
|
||||
f( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
beta, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
f \
|
||||
( \
|
||||
conjx, \
|
||||
n_elem, \
|
||||
x1, incx, \
|
||||
beta, \
|
||||
y1, incy, \
|
||||
cntx \
|
||||
); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
@@ -515,15 +516,12 @@ void PASTEMAC2(chx,chy,opname) \
|
||||
rntm_t* rntm \
|
||||
) \
|
||||
{ \
|
||||
ctype_x* restrict x1; \
|
||||
ctype_y* restrict y1; \
|
||||
uplo_t uplox_eff; \
|
||||
dim_t n_iter; \
|
||||
dim_t n_elem, n_elem_max; \
|
||||
inc_t ldx, incx; \
|
||||
inc_t ldy, incy; \
|
||||
dim_t j, i; \
|
||||
dim_t ij0, n_shift; \
|
||||
uplo_t uplox_eff; \
|
||||
dim_t n_iter; \
|
||||
dim_t n_elem_max; \
|
||||
inc_t ldx, incx; \
|
||||
inc_t ldy, incy; \
|
||||
dim_t ij0, n_shift; \
|
||||
\
|
||||
/* Set various loop parameters. */ \
|
||||
bli_set_dims_incs_uplo_2m \
|
||||
@@ -542,35 +540,32 @@ void PASTEMAC2(chx,chy,opname) \
|
||||
{ \
|
||||
if ( incx == 1 && incy == 1 ) \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
y1 = y + (j )*ldy + (0 )*incy; \
|
||||
ctype_x* restrict x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype_y* restrict y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
ctype_x* restrict chi1 = x1; \
|
||||
ctype_y* restrict psi1 = y1; \
|
||||
\
|
||||
for ( i = 0; i < n_elem; ++i ) \
|
||||
for ( dim_t i = 0; i < n_elem; ++i ) \
|
||||
{ \
|
||||
PASTEMAC2(chx,chy,adds)( chi1[i], psi1[i] ); \
|
||||
PASTEMAC2(chx,chy,adds)( x1[i], y1[i] ); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
y1 = y + (j )*ldy + (0 )*incy; \
|
||||
ctype_x* restrict x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype_y* restrict y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
ctype_x* restrict chi1 = x1; \
|
||||
ctype_y* restrict psi1 = y1; \
|
||||
\
|
||||
for ( i = 0; i < n_elem; ++i ) \
|
||||
for ( dim_t i = 0; i < n_elem; ++i ) \
|
||||
{ \
|
||||
PASTEMAC2(chx,chy,adds)( *chi1, *psi1 ); \
|
||||
\
|
||||
@@ -584,35 +579,32 @@ void PASTEMAC2(chx,chy,opname) \
|
||||
{ \
|
||||
if ( incx == 1 && incy == 1 ) \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
y1 = y + (j )*ldy + (0 )*incy; \
|
||||
ctype_x* restrict x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype_y* restrict y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
ctype_x* restrict chi1 = x1; \
|
||||
ctype_y* restrict psi1 = y1; \
|
||||
\
|
||||
for ( i = 0; i < n_elem; ++i ) \
|
||||
for ( dim_t i = 0; i < n_elem; ++i ) \
|
||||
{ \
|
||||
PASTEMAC3(chx,chy,chy,xpbys)( chi1[i], *beta, psi1[i] ); \
|
||||
PASTEMAC3(chx,chy,chy,xpbys)( x1[i], *beta, y1[i] ); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
n_elem = n_elem_max; \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
for ( j = 0; j < n_iter; ++j ) \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
x1 = x + (j )*ldx + (0 )*incx; \
|
||||
y1 = y + (j )*ldy + (0 )*incy; \
|
||||
ctype_x* restrict x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype_y* restrict y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
ctype_x* restrict chi1 = x1; \
|
||||
ctype_y* restrict psi1 = y1; \
|
||||
\
|
||||
for ( i = 0; i < n_elem; ++i ) \
|
||||
for ( dim_t i = 0; i < n_elem; ++i ) \
|
||||
{ \
|
||||
PASTEMAC3(chx,chy,chy,xpbys)( *chi1, *beta, *psi1 ); \
|
||||
\
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
bool bli_obj_equals( obj_t* a, obj_t* b )
|
||||
{
|
||||
#if 0
|
||||
bool r_val = FALSE;
|
||||
num_t dt_a;
|
||||
num_t dt_b;
|
||||
@@ -80,6 +81,18 @@ bool bli_obj_equals( obj_t* a, obj_t* b )
|
||||
}
|
||||
|
||||
return r_val;
|
||||
#else
|
||||
bool r_val;
|
||||
|
||||
if ( bli_obj_is_1x1( a ) && bli_obj_is_1x1( b ) )
|
||||
bli_eqsc( a, b, &r_val );
|
||||
else if ( bli_obj_is_vector( a ) && bli_obj_is_vector( b ) )
|
||||
bli_eqv( a, b, &r_val );
|
||||
else
|
||||
bli_eqm( a, b, &r_val );
|
||||
|
||||
return r_val;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool bli_obj_imag_equals( obj_t* a, obj_t* b )
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
// This file defines macros used to allow the _oapi.c files to produce
|
||||
// object APIs that omit expert parameters.
|
||||
|
||||
// Define a macro so that the source code can determine which interface
|
||||
// (basic or expert) we are compiling.
|
||||
#undef BLIS_OAPI_EXPERT
|
||||
#undef BLIS_OAPI_BASIC
|
||||
#define BLIS_OAPI_BASIC
|
||||
|
||||
// Define the macro to remove the function name suffix (in function
|
||||
// definitions).
|
||||
#undef EX_SUF
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
// This file defines macros used to allow the _oapi.c files to produce
|
||||
// object APIs that contain context parameters.
|
||||
|
||||
// Define a macro so that the source code can determine which interface
|
||||
// (basic or expert) we are compiling.
|
||||
#undef BLIS_OAPI_BASIC
|
||||
#undef BLIS_OAPI_EXPERT
|
||||
#define BLIS_OAPI_EXPERT
|
||||
|
||||
// Define the macro to add a suffix to the object API function names
|
||||
// (in function definitions).
|
||||
#undef EX_SUF
|
||||
|
||||
@@ -261,6 +261,12 @@ BLIS_INLINE trans_t bli_trans_toggled_conj( trans_t trans )
|
||||
( trans ^ BLIS_CONJ_BIT );
|
||||
}
|
||||
|
||||
BLIS_INLINE trans_t bli_apply_trans( trans_t transapp, trans_t trans )
|
||||
{
|
||||
return ( trans_t )
|
||||
( trans ^ transapp );
|
||||
}
|
||||
|
||||
BLIS_INLINE void bli_toggle_trans( trans_t* trans )
|
||||
{
|
||||
*trans = bli_trans_toggled( *trans );
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
// This file defines macros used to allow the _tapi.c files to produce
|
||||
// typed APIs that omit expert parameters.
|
||||
|
||||
// Define a macro so that the source code can determine which interface
|
||||
// (basic or expert) we are compiling.
|
||||
#undef BLIS_TAPI_EXPERT
|
||||
#undef BLIS_TAPI_BASIC
|
||||
#define BLIS_TAPI_BASIC
|
||||
|
||||
// Define the macro to remove the function name suffix (in function
|
||||
// definitions).
|
||||
#undef EX_SUF
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
// This file defines macros used to allow the _tapi.c files to produce
|
||||
// typed APIs that contain context parameters.
|
||||
|
||||
// Define a macro so that the source code can determine which interface
|
||||
// (basic or expert) we are compiling.
|
||||
#undef BLIS_TAPI_BASIC
|
||||
#undef BLIS_TAPI_EXPERT
|
||||
#define BLIS_TAPI_EXPERT
|
||||
|
||||
// Define the macro to add a suffix to the typed API function names
|
||||
// (in function definitions).
|
||||
#undef EX_SUF
|
||||
|
||||
@@ -103,25 +103,6 @@ GENFRONT( normfm )
|
||||
GENFRONT( normim )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_utilm_fprint_check( file, s1, x, format, s2 ); \
|
||||
}
|
||||
|
||||
GENFRONT( fprintv )
|
||||
GENFRONT( fprintm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
@@ -154,6 +135,73 @@ void PASTEMAC(opname,_check) \
|
||||
|
||||
GENFRONT( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
obj_t* chi, \
|
||||
obj_t* psi, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_l0_xxbsc_check( chi, psi, is_eq ); \
|
||||
}
|
||||
|
||||
GENFRONT( eqsc )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
obj_t* x, \
|
||||
obj_t* y, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_l1v_xy_check( x, y ); \
|
||||
}
|
||||
|
||||
GENFRONT( eqv )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
obj_t* x, \
|
||||
obj_t* y, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_l1m_xy_check( x, y ); \
|
||||
}
|
||||
|
||||
GENFRONT( eqm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_utilm_fprint_check( file, s1, x, format, s2 ); \
|
||||
}
|
||||
|
||||
GENFRONT( fprintv )
|
||||
GENFRONT( fprintm )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -90,22 +90,6 @@ GENPROT( normfm )
|
||||
GENPROT( normim )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
GENPROT( fprintv )
|
||||
GENPROT( fprintm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
@@ -132,6 +116,49 @@ void PASTEMAC(opname,_check) \
|
||||
|
||||
GENPROT( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
obj_t* chi, \
|
||||
obj_t* psi, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
GENTPROT( eqsc )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
obj_t* x, \
|
||||
obj_t* y, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
GENPROT( eqv )
|
||||
GENPROT( eqm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,_check) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
GENPROT( fprintv )
|
||||
GENPROT( fprintm )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -66,6 +66,9 @@ GENFRONT( randm )
|
||||
GENFRONT( randnm )
|
||||
GENFRONT( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Operations with only basic interfaces.
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
@@ -83,6 +86,9 @@ PASTEMAC(opname,_qfp)( num_t dt ) \
|
||||
return PASTECH(opname,_fpa)[ dt ]; \
|
||||
}
|
||||
|
||||
GENFRONT( eqsc )
|
||||
GENFRONT( eqv )
|
||||
GENFRONT( eqm )
|
||||
GENFRONT( fprintv )
|
||||
GENFRONT( fprintm )
|
||||
//GENFRONT( printv )
|
||||
|
||||
@@ -52,16 +52,13 @@ GENPROT( normiv )
|
||||
GENPROT( norm1m )
|
||||
GENPROT( normfm )
|
||||
GENPROT( normim )
|
||||
GENPROT( fprintv )
|
||||
GENPROT( fprintm )
|
||||
//GENPROT( printv )
|
||||
//GENPROT( printm )
|
||||
GENPROT( randv )
|
||||
GENPROT( randnv )
|
||||
GENPROT( randm )
|
||||
GENPROT( randnm )
|
||||
GENPROT( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
@@ -69,6 +66,9 @@ GENPROT( sumsqv )
|
||||
PASTECH(opname,_vft) \
|
||||
PASTEMAC(opname,_qfp)( num_t dt );
|
||||
|
||||
GENPROT( eqsc )
|
||||
GENPROT( eqv )
|
||||
GENPROT( eqm )
|
||||
GENPROT( fprintv )
|
||||
GENPROT( fprintm )
|
||||
//GENPROT( printv )
|
||||
|
||||
@@ -191,3 +191,62 @@ typedef void (*PASTECH3(ch,opname,EX_SUF,tsuf)) \
|
||||
|
||||
INSERT_GENTDEFR( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Operations with only basic interfaces.
|
||||
|
||||
#ifdef BLIS_OAPI_BASIC
|
||||
|
||||
// eqsc
|
||||
|
||||
#undef GENTDEF
|
||||
#define GENTDEF( ctype, ch, opname, tsuf ) \
|
||||
\
|
||||
typedef void (*PASTECH2(ch,opname,tsuf)) \
|
||||
( \
|
||||
conj_t conjchi, \
|
||||
ctype* chi, \
|
||||
ctype* psi, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
INSERT_GENTDEF( eqsc )
|
||||
|
||||
// eqv
|
||||
|
||||
#undef GENTDEF
|
||||
#define GENTDEF( ctype, ch, opname, tsuf ) \
|
||||
\
|
||||
typedef void (*PASTECH2(ch,opname,tsuf)) \
|
||||
( \
|
||||
conj_t conjx, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
ctype* y, inc_t incy, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
INSERT_GENTDEF( eqv )
|
||||
|
||||
// eqm
|
||||
|
||||
#undef GENTDEF
|
||||
#define GENTDEF( ctype, ch, opname, tsuf ) \
|
||||
\
|
||||
typedef void (*PASTECH2(ch,opname,tsuf)) \
|
||||
( \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
trans_t transx, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
ctype* y, inc_t rs_y, inc_t cs_y, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
INSERT_GENTDEF( eqm )
|
||||
|
||||
#endif // #ifdef BLIS_OAPI_BASIC
|
||||
|
||||
|
||||
@@ -72,11 +72,11 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
buf_asum, \
|
||||
cntx, \
|
||||
rntm \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
buf_asum, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -114,11 +114,11 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
uploa, \
|
||||
m, \
|
||||
buf_a, rs_a, cs_a, \
|
||||
cntx, \
|
||||
rntm \
|
||||
uploa, \
|
||||
m, \
|
||||
buf_a, rs_a, cs_a, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -158,11 +158,11 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
buf_norm, \
|
||||
cntx, \
|
||||
rntm \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
buf_norm, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -207,15 +207,15 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_norm, \
|
||||
cntx, \
|
||||
rntm \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_norm, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -224,160 +224,6 @@ GENFRONT( normfm )
|
||||
GENFRONT( normim )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,EX_SUF) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
BLIS_OAPI_EX_PARAMS \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_EX_DECLS \
|
||||
\
|
||||
num_t dt = bli_obj_dt( x ); \
|
||||
\
|
||||
dim_t n = bli_obj_vector_dim( x ); \
|
||||
void* buf_x = bli_obj_buffer_at_off( x ); \
|
||||
inc_t incx = bli_obj_vector_inc( x ); \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( file, s1, x, format, s2 ); \
|
||||
\
|
||||
/* Handle constants up front. */ \
|
||||
if ( dt == BLIS_CONSTANT ) \
|
||||
{ \
|
||||
bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); \
|
||||
} \
|
||||
\
|
||||
/* Query a type-specific function pointer, except one that uses
|
||||
void* for function arguments instead of typed pointers. */ \
|
||||
PASTECH(opname,_vft) f = \
|
||||
PASTEMAC(opname,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
file, \
|
||||
s1, \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( fprintv )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC(opname,EX_SUF) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
BLIS_OAPI_EX_PARAMS \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_EX_DECLS \
|
||||
\
|
||||
num_t dt = bli_obj_dt( x ); \
|
||||
\
|
||||
dim_t m = bli_obj_length( x ); \
|
||||
dim_t n = bli_obj_width( x ); \
|
||||
void* buf_x = bli_obj_buffer_at_off( x ); \
|
||||
inc_t rs_x = bli_obj_row_stride( x ); \
|
||||
inc_t cs_x = bli_obj_col_stride( x ); \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( file, s1, x, format, s2 ); \
|
||||
\
|
||||
/* Handle constants up front. */ \
|
||||
if ( dt == BLIS_CONSTANT ) \
|
||||
{ \
|
||||
float* sp = bli_obj_buffer_for_const( BLIS_FLOAT, x ); \
|
||||
double* dp = bli_obj_buffer_for_const( BLIS_DOUBLE, x ); \
|
||||
scomplex* cp = bli_obj_buffer_for_const( BLIS_SCOMPLEX, x ); \
|
||||
dcomplex* zp = bli_obj_buffer_for_const( BLIS_DCOMPLEX, x ); \
|
||||
gint_t* ip = bli_obj_buffer_for_const( BLIS_INT, x ); \
|
||||
\
|
||||
fprintf( file, "%s\n", s1 ); \
|
||||
fprintf( file, " float: %9.2e\n", bli_sreal( *sp ) ); \
|
||||
fprintf( file, " double: %9.2e\n", bli_dreal( *dp ) ); \
|
||||
fprintf( file, " scomplex: %9.2e + %9.2e\n", bli_creal( *cp ), \
|
||||
bli_cimag( *cp ) ); \
|
||||
fprintf( file, " dcomplex: %9.2e + %9.2e\n", bli_zreal( *zp ), \
|
||||
bli_zimag( *zp ) ); \
|
||||
fprintf( file, " int: %ld\n", ( long )(*ip) ); \
|
||||
fprintf( file, "\n" ); \
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
/* Query a type-specific function pointer, except one that uses
|
||||
void* for function arguments instead of typed pointers. */ \
|
||||
PASTECH(opname,_vft) f = \
|
||||
PASTEMAC(opname,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
file, \
|
||||
s1, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( fprintm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname, varname ) \
|
||||
\
|
||||
void PASTEMAC(opname,EX_SUF) \
|
||||
( \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
BLIS_OAPI_EX_PARAMS \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
BLIS_OAPI_EX_DECLS \
|
||||
\
|
||||
/* Suppress compiler warning about unused variables. */ \
|
||||
( void )cntx; \
|
||||
\
|
||||
/* Invoke the typed function. */ \
|
||||
PASTEMAC0(varname) \
|
||||
( \
|
||||
stdout, \
|
||||
s1, \
|
||||
x, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( printv, fprintv )
|
||||
GENFRONT( printm, fprintm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
@@ -407,10 +253,10 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
cntx, \
|
||||
rntm \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -451,13 +297,13 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
diagoffx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
cntx, \
|
||||
rntm \
|
||||
diagoffx, \
|
||||
uplox, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
@@ -498,17 +344,330 @@ void PASTEMAC(opname,EX_SUF) \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
buf_scale, \
|
||||
buf_sumsq, \
|
||||
cntx, \
|
||||
rntm \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
buf_scale, \
|
||||
buf_sumsq, \
|
||||
cntx, \
|
||||
rntm \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Operations with only basic interfaces.
|
||||
|
||||
#ifdef BLIS_OAPI_BASIC
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* chi, \
|
||||
obj_t* psi, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt_chi = bli_obj_dt( chi ); \
|
||||
num_t dt_psi = bli_obj_dt( psi ); \
|
||||
num_t dt; \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( chi, psi, is_eq ); \
|
||||
\
|
||||
/* Decide which datatype will be used to query the buffer from the
|
||||
constant object (if there is one). */ \
|
||||
if ( bli_is_constant( dt_psi ) ) dt = dt_chi; \
|
||||
else dt = dt_psi; \
|
||||
\
|
||||
/* If chi and psi are both constants, then we compare only the dcomplex
|
||||
fields. */ \
|
||||
if ( bli_is_constant( dt ) ) dt = BLIS_DCOMPLEX; \
|
||||
\
|
||||
void* buf_chi = bli_obj_buffer_for_1x1( dt, chi ); \
|
||||
void* buf_psi = bli_obj_buffer_for_1x1( dt, psi ); \
|
||||
\
|
||||
/* Integer objects are handled separately. */ \
|
||||
if ( bli_is_int( dt ) ) \
|
||||
{ \
|
||||
*is_eq = bli_ieqa( buf_chi, buf_psi ); \
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
/* Query the conj status of each object and use the two to come up with a
|
||||
single "net" conj_t value. */ \
|
||||
conj_t conjchi = bli_obj_conj_status( chi ); \
|
||||
conj_t conjpsi = bli_obj_conj_status( psi ); \
|
||||
conj_t conj = bli_apply_conj( conjchi, conjpsi ); \
|
||||
\
|
||||
/* Query a type-specific function pointer, except one that uses
|
||||
void* for function arguments instead of typed pointers. */ \
|
||||
PASTECH(opname,_vft) f = \
|
||||
PASTEMAC(opname,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
conj, \
|
||||
buf_chi, \
|
||||
buf_psi, \
|
||||
is_eq \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( eqsc )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* x, \
|
||||
obj_t* y, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_dt( x ); \
|
||||
\
|
||||
dim_t n = bli_obj_vector_dim( x ); \
|
||||
void* buf_x = bli_obj_buffer_at_off( x ); \
|
||||
inc_t inc_x = bli_obj_vector_inc( x ); \
|
||||
void* buf_y = bli_obj_buffer_at_off( y ); \
|
||||
inc_t inc_y = bli_obj_vector_inc( y ); \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( x, y, is_eq ); \
|
||||
\
|
||||
/* Query the conj status of each object and use the two to come up with a
|
||||
single "net" conj_t value. */ \
|
||||
conj_t conjx = bli_obj_conj_status( x ); \
|
||||
conj_t conjy = bli_obj_conj_status( y ); \
|
||||
conj_t conj = bli_apply_conj( conjx, conjy ); \
|
||||
\
|
||||
/* Query a type-specific function pointer, except one that uses
|
||||
void* for function arguments instead of typed pointers. */ \
|
||||
PASTECH(opname,_vft) f = \
|
||||
PASTEMAC(opname,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
conj, \
|
||||
n, \
|
||||
buf_x, inc_x, \
|
||||
buf_y, inc_y, \
|
||||
is_eq \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( eqv )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* x, \
|
||||
obj_t* y, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_dt( x ); \
|
||||
\
|
||||
doff_t diagoffx = bli_obj_diag_offset( x ); \
|
||||
diag_t diagx = bli_obj_diag( x ); \
|
||||
uplo_t uplox = bli_obj_uplo( x ); \
|
||||
dim_t m = bli_obj_length( y ); \
|
||||
dim_t n = bli_obj_width( y ); \
|
||||
void* buf_x = bli_obj_buffer_at_off( x ); \
|
||||
inc_t rs_x = bli_obj_row_stride( x ); \
|
||||
inc_t cs_x = bli_obj_col_stride( x ); \
|
||||
void* buf_y = bli_obj_buffer_at_off( y ); \
|
||||
inc_t rs_y = bli_obj_row_stride( y ); \
|
||||
inc_t cs_y = bli_obj_col_stride( y ); \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( x, y, is_eq ); \
|
||||
\
|
||||
/* Query the combined trans and conj status of each object and use the two
|
||||
to come up with a single "net" trans_t value. */ \
|
||||
trans_t transx = bli_obj_conjtrans_status( x ); \
|
||||
trans_t transy = bli_obj_conjtrans_status( y ); \
|
||||
trans_t trans = bli_apply_trans( transy, transx ); \
|
||||
\
|
||||
/* Query a type-specific function pointer, except one that uses
|
||||
void* for function arguments instead of typed pointers. */ \
|
||||
PASTECH(opname,_vft) f = \
|
||||
PASTEMAC(opname,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
trans, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
buf_y, rs_y, cs_y, \
|
||||
is_eq \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( eqm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_dt( x ); \
|
||||
\
|
||||
dim_t n = bli_obj_vector_dim( x ); \
|
||||
void* buf_x = bli_obj_buffer_at_off( x ); \
|
||||
inc_t incx = bli_obj_vector_inc( x ); \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( file, s1, x, format, s2 ); \
|
||||
\
|
||||
/* Handle constants up front. */ \
|
||||
if ( dt == BLIS_CONSTANT ) \
|
||||
{ \
|
||||
bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); \
|
||||
} \
|
||||
\
|
||||
/* Query a type-specific function pointer, except one that uses
|
||||
void* for function arguments instead of typed pointers. */ \
|
||||
PASTECH(opname,_vft) f = \
|
||||
PASTEMAC(opname,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
file, \
|
||||
s1, \
|
||||
n, \
|
||||
buf_x, incx, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( fprintv )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
num_t dt = bli_obj_dt( x ); \
|
||||
\
|
||||
dim_t m = bli_obj_length( x ); \
|
||||
dim_t n = bli_obj_width( x ); \
|
||||
void* buf_x = bli_obj_buffer_at_off( x ); \
|
||||
inc_t rs_x = bli_obj_row_stride( x ); \
|
||||
inc_t cs_x = bli_obj_col_stride( x ); \
|
||||
\
|
||||
if ( bli_error_checking_is_enabled() ) \
|
||||
PASTEMAC(opname,_check)( file, s1, x, format, s2 ); \
|
||||
\
|
||||
/* Handle constants up front. */ \
|
||||
if ( dt == BLIS_CONSTANT ) \
|
||||
{ \
|
||||
float* sp = bli_obj_buffer_for_const( BLIS_FLOAT, x ); \
|
||||
double* dp = bli_obj_buffer_for_const( BLIS_DOUBLE, x ); \
|
||||
scomplex* cp = bli_obj_buffer_for_const( BLIS_SCOMPLEX, x ); \
|
||||
dcomplex* zp = bli_obj_buffer_for_const( BLIS_DCOMPLEX, x ); \
|
||||
gint_t* ip = bli_obj_buffer_for_const( BLIS_INT, x ); \
|
||||
\
|
||||
fprintf( file, "%s\n", s1 ); \
|
||||
fprintf( file, " float: %9.2e\n", bli_sreal( *sp ) ); \
|
||||
fprintf( file, " double: %9.2e\n", bli_dreal( *dp ) ); \
|
||||
fprintf( file, " scomplex: %9.2e + %9.2e\n", bli_creal( *cp ), \
|
||||
bli_cimag( *cp ) ); \
|
||||
fprintf( file, " dcomplex: %9.2e + %9.2e\n", bli_zreal( *zp ), \
|
||||
bli_zimag( *zp ) ); \
|
||||
fprintf( file, " int: %ld\n", ( long )(*ip) ); \
|
||||
fprintf( file, "\n" ); \
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
/* Query a type-specific function pointer, except one that uses
|
||||
void* for function arguments instead of typed pointers. */ \
|
||||
PASTECH(opname,_vft) f = \
|
||||
PASTEMAC(opname,_qfp)( dt ); \
|
||||
\
|
||||
f \
|
||||
( \
|
||||
file, \
|
||||
s1, \
|
||||
m, \
|
||||
n, \
|
||||
buf_x, rs_x, cs_x, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( fprintm )
|
||||
|
||||
|
||||
#undef GENFRONT
|
||||
#define GENFRONT( opname, varname ) \
|
||||
\
|
||||
void PASTEMAC0(opname) \
|
||||
( \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* Invoke the typed function. */ \
|
||||
PASTEMAC0(varname) \
|
||||
( \
|
||||
stdout, \
|
||||
s1, \
|
||||
x, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
GENFRONT( printv, fprintv )
|
||||
GENFRONT( printm, fprintm )
|
||||
|
||||
#endif // #ifdef BLIS_OAPI_BASIC
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -94,39 +94,6 @@ GENPROT( normfm )
|
||||
GENPROT( normim )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(opname,EX_SUF) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
BLIS_OAPI_EX_PARAMS \
|
||||
);
|
||||
|
||||
GENPROT( fprintv )
|
||||
GENPROT( fprintm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(opname,EX_SUF) \
|
||||
( \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
BLIS_OAPI_EX_PARAMS \
|
||||
);
|
||||
|
||||
GENPROT( printv )
|
||||
GENPROT( printm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
@@ -166,3 +133,84 @@ BLIS_EXPORT_BLIS void PASTEMAC(opname,EX_SUF) \
|
||||
|
||||
GENPROT( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Operations with basic interfaces only.
|
||||
|
||||
#ifdef BLIS_OAPI_BASIC
|
||||
|
||||
/*
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* chi, \
|
||||
obj_t* psi, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
GENPROT( eqsc )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* x, \
|
||||
obj_t* y, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
GENPROT( eqv )
|
||||
*/
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC0(opname) \
|
||||
( \
|
||||
obj_t* x, \
|
||||
obj_t* y, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
GENPROT( eqsc )
|
||||
GENPROT( eqv )
|
||||
GENPROT( eqm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC0(opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
GENPROT( fprintv )
|
||||
GENPROT( fprintm )
|
||||
|
||||
|
||||
#undef GENPROT
|
||||
#define GENPROT( opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC0(opname) \
|
||||
( \
|
||||
char* s1, \
|
||||
obj_t* x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
GENPROT( printv )
|
||||
GENPROT( printm )
|
||||
|
||||
#endif // #ifdef BLIS_OAPI_BASIC
|
||||
|
||||
|
||||
@@ -213,64 +213,6 @@ INSERT_GENTFUNCR_BASIC0( normfm )
|
||||
INSERT_GENTFUNCR_BASIC0( normim )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname, varname ) \
|
||||
\
|
||||
void PASTEMAC2(ch,opname,EX_SUF) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
void* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC(ch,varname) \
|
||||
( \
|
||||
stdout, \
|
||||
s1, \
|
||||
n, \
|
||||
x, incx, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC_I( printv, fprintv )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname, varname ) \
|
||||
\
|
||||
void PASTEMAC2(ch,opname,EX_SUF) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
void* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC(ch,varname) \
|
||||
( \
|
||||
stdout, \
|
||||
s1, \
|
||||
m, \
|
||||
n, \
|
||||
x, rs_x, cs_x, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC_I( printm, fprintm )
|
||||
|
||||
|
||||
#undef GENTFUNCR
|
||||
#define GENTFUNCR( ctype, ctype_r, ch, chr, opname ) \
|
||||
\
|
||||
@@ -430,6 +372,168 @@ void PASTEMAC2(ch,opname,EX_SUF) \
|
||||
|
||||
INSERT_GENTFUNCR_BASIC0( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Operations with only basic interfaces.
|
||||
|
||||
#ifdef BLIS_TAPI_BASIC
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
conj_t conjchi, \
|
||||
ctype* chi, \
|
||||
ctype* psi, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
ctype chi_conj; \
|
||||
\
|
||||
PASTEMAC(ch,copycjs)( conjchi, *chi, chi_conj ); \
|
||||
\
|
||||
*is_eq = PASTEMAC(ch,eq)( chi_conj, *psi ); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( eqsc )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
conj_t conjx, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
ctype* y, inc_t incy, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* If x is zero length, return with a result of TRUE. */ \
|
||||
if ( bli_zero_dim1( n ) ) { *is_eq = TRUE; return; } \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
/*if ( cntx == NULL ) cntx = bli_gks_query_cntx();*/ \
|
||||
\
|
||||
*is_eq = PASTEMAC2(ch,opname,_unb_var1) \
|
||||
( \
|
||||
conjx, \
|
||||
n, \
|
||||
x, incx, \
|
||||
y, incy \
|
||||
); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( eqv )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
trans_t transx, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
ctype* y, inc_t rs_y, inc_t cs_y, \
|
||||
bool* is_eq \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
/* If x has a zero dimension, return with a result of TRUE. See the
|
||||
_unb_var() variant for why we return TRUE in this scenario. */ \
|
||||
if ( bli_zero_dim2( m, n ) ) { *is_eq = TRUE; return; } \
|
||||
\
|
||||
/* Obtain a valid context from the gks if necessary. */ \
|
||||
/*if ( cntx == NULL ) cntx = bli_gks_query_cntx();*/ \
|
||||
\
|
||||
/* Invoke the helper variant. */ \
|
||||
*is_eq = PASTEMAC2(ch,opname,_unb_var1) \
|
||||
( \
|
||||
diagoffx, \
|
||||
diagx, \
|
||||
uplox, \
|
||||
transx, \
|
||||
m, \
|
||||
n, \
|
||||
x, rs_x, cs_x, \
|
||||
y, rs_y, cs_y \
|
||||
); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( eqm )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname, varname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
void* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC(ch,varname) \
|
||||
( \
|
||||
stdout, \
|
||||
s1, \
|
||||
n, \
|
||||
x, incx, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC_I( printv, fprintv )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname, varname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
void* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
bli_init_once(); \
|
||||
\
|
||||
PASTEMAC(ch,varname) \
|
||||
( \
|
||||
stdout, \
|
||||
s1, \
|
||||
m, \
|
||||
n, \
|
||||
x, rs_x, cs_x, \
|
||||
format, \
|
||||
s2 \
|
||||
); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC_I( printm, fprintm )
|
||||
|
||||
#endif // #ifdef BLIS_TAPI_BASIC
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -103,37 +103,6 @@ INSERT_GENTPROTR_BASIC0( normfm )
|
||||
INSERT_GENTPROTR_BASIC0( normim )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC2(ch,opname,EX_SUF) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
void* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( printv )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC2(ch,opname,EX_SUF) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
void* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( printm )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
@@ -179,4 +148,89 @@ BLIS_EXPORT_BLIS void PASTEMAC2(ch,opname,EX_SUF) \
|
||||
|
||||
INSERT_GENTPROTR_BASIC0( sumsqv )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Operations with basic interfaces only.
|
||||
|
||||
#ifdef BLIS_TAPI_BASIC
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
conj_t conjchi, \
|
||||
ctype* chi, \
|
||||
ctype* psi, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0( eqsc )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
conj_t conjx, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
ctype* y, inc_t incy, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0( eqv )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
trans_t transx, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
ctype* y, inc_t rs_y, inc_t cs_y, \
|
||||
bool* is_eq \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0( eqm )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
void* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( printv )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
void* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( printm )
|
||||
|
||||
#endif // #ifdef BLIS_TAPI_BASIC
|
||||
|
||||
|
||||
@@ -862,85 +862,6 @@ void PASTEMAC(ch,varname) \
|
||||
INSERT_GENTFUNCR_BASIC( normim_unb_var1, norm1m_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
dim_t i; \
|
||||
ctype* chi1; \
|
||||
char default_spec[32] = PASTEMAC(ch,formatspec)(); \
|
||||
\
|
||||
if ( format == NULL ) format = default_spec; \
|
||||
\
|
||||
chi1 = x; \
|
||||
\
|
||||
fprintf( file, "%s\n", s1 ); \
|
||||
\
|
||||
for ( i = 0; i < n; ++i ) \
|
||||
{ \
|
||||
PASTEMAC(ch,fprints)( file, format, *chi1 ); \
|
||||
fprintf( file, "\n" ); \
|
||||
\
|
||||
chi1 += incx; \
|
||||
} \
|
||||
\
|
||||
fprintf( file, "%s\n", s2 ); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0_I( fprintv )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
dim_t i, j; \
|
||||
ctype* chi1; \
|
||||
char default_spec[32] = PASTEMAC(ch,formatspec)(); \
|
||||
\
|
||||
if ( format == NULL ) format = default_spec; \
|
||||
\
|
||||
fprintf( file, "%s\n", s1 ); \
|
||||
\
|
||||
for ( i = 0; i < m; ++i ) \
|
||||
{ \
|
||||
for ( j = 0; j < n; ++j ) \
|
||||
{ \
|
||||
chi1 = (( ctype* ) x) + i*rs_x + j*cs_x; \
|
||||
\
|
||||
PASTEMAC(ch,fprints)( file, format, *chi1 ); \
|
||||
fprintf( file, " " ); \
|
||||
} \
|
||||
\
|
||||
fprintf( file, "\n" ); \
|
||||
} \
|
||||
\
|
||||
fprintf( file, "%s\n", s2 ); \
|
||||
fflush( file ); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0_I( fprintm )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, varname, randmac ) \
|
||||
\
|
||||
@@ -1215,3 +1136,238 @@ void PASTEMAC(ch,varname) \
|
||||
|
||||
INSERT_GENTFUNCR_BASIC0( sumsqv_unb_var1 )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
bool PASTEMAC(ch,opname) \
|
||||
( \
|
||||
conj_t conjx, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
ctype* y, inc_t incy \
|
||||
) \
|
||||
{ \
|
||||
for ( dim_t i = 0; i < n; ++i ) \
|
||||
{ \
|
||||
ctype* chi1 = x + (i )*incx; \
|
||||
ctype* psi1 = y + (i )*incy; \
|
||||
\
|
||||
ctype chi1c; \
|
||||
\
|
||||
if ( bli_is_conj( conjx ) ) { PASTEMAC(ch,copyjs)( *chi1, chi1c ); } \
|
||||
else { PASTEMAC(ch,copys)( *chi1, chi1c ); } \
|
||||
\
|
||||
if ( !PASTEMAC(ch,eq)( chi1c, *psi1 ) ) \
|
||||
return FALSE; \
|
||||
} \
|
||||
\
|
||||
return TRUE; \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( eqv_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
bool PASTEMAC(ch,opname) \
|
||||
( \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
trans_t transx, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
ctype* y, inc_t rs_y, inc_t cs_y \
|
||||
) \
|
||||
{ \
|
||||
uplo_t uplox_eff; \
|
||||
conj_t conjx; \
|
||||
dim_t n_iter; \
|
||||
dim_t n_elem_max; \
|
||||
inc_t ldx, incx; \
|
||||
inc_t ldy, incy; \
|
||||
dim_t ij0, n_shift; \
|
||||
\
|
||||
/* Set various loop parameters. */ \
|
||||
bli_set_dims_incs_uplo_2m \
|
||||
( \
|
||||
diagoffx, diagx, transx, \
|
||||
uplox, m, n, rs_x, cs_x, rs_y, cs_y, \
|
||||
&uplox_eff, &n_elem_max, &n_iter, &incx, &ldx, &incy, &ldy, \
|
||||
&ij0, &n_shift \
|
||||
); \
|
||||
\
|
||||
/* In the odd case where we are comparing against a complete unstored
|
||||
matrix, we assert equality. Why? We assume the matrices are equal
|
||||
unless we can find two corresponding elements that are unequal. So
|
||||
if there are no elements, there is no inequality. Granted, this logic
|
||||
is strange to think about no matter what, and thankfully it should
|
||||
never be used under normal usage. */ \
|
||||
if ( bli_is_zeros( uplox_eff ) ) return TRUE; \
|
||||
\
|
||||
/* Extract the conjugation component from the transx parameter. */ \
|
||||
conjx = bli_extract_conj( transx ); \
|
||||
\
|
||||
/* Handle dense and upper/lower storage cases separately. */ \
|
||||
if ( bli_is_dense( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
const dim_t n_elem = n_elem_max; \
|
||||
\
|
||||
ctype* x1 = x + (j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (0 )*incy; \
|
||||
\
|
||||
for ( dim_t i = 0; i < n_elem; ++i ) \
|
||||
{ \
|
||||
ctype* x11 = x1 + (i )*incx; \
|
||||
ctype* y11 = y1 + (i )*incy; \
|
||||
ctype x11c; \
|
||||
\
|
||||
if ( bli_is_conj( conjx ) ) { PASTEMAC(ch,copyjs)( *x11, x11c ); } \
|
||||
else { PASTEMAC(ch,copys)( *x11, x11c ); } \
|
||||
\
|
||||
if ( !PASTEMAC(ch,eq)( x11c, *y11 ) ) \
|
||||
return FALSE; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if ( bli_is_upper( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
const dim_t n_elem = bli_min( n_shift + j + 1, n_elem_max ); \
|
||||
\
|
||||
ctype* x1 = x + (ij0+j )*ldx + (0 )*incx; \
|
||||
ctype* y1 = y + (ij0+j )*ldy + (0 )*incy; \
|
||||
\
|
||||
for ( dim_t i = 0; i < n_elem; ++i ) \
|
||||
{ \
|
||||
ctype* x11 = x1 + (i )*incx; \
|
||||
ctype* y11 = y1 + (i )*incy; \
|
||||
ctype x11c; \
|
||||
\
|
||||
if ( bli_is_conj( conjx ) ) { PASTEMAC(ch,copyjs)( *x11, x11c ); } \
|
||||
else { PASTEMAC(ch,copys)( *x11, x11c ); } \
|
||||
\
|
||||
if ( !PASTEMAC(ch,eq)( x11c, *y11 ) ) \
|
||||
return FALSE; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
else if ( bli_is_lower( uplox_eff ) ) \
|
||||
{ \
|
||||
for ( dim_t j = 0; j < n_iter; ++j ) \
|
||||
{ \
|
||||
const dim_t offi = bli_max( 0, ( doff_t )j - ( doff_t )n_shift ); \
|
||||
const dim_t n_elem = n_elem_max - offi; \
|
||||
\
|
||||
ctype* x1 = x + (j )*ldx + (ij0+offi )*incx; \
|
||||
ctype* y1 = y + (j )*ldy + (ij0+offi )*incy; \
|
||||
\
|
||||
for ( dim_t i = 0; i < n_elem; ++i ) \
|
||||
{ \
|
||||
ctype* x11 = x1 + (i )*incx; \
|
||||
ctype* y11 = y1 + (i )*incy; \
|
||||
ctype x11c; \
|
||||
\
|
||||
if ( bli_is_conj( conjx ) ) { PASTEMAC(ch,copyjs)( *x11, x11c ); } \
|
||||
else { PASTEMAC(ch,copys)( *x11, x11c ); } \
|
||||
\
|
||||
if ( !PASTEMAC(ch,eq)( x11c, *y11 ) ) \
|
||||
return FALSE; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
return TRUE; \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0( eqm_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
dim_t i; \
|
||||
ctype* chi1; \
|
||||
char default_spec[32] = PASTEMAC(ch,formatspec)(); \
|
||||
\
|
||||
if ( format == NULL ) format = default_spec; \
|
||||
\
|
||||
chi1 = x; \
|
||||
\
|
||||
fprintf( file, "%s\n", s1 ); \
|
||||
\
|
||||
for ( i = 0; i < n; ++i ) \
|
||||
{ \
|
||||
PASTEMAC(ch,fprints)( file, format, *chi1 ); \
|
||||
fprintf( file, "\n" ); \
|
||||
\
|
||||
chi1 += incx; \
|
||||
} \
|
||||
\
|
||||
fprintf( file, "%s\n", s2 ); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0_I( fprintv )
|
||||
|
||||
|
||||
#undef GENTFUNC
|
||||
#define GENTFUNC( ctype, ch, opname ) \
|
||||
\
|
||||
void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
) \
|
||||
{ \
|
||||
dim_t i, j; \
|
||||
ctype* chi1; \
|
||||
char default_spec[32] = PASTEMAC(ch,formatspec)(); \
|
||||
\
|
||||
if ( format == NULL ) format = default_spec; \
|
||||
\
|
||||
fprintf( file, "%s\n", s1 ); \
|
||||
\
|
||||
for ( i = 0; i < m; ++i ) \
|
||||
{ \
|
||||
for ( j = 0; j < n; ++j ) \
|
||||
{ \
|
||||
chi1 = (( ctype* ) x) + i*rs_x + j*cs_x; \
|
||||
\
|
||||
PASTEMAC(ch,fprints)( file, format, *chi1 ); \
|
||||
fprintf( file, " " ); \
|
||||
} \
|
||||
\
|
||||
fprintf( file, "\n" ); \
|
||||
} \
|
||||
\
|
||||
fprintf( file, "%s\n", s2 ); \
|
||||
fflush( file ); \
|
||||
}
|
||||
|
||||
INSERT_GENTFUNC_BASIC0_I( fprintm )
|
||||
|
||||
|
||||
@@ -107,39 +107,6 @@ INSERT_GENTPROTR_BASIC0( normfm_unb_var1 )
|
||||
INSERT_GENTPROTR_BASIC0( normim_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( fprintv )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( fprintm )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, varname ) \
|
||||
\
|
||||
@@ -188,3 +155,70 @@ void PASTEMAC(ch,varname) \
|
||||
|
||||
INSERT_GENTPROTR_BASIC0( sumsqv_unb_var1 )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, varname ) \
|
||||
\
|
||||
bool PASTEMAC(ch,varname) \
|
||||
( \
|
||||
conj_t conjx, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
ctype* y, inc_t incy \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0( eqv_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, varname ) \
|
||||
\
|
||||
bool PASTEMAC(ch,varname) \
|
||||
( \
|
||||
doff_t diagoffx, \
|
||||
diag_t diagx, \
|
||||
uplo_t uplox, \
|
||||
trans_t transx, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
ctype* y, inc_t rs_y, inc_t cs_y \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0( eqm_unb_var1 )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t incx, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( fprintv )
|
||||
|
||||
|
||||
#undef GENTPROT
|
||||
#define GENTPROT( ctype, ch, opname ) \
|
||||
\
|
||||
BLIS_EXPORT_BLIS void PASTEMAC(ch,opname) \
|
||||
( \
|
||||
FILE* file, \
|
||||
char* s1, \
|
||||
dim_t m, \
|
||||
dim_t n, \
|
||||
ctype* x, inc_t rs_x, inc_t cs_x, \
|
||||
char* format, \
|
||||
char* s2 \
|
||||
);
|
||||
|
||||
INSERT_GENTPROT_BASIC0_I( fprintm )
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user