libflame revision_anchor
FLASH_Obj_create_hierarchy_check.c File Reference

(r)

Functions

FLA_Error FLASH_Obj_create_hierarchy_check (FLA_Datatype datatype, dim_t m, dim_t n, dim_t depth, dim_t *elem_sizes_m, dim_t *elem_sizes_n, FLA_Obj flat_matrix, FLA_Obj *H, unsigned long id, dim_t depth_overall, dim_t *depth_sizes_m, dim_t *depth_sizes_n, dim_t *m_offsets, dim_t *n_offsets)
 

Function Documentation

◆ FLASH_Obj_create_hierarchy_check()

FLA_Error FLASH_Obj_create_hierarchy_check ( FLA_Datatype datatype,
dim_t m,
dim_t n,
dim_t depth,
dim_t * elem_sizes_m,
dim_t * elem_sizes_n,
FLA_Obj flat_matrix,
FLA_Obj * H,
unsigned long id,
dim_t depth_overall,
dim_t * depth_sizes_m,
dim_t * depth_sizes_n,
dim_t * m_offsets,
dim_t * n_offsets )
14{
15 FLA_Error e_val;
16
17 e_val = FLA_Check_valid_datatype( datatype );
18 FLA_Check_error_code( e_val );
19
20 e_val = FLA_Check_null_pointer( elem_sizes_m );
21 FLA_Check_error_code( e_val );
22
23 e_val = FLA_Check_null_pointer( elem_sizes_n );
24 FLA_Check_error_code( e_val );
25
26 e_val = FLA_Check_null_pointer( H );
27 FLA_Check_error_code( e_val );
28
29 e_val = FLA_Check_null_pointer( depth_sizes_m );
30 FLA_Check_error_code( e_val );
31
32 e_val = FLA_Check_null_pointer( depth_sizes_n );
33 FLA_Check_error_code( e_val );
34
35 e_val = FLA_Check_null_pointer( m_offsets );
36 FLA_Check_error_code( e_val );
37
38 e_val = FLA_Check_null_pointer( n_offsets );
39 FLA_Check_error_code( e_val );
40
41 // A value of depth < 0 should cause an error.
42
43 // Values of m < 1, n < 1 should cause an error. (or < 0?)
44
45 // First depth entries in depth_sizes_m,_n elem_sizes_m,_n m_,n_offsets should be checked; values < 1 should cause error.
46
47 return FLA_SUCCESS;
48}
FLA_Error FLA_Check_null_pointer(void *ptr)
Definition FLA_Check.c:518
FLA_Error FLA_Check_valid_datatype(FLA_Datatype datatype)
Definition FLA_Check.c:156
int FLA_Error
Definition FLA_type_defs.h:47

References FLA_Check_null_pointer(), and FLA_Check_valid_datatype().

Referenced by FLASH_Obj_create_hierarchy().