1 /* kernel_io.h */
2 
3 #ifndef KERNEL_IO
4 #define KERNEL_IO
5 
6 #define KERNEL_DIMS 5
7 
8 /* inbuilt kernels */
9 extern int      n_inbuilt_kern;
10 
11 typedef enum {
12    K_NULL = 0,
13    K_2D04, K_2D08, K_3D06, K_3D26
14    } kern_types;
15 
16 /* Structure for Kernel information */
17 typedef struct {
18    int      nelems;
19    int      pre_pad[KERNEL_DIMS];
20    int      post_pad[KERNEL_DIMS];
21    VIO_Real   **K;
22    } Kernel;
23 
24 /* returns a new B_Matrix struct (pointer) */
25 Kernel  *new_kernel(int nelems);
26 
27 /* reads in a B_Matrix from a file (pointer) */
28 VIO_Status   input_kernel(const char *kernel_file, Kernel * kernel);
29 
30 /* pretty print a kernel */
31 int      print_kernel(Kernel * kernel);
32 
33 /* calculate start and step offsets for this kernel */
34 int      setup_pad_values(Kernel * kernel);
35 
36 /* return the default kernel(s) */
37 Kernel  *get_2D04_kernel(void);
38 Kernel  *get_2D08_kernel(void);
39 Kernel  *get_3D06_kernel(void);
40 Kernel  *get_3D26_kernel(void);
41 
42 #endif
43