|
@@ -48,46 +48,10 @@ static void parse_args(int argc, char **argv)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- * same number of rows. */
|
|
|
-static void csr_filter_func(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts)
|
|
|
-{
|
|
|
- (void)f;
|
|
|
- struct starpu_csr_interface *csr_father = (struct starpu_csr_interface *) father_interface;
|
|
|
- struct starpu_csr_interface *csr_child = (struct starpu_csr_interface *) child_interface;
|
|
|
-
|
|
|
- uint32_t nrow = csr_father->nrow;
|
|
|
- size_t elemsize = csr_father->elemsize;
|
|
|
- uint32_t firstentry = csr_father->firstentry;
|
|
|
-
|
|
|
-
|
|
|
- uint32_t chunk_size = (nrow + nparts - 1)/nparts;
|
|
|
- uint32_t *rowptr = csr_father->rowptr;
|
|
|
-
|
|
|
- uint32_t first_index = id*chunk_size - firstentry;
|
|
|
- uint32_t local_firstentry = rowptr[first_index];
|
|
|
-
|
|
|
- uint32_t child_nrow = STARPU_MIN(chunk_size, nrow - id*chunk_size);
|
|
|
- uint32_t local_nnz = rowptr[first_index + child_nrow] - rowptr[first_index];
|
|
|
-
|
|
|
- csr_child->id = csr_father->id;
|
|
|
- csr_child->nnz = local_nnz;
|
|
|
- csr_child->nrow = child_nrow;
|
|
|
- csr_child->firstentry = local_firstentry;
|
|
|
- csr_child->elemsize = elemsize;
|
|
|
-
|
|
|
- if (csr_father->nzval)
|
|
|
- {
|
|
|
- csr_child->rowptr = &csr_father->rowptr[first_index];
|
|
|
- csr_child->colind = &csr_father->colind[local_firstentry];
|
|
|
- csr_child->nzval = csr_father->nzval + local_firstentry * elemsize;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
static struct starpu_data_filter csr_f =
|
|
|
{
|
|
|
- .filter_func = csr_filter_func,
|
|
|
+ .filter_func = starpu_csr_filter_vertical_block,
|
|
|
|
|
|
.nchildren = -1,
|
|
|
|