libflame  revision_anchor
Functions
FLA_Copy_blk_var2.c File Reference

(r)

Functions

FLA_Error FLA_Copy_blk_var2 (FLA_Obj A, FLA_Obj B, fla_copy_t *cntl)
 

Function Documentation

◆ FLA_Copy_blk_var2()

FLA_Error FLA_Copy_blk_var2 ( FLA_Obj  A,
FLA_Obj  B,
fla_copy_t cntl 
)

References FLA_Cont_with_3x1_to_2x1(), FLA_Copy_internal(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_2x1(), and FLA_Repart_2x1_to_3x1().

Referenced by FLA_Copy_internal().

14 {
15  FLA_Obj AT, A0,
16  AB, A1,
17  A2;
18 
19  FLA_Obj BT, B0,
20  BB, B1,
21  B2;
22 
23  dim_t b;
24 
25  FLA_Part_2x1( A, &AT,
26  &AB, 0, FLA_BOTTOM );
27 
28  FLA_Part_2x1( B, &BT,
29  &BB, 0, FLA_BOTTOM );
30 
31  while ( FLA_Obj_length( AB ) < FLA_Obj_length( A ) ){
32 
33  b = FLA_Determine_blocksize( AT, FLA_TOP, FLA_Cntl_blocksize( cntl ) );
34 
35  FLA_Repart_2x1_to_3x1( AT, &A0,
36  &A1,
37  /* ** */ /* ** */
38  AB, &A2, b, FLA_TOP );
39 
40  FLA_Repart_2x1_to_3x1( BT, &B0,
41  &B1,
42  /* ** */ /* ** */
43  BB, &B2, b, FLA_TOP );
44 
45  /*------------------------------------------------------------*/
46 
47  FLA_Copy_internal( A1, B1,
48  FLA_Cntl_sub_copy( cntl ) );
49 
50  /*------------------------------------------------------------*/
51 
52  FLA_Cont_with_3x1_to_2x1( &AT, A0,
53  /* ** */ /* ** */
54  A1,
55  &AB, A2, FLA_BOTTOM );
56 
57  FLA_Cont_with_3x1_to_2x1( &BT, B0,
58  /* ** */ /* ** */
59  B1,
60  &BB, B2, FLA_BOTTOM );
61  }
62 
63  return FLA_SUCCESS;
64 }
FLA_Error FLA_Repart_2x1_to_3x1(FLA_Obj AT, FLA_Obj *A0, FLA_Obj *A1, FLA_Obj AB, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:226
FLA_Error FLA_Copy_internal(FLA_Obj A, FLA_Obj B, fla_copy_t *cntl)
Definition: FLA_Copy_internal.c:16
unsigned long dim_t
Definition: FLA_type_defs.h:71
dim_t FLA_Determine_blocksize(FLA_Obj A_unproc, FLA_Quadrant to_dir, fla_blocksize_t *cntl_blocksizes)
Definition: FLA_Blocksize.c:234
FLA_Error FLA_Cont_with_3x1_to_2x1(FLA_Obj *AT, FLA_Obj A0, FLA_Obj A1, FLA_Obj *AB, FLA_Obj A2, FLA_Side side)
Definition: FLA_View.c:428
Definition: FLA_type_defs.h:158
FLA_Error FLA_Part_2x1(FLA_Obj A, FLA_Obj *A1, FLA_Obj *A2, dim_t mb, FLA_Side side)
Definition: FLA_View.c:76
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116