|
| 1 | +/* |
| 2 | +
|
| 3 | + BLIS |
| 4 | + An object-based framework for developing high-performance BLAS-like |
| 5 | + libraries. |
| 6 | +
|
| 7 | + Copyright (C) 2014, The University of Texas at Austin |
| 8 | +
|
| 9 | + Redistribution and use in source and binary forms, with or without |
| 10 | + modification, are permitted provided that the following conditions are |
| 11 | + met: |
| 12 | + - Redistributions of source code must retain the above copyright |
| 13 | + notice, this list of conditions and the following disclaimer. |
| 14 | + - Redistributions in binary form must reproduce the above copyright |
| 15 | + notice, this list of conditions and the following disclaimer in the |
| 16 | + documentation and/or other materials provided with the distribution. |
| 17 | + - Neither the name(s) of the copyright holder(s) nor the names of its |
| 18 | + contributors may be used to endorse or promote products derived |
| 19 | + from this software without specific prior written permission. |
| 20 | +
|
| 21 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 | + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 24 | + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 25 | + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 26 | + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 27 | + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 28 | + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 29 | + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 | + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 31 | + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | +
|
| 33 | +*/ |
| 34 | + |
| 35 | +#include "blis.h" |
| 36 | + |
| 37 | +#undef GENTFUNC2RO |
| 38 | +#define GENTFUNC2RO( ctypec_r, ctype_c, ctypep_r, ctypep, chc_r, chc, chp_r, chp, varname ) \ |
| 39 | +GENTFUNC2RO_( ctypec_r, ctypec_r, ctypep_r, ctypep_r, chc_r, chc_r, chp_r, chp_r, varname ) \ |
| 40 | +GENTFUNC2RO_( ctypec_r, ctypec, ctypep_r, ctypep, chc_r, chc, chp_r, chp, varname ) |
| 41 | + |
| 42 | +#undef GENTFUNC2RO_ |
| 43 | +#define GENTFUNC2RO_( ctypec_r, ctype_c, ctypep_r, ctypep, chc_r, chc, chp_r, chp, varname ) \ |
| 44 | +\ |
| 45 | +void PASTEMAC(chc,chp,varname) \ |
| 46 | + ( \ |
| 47 | + struc_t strucc, \ |
| 48 | + diag_t diagc, \ |
| 49 | + uplo_t uploc, \ |
| 50 | + conj_t conjc, \ |
| 51 | + pack_t schema, \ |
| 52 | + bool invdiag, \ |
| 53 | + dim_t panel_dim, \ |
| 54 | + dim_t panel_len, \ |
| 55 | + dim_t panel_dim_max, \ |
| 56 | + dim_t panel_len_max, \ |
| 57 | + dim_t panel_dim_off, \ |
| 58 | + dim_t panel_len_off, \ |
| 59 | + dim_t panel_bcast, \ |
| 60 | + const void* kappa, \ |
| 61 | + const void* c, inc_t incc, inc_t ldc, \ |
| 62 | + void* p, inc_t ldp, \ |
| 63 | + const void* params_, \ |
| 64 | + const cntx_t* cntx \ |
| 65 | + ) \ |
| 66 | +{ \ |
| 67 | + num_t dt_c = PASTEMAC(chc,type); \ |
| 68 | + num_t dt_p = PASTEMAC(chp,type); \ |
| 69 | + dim_t dt_c_size = bli_dt_size( dt_c ); \ |
| 70 | +\ |
| 71 | + ukr_t cxk_ker_id = BLIS_PACKMD_KER; \ |
| 72 | +\ |
| 73 | + packmd_cxk_ker_ft f_cxk = bli_cntx_get_ukr2_dt( dt_c, dt_p, cxk_ker_id, cntx ); \ |
| 74 | +\ |
| 75 | + const gemmd_params* params = ( const gemmd_params* )params_; \ |
| 76 | +\ |
| 77 | + inc_t incd = params->incd; \ |
| 78 | + const char* d = ( const char* )params->d + panel_len_off*incd*dt_c_size; \ |
| 79 | +\ |
| 80 | + /* For general matrices, pack and return early */ \ |
| 81 | + if ( bli_is_general( strucc ) ) \ |
| 82 | + { \ |
| 83 | + f_cxk \ |
| 84 | + ( \ |
| 85 | + conjc, \ |
| 86 | + schema, \ |
| 87 | + panel_dim, \ |
| 88 | + panel_dim_max, \ |
| 89 | + panel_bcast, \ |
| 90 | + panel_len, \ |
| 91 | + panel_len_max, \ |
| 92 | + kappa, \ |
| 93 | + c, incc, ldc, \ |
| 94 | + d, incd, \ |
| 95 | + p, ldp, \ |
| 96 | + params, \ |
| 97 | + cntx \ |
| 98 | + ); \ |
| 99 | + return; \ |
| 100 | + } \ |
| 101 | +\ |
| 102 | + bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); \ |
| 103 | +} |
| 104 | + |
| 105 | +INSERT_GENTFUNC2RO( packmd_struc_cxk ) |
| 106 | +INSERT_GENTFUNC2RO_MIX_P( packmd_struc_cxk ) |
| 107 | + |
0 commit comments