HiCMA
Hierarchical Computations on Manycore Architectures
codelet_zhagdm.c
Go to the documentation of this file.
1 
16 #include "morse.h"
17 #include "runtime/starpu/chameleon_starpu.h"
18 #include "hcore_z.h"
19 
20 #include "runtime/starpu/runtime_codelets.h"
21 ZCODELETS_HEADER(hagdm)
22 
23 
26 void HICMA_TASK_zhagdm( const MORSE_option_t *options,
27  int nrows_Dense, int ncols_Dense,
28  const MORSE_desc_t *Dense,
29  int ld_Dense,
30  int tile_row_index,
31  int tile_col_index
32  )
33 {
34  struct starpu_codelet *codelet = &cl_zhagdm;
35  void (*callback)(void*) = NULL;
36 
37  MORSE_BEGIN_ACCESS_DECLARATION;
38  MORSE_ACCESS_W(Dense, tile_row_index, tile_col_index);
39  MORSE_END_ACCESS_DECLARATION;
40  starpu_insert_task(
41  starpu_mpi_codelet(codelet),
42  STARPU_VALUE, &nrows_Dense, sizeof(int),
43  STARPU_VALUE, &ncols_Dense, sizeof(int),
44  STARPU_W, RTBLKADDR(Dense, double, tile_row_index, tile_col_index),
45  STARPU_VALUE, &ld_Dense, sizeof(int),
46  STARPU_VALUE, &tile_row_index, sizeof(int),
47  STARPU_VALUE, &tile_col_index, sizeof(int),
48  STARPU_PRIORITY, options->priority,
49  STARPU_CALLBACK, callback,
50 #if defined(CHAMELEON_CODELETS_HAVE_NAME)
51  STARPU_NAME, "hcore_zhagdm",
52 #endif
53  0);
54 }
59 #if !defined(CHAMELEON_SIMULATION)
60 static void cl_zhagdm_cpu_func(void *descr[], void *cl_arg)
61 {
62  int nrows_Dense;
63  int ncols_Dense;
64  int ld_Dense;
65  int tile_row_index;
66  int tile_col_index;
67  int maxrank;
68  double *Dense;
69 
70  Dense = (double *)STARPU_MATRIX_GET_PTR(descr[0]);
71  starpu_codelet_unpack_args(cl_arg, &nrows_Dense, &ncols_Dense, &ld_Dense, &tile_row_index, &tile_col_index);
73  nrows_Dense,
74  ncols_Dense,
75  Dense,
76  ld_Dense,
77  tile_row_index,
78  tile_col_index
79  );
80 }
81 #endif /* !defined(CHAMELEON_SIMULATION) */
82 
83 /*
84  * Codelet definition
85  */
86 CODELETS_CPU(zhagdm, 1, cl_zhagdm_cpu_func)
87 
88 ZCODELETS_HEADER(hagdmi)
93 void HICMA_TASK_zhagdmi( const MORSE_option_t *options,
94  int nrows_Dense, int ncols_Dense,
95  const MORSE_desc_t *Dense,
96  int ld_Dense,
97  int tile_row_index,
98  int tile_col_index,
99  int problem_row_index,
100  int problem_col_index
101  )
102 {
103  struct starpu_codelet *codelet = &cl_zhagdmi;
104  void (*callback)(void*) = NULL;
105 
106  MORSE_BEGIN_ACCESS_DECLARATION;
107  MORSE_ACCESS_W(Dense, tile_row_index, tile_col_index);
108  MORSE_END_ACCESS_DECLARATION;
109  starpu_insert_task(
110  starpu_mpi_codelet(codelet),
111  STARPU_VALUE, &nrows_Dense, sizeof(int),
112  STARPU_VALUE, &ncols_Dense, sizeof(int),
113  STARPU_W, RTBLKADDR(Dense, double, tile_row_index, tile_col_index),
114  STARPU_VALUE, &ld_Dense, sizeof(int),
115  STARPU_VALUE, &tile_row_index, sizeof(int),
116  STARPU_VALUE, &tile_col_index, sizeof(int),
117  STARPU_VALUE, &problem_row_index, sizeof(int),
118  STARPU_VALUE, &problem_col_index, sizeof(int),
119  STARPU_PRIORITY, options->priority,
120  STARPU_CALLBACK, callback,
121 #if defined(CHAMELEON_CODELETS_HAVE_NAME)
122  STARPU_NAME, "hcore_zhagdm",
123 #endif
124  0);
125 }
126 
131 #if !defined(CHAMELEON_SIMULATION)
132 static void cl_zhagdmi_cpu_func(void *descr[], void *cl_arg)
133 {
134  int nrows_Dense;
135  int ncols_Dense;
136  int ld_Dense;
137  int tile_row_index;
138  int tile_col_index;
139  int maxrank;
140  double *Dense;
141  int problem_row_index;
142  int problem_col_index;
143 
144  Dense = (double *)STARPU_MATRIX_GET_PTR(descr[0]);
145  starpu_codelet_unpack_args(cl_arg, &nrows_Dense, &ncols_Dense, &ld_Dense, &tile_row_index, &tile_col_index, &problem_row_index, &problem_col_index);
146  HCORE_zhagdm(
147  nrows_Dense,
148  ncols_Dense,
149  Dense,
150  ld_Dense,
151  problem_row_index,
152  problem_col_index
153  );
154 }
155 #endif /* !defined(CHAMELEON_SIMULATION) */
156 
157 /*
158  * Codelet definition
159  */
160 CODELETS_CPU(zhagdmi, 1, cl_zhagdmi_cpu_func)
void HICMA_TASK_zhagdmi(const MORSE_option_t *options, int nrows_Dense, int ncols_Dense, const MORSE_desc_t *Dense, int ld_Dense, int tile_row_index, int tile_col_index, int problem_row_index, int problem_col_index)
void HICMA_TASK_zhagdm(const MORSE_option_t *options, int nrows_Dense, int ncols_Dense, const MORSE_desc_t *Dense, int ld_Dense, int tile_row_index, int tile_col_index)
void HCORE_zhagdm(int nrows_Dense, int ncols_Dense, double *Dense, int ld_Dense, int tile_row_index, int tile_col_index)
Definition: hcore_zhagdm.c:37