| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
#include "blis.h" |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
void bli_trsm_blk_var1 |
| 41 |
( |
| 42 |
const obj_t* a, |
| 43 |
const obj_t* b, |
| 44 |
const obj_t* c, |
| 45 |
const cntx_t* cntx, |
| 46 |
const cntl_t* cntl, |
| 47 |
thrinfo_t* thread_par |
| 48 |
) |
| 49 |
{ |
| 50 |
obj_t ap, cp; |
| 51 |
bli_obj_alias_to( a, &ap ); |
| 52 |
bli_obj_alias_to( c, &cp ); |
| 53 |
|
| 54 |
|
| 55 |
const dir_t direct = bli_part_cntl_direct( cntl ); |
| 56 |
|
| 57 |
|
| 58 |
bli_l3_prune_unref_mparts_m( &ap, b, &cp ); |
| 59 |
|
| 60 |
|
| 61 |
const dim_t kc = bli_obj_width_after_trans( &ap ); |
| 62 |
obj_t a11, c1; |
| 63 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1, |
| 64 |
0, kc, &ap, &a11 ); |
| 65 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1, |
| 66 |
0, kc, &cp, &c1 ); |
| 67 |
|
| 68 |
|
| 69 |
thrinfo_t* thread_pre = bli_thrinfo_sub_node( 0, thread_par ); |
| 70 |
dim_t my_start = 0, my_end = kc; |
| 71 |
|
| 72 |
#ifdef PRINT |
| 73 |
printf( "bli_trsm_blk_var1(): a11 is %d x %d at offsets (%3d, %3d)\n", |
| 74 |
(int)bli_obj_length( &a11 ), (int)bli_obj_width( &a11 ), |
| 75 |
(int)bli_obj_row_off( &a11 ), (int)bli_obj_col_off( &a11 ) ); |
| 76 |
printf( "bli_trsm_blk_var1(): entering trsm subproblem loop.\n" ); |
| 77 |
#endif |
| 78 |
|
| 79 |
|
| 80 |
dim_t b_alg; |
| 81 |
for ( dim_t i = my_start; i < my_end; i += b_alg ) |
| 82 |
{ |
| 83 |
b_alg = bli_determine_blocksize( direct, i, my_end, |
| 84 |
bli_part_cntl_blksz_alg( cntl ), |
| 85 |
bli_part_cntl_blksz_max( cntl ) ); |
| 86 |
|
| 87 |
|
| 88 |
obj_t a11_1, c1_1; |
| 89 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1, |
| 90 |
i, b_alg, &a11, &a11_1 ); |
| 91 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1, |
| 92 |
i, b_alg, &c1, &c1_1 ); |
| 93 |
|
| 94 |
#ifdef PRINT |
| 95 |
printf( "bli_trsm_blk_var1(): a11_1 is %d x %d at offsets (%3d, %3d)\n", |
| 96 |
(int)bli_obj_length( &a11_1 ), (int)bli_obj_width( &a11_1 ), |
| 97 |
(int)bli_obj_row_off( &a11_1 ), (int)bli_obj_col_off( &a11_1 ) ); |
| 98 |
#endif |
| 99 |
|
| 100 |
|
| 101 |
bli_l3_int |
| 102 |
( |
| 103 |
&a11_1, |
| 104 |
b, |
| 105 |
&c1_1, |
| 106 |
cntx, |
| 107 |
bli_cntl_sub_node( 0, cntl ), |
| 108 |
thread_pre |
| 109 |
); |
| 110 |
} |
| 111 |
|
| 112 |
#ifdef PRINT |
| 113 |
printf( "bli_trsm_blk_var1(): finishing trsm subproblem loop.\n" ); |
| 114 |
#endif |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
bli_thrinfo_barrier( thread_par ); |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
obj_t ax1, cx1; |
| 125 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1A, |
| 126 |
0, kc, &ap, &ax1 ); |
| 127 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1A, |
| 128 |
0, kc, &cp, &cx1 ); |
| 129 |
|
| 130 |
#ifdef PRINT |
| 131 |
printf( "bli_trsm_blk_var1(): ax1 is %d x %d at offsets (%3d, %3d)\n", |
| 132 |
(int)bli_obj_length( &ax1 ), (int)bli_obj_width( &ax1 ), |
| 133 |
(int)bli_obj_row_off( &ax1 ), (int)bli_obj_col_off( &ax1 ) ); |
| 134 |
#endif |
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
thrinfo_t* thread = bli_thrinfo_sub_node( 1, thread_par ); |
| 139 |
bli_thread_range_mdim |
| 140 |
( |
| 141 |
direct, |
| 142 |
bli_part_cntl_blksz_mult( cntl ), |
| 143 |
bli_part_cntl_use_weighted( cntl ), |
| 144 |
thread, &ax1, b, &cx1, |
| 145 |
&my_start, &my_end |
| 146 |
); |
| 147 |
|
| 148 |
#ifdef PRINT |
| 149 |
printf( "bli_trsm_blk_var1(): entering gemm subproblem loop (%d->%d).\n", (int)my_start, (int)my_end ); |
| 150 |
#endif |
| 151 |
|
| 152 |
|
| 153 |
for ( dim_t i = my_start; i < my_end; i += b_alg ) |
| 154 |
{ |
| 155 |
|
| 156 |
b_alg = bli_determine_blocksize( direct, i, my_end, |
| 157 |
bli_part_cntl_blksz_alg( cntl ), |
| 158 |
bli_part_cntl_blksz_max( cntl ) ); |
| 159 |
|
| 160 |
|
| 161 |
obj_t a11, c1; |
| 162 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1, |
| 163 |
i, b_alg, &ax1, &a11 ); |
| 164 |
bli_acquire_mpart_mdim( direct, BLIS_SUBPART1, |
| 165 |
i, b_alg, &cx1, &c1 ); |
| 166 |
|
| 167 |
#ifdef PRINT |
| 168 |
printf( "bli_trsm_blk_var1(): a11 is %d x %d at offsets (%3d, %3d)\n", |
| 169 |
(int)bli_obj_length( &a11 ), (int)bli_obj_width( &a11 ), |
| 170 |
(int)bli_obj_row_off( &a11 ), (int)bli_obj_col_off( &a11 ) ); |
| 171 |
#endif |
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
bli_l3_int |
| 176 |
( |
| 177 |
&a11, |
| 178 |
b, |
| 179 |
&c1, |
| 180 |
cntx, |
| 181 |
bli_cntl_sub_node( 1, cntl ), |
| 182 |
thread |
| 183 |
); |
| 184 |
} |
| 185 |
#ifdef PRINT |
| 186 |
printf( "bli_trsm_blk_var1(): finishing gemm subproblem loop.\n" ); |
| 187 |
#endif |
| 188 |
} |
| 189 |
|