libflame  revision_anchor
Functions
FLA_CAQR_UT_inc_compute_p_length.c File Reference

(r)

Functions

dim_t FLA_CAQR_UT_inc_compute_blocks_per_part (dim_t p, FLA_Obj A)
 

Function Documentation

◆ FLA_CAQR_UT_inc_compute_blocks_per_part()

dim_t FLA_CAQR_UT_inc_compute_blocks_per_part ( dim_t  p,
FLA_Obj  A 
)
14 {
15  dim_t nb_part;
16  dim_t nb_left;
17  dim_t num_blocks;
18 
19  // Query the element (not scalar) length of A.
20  num_blocks = FLA_Obj_length( A );
21 
22  // Compute the number of blocks per partitions.
23  nb_part = num_blocks / p;
24  nb_left = num_blocks % p;
25 
26  // If there are leftover blocks, increase nb_part by one.
27  if ( nb_left > 0 ) nb_part += 1;
28 
29  return nb_part;
30 }
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
unsigned long dim_t
Definition: FLA_type_defs.h:71

References FLA_Obj_length().

Referenced by FLASH_Apply_CAQ_UT_inc(), FLASH_CAQR_UT_inc_create_hier_matrices(), and FLASH_CAQR_UT_inc_noopt().