diff --git a/compute/map.c b/compute/map.c index cef41364590a7a7f4c295cf4a4686556c6212676..1fcb883812652baa91f61db61c20542eaa6d199a 100644 --- a/compute/map.c +++ b/compute/map.c @@ -27,7 +27,16 @@ * ******************************************************************************* * - * @param[in,out] uplo + * @param[in] access + * - ChamR: A is accessed in read-only mode. + * - ChamW: A is accessed in write-only mode. + * WARNING: if the descriptor is set for allocation on the fly, the + * flush call included in this synchronous API will free all allocated + * data, prefer asynchronous call if you want to initialiaze data + * before submitting another algorithm. + * - ChamRW: A is accessed in read-write mode. + * + * @param[in] uplo * - ChamUpper: Only the upper triangular part of the matrix is touched * - ChamLower: Only the lower triangular part of the matrix is touched * - ChamUpperLower: The entire the matrix is touched @@ -51,7 +60,8 @@ * @sa CHAMELEON_map_Tile_Async * */ -int CHAMELEON_map_Tile( cham_uplo_t uplo, +int CHAMELEON_map_Tile( cham_access_t access, + cham_uplo_t uplo, CHAM_desc_t *A, cham_unary_operator_t op_fct, void *op_args ) @@ -68,7 +78,7 @@ int CHAMELEON_map_Tile( cham_uplo_t uplo, } chameleon_sequence_create( chamctxt, &sequence ); - CHAMELEON_map_Tile_Async( uplo, A, op_fct, op_args, sequence, &request ); + CHAMELEON_map_Tile_Async( access, uplo, A, op_fct, op_args, sequence, &request ); CHAMELEON_Desc_Flush( A, sequence ); @@ -89,6 +99,13 @@ int CHAMELEON_map_Tile( cham_uplo_t uplo, * ******************************************************************************* * + * @param[in] access + * - ChamR: A is accessed in read-only mode. + * - ChamW: A is accessed in write-only mode. + * INFO: tile of A can be unallocated before the call if the + * descriptor is set for allocation on the fly. + * - ChamRW: A is accessed in read-write mode. + * * @param[in] sequence * Identifies the sequence of function calls that this call belongs to * (for completion checks and exception handling purposes). @@ -105,7 +122,8 @@ int CHAMELEON_map_Tile( cham_uplo_t uplo, * @sa CHAMELEON_map_Tile * */ -int CHAMELEON_map_Tile_Async( cham_uplo_t uplo, +int CHAMELEON_map_Tile_Async( cham_access_t access, + cham_uplo_t uplo, CHAM_desc_t *A, cham_unary_operator_t op_fct, void *op_args, @@ -146,7 +164,7 @@ int CHAMELEON_map_Tile_Async( cham_uplo_t uplo, return CHAMELEON_SUCCESS; } - chameleon_pmap( uplo, A, op_fct, op_args, sequence, request ); + chameleon_pmap( access, uplo, A, op_fct, op_args, sequence, request ); return CHAMELEON_SUCCESS; } diff --git a/compute/pmap.c b/compute/pmap.c index deb087d28a00d694b38397d52e9533d807ce43d1..a2ddf33a4da40d5e8c42f3a10e91c99a5a0d75ec 100644 --- a/compute/pmap.c +++ b/compute/pmap.c @@ -20,7 +20,7 @@ /** * chameleon_pmap - Generate a random matrix by tiles. */ -void chameleon_pmap( cham_uplo_t uplo, CHAM_desc_t *A, +void chameleon_pmap( cham_access_t access, cham_uplo_t uplo, CHAM_desc_t *A, cham_unary_operator_t op_fct, void *op_args, RUNTIME_sequence_t *sequence, RUNTIME_request_t *request ) { @@ -39,12 +39,12 @@ void chameleon_pmap( cham_uplo_t uplo, CHAM_desc_t *A, for (m = 0; m < n; m++) { INSERT_TASK_map( &options, - ChamRW, ChamUpperLower, A(m, n), + access, ChamUpperLower, A(m, n), op_fct, op_args ); } INSERT_TASK_map( &options, - ChamRW, uplo, A(n, n), + access, uplo, A(n, n), op_fct, op_args ); } break; @@ -53,12 +53,12 @@ void chameleon_pmap( cham_uplo_t uplo, CHAM_desc_t *A, for (n = 0; n < A->nt; n++) { INSERT_TASK_map( &options, - ChamRW, uplo, A(n, n), + access, uplo, A(n, n), op_fct, op_args ); for (m = n+1; m < A->mt; m++) { INSERT_TASK_map( &options, - ChamRW, ChamUpperLower, A(m, n), + access, ChamUpperLower, A(m, n), op_fct, op_args ); } } @@ -70,7 +70,7 @@ void chameleon_pmap( cham_uplo_t uplo, CHAM_desc_t *A, for (n = 0; n < A->nt; n++) { INSERT_TASK_map( &options, - ChamRW, uplo, A(m, n), + access, uplo, A(m, n), op_fct, op_args ); } } diff --git a/compute/zprint.c b/compute/zprint.c index fe44e05d4026610e716744b722447b2e8b9dadd1..2329d1a9bbfe25b286f29857e0cfea41b9254b62 100644 --- a/compute/zprint.c +++ b/compute/zprint.c @@ -152,7 +152,7 @@ int CHAMELEON_zprint( FILE *file, const char *header, /* Call the tile interface */ zprint_runtime_id = chamctxt->scheduler; - chameleon_pmap( uplo, &descAt, zprint, &options, sequence, &request ); + chameleon_pmap( ChamR, uplo, &descAt, zprint, &options, sequence, &request ); /* Submit the matrix conversion back */ chameleon_ztile2lap( chamctxt, &descAl, &descAt, @@ -216,7 +216,7 @@ int CHAMELEON_zprint_Tile( FILE *file, const char *header, chameleon_sequence_create( chamctxt, &sequence ); zprint_runtime_id = chamctxt->scheduler; - chameleon_pmap( uplo, A, zprint, &options, sequence, &request ); + chameleon_pmap( ChamR, uplo, A, zprint, &options, sequence, &request ); CHAMELEON_Desc_Flush( A, sequence ); chameleon_sequence_wait( chamctxt, sequence ); diff --git a/control/common.h b/control/common.h index f31ec1af3bf5f0fd5af475e2630d1cd9c575bcd2..c260ff60f21fcb83e18a318948bf0e73f8be08d3 100644 --- a/control/common.h +++ b/control/common.h @@ -102,7 +102,7 @@ extern char *chameleon_lapack_constants[]; extern "C" { #endif -void chameleon_pmap( cham_uplo_t uplo, CHAM_desc_t *A, +void chameleon_pmap( cham_access_t access, cham_uplo_t uplo, CHAM_desc_t *A, cham_unary_operator_t operator, void *op_args, RUNTIME_sequence_t *sequence, RUNTIME_request_t *request ); diff --git a/include/chameleon.h b/include/chameleon.h index 8c3669af397ac25e53bdbd55c33feced0947a48e..56c8160181889fac334b0e4be79c2c55c4e158aa 100644 --- a/include/chameleon.h +++ b/include/chameleon.h @@ -74,11 +74,13 @@ BEGIN_C_DECLS /* **************************************************************************** * CHAMELEON functionnalities */ -int CHAMELEON_map_Tile( cham_uplo_t uplo, +int CHAMELEON_map_Tile( cham_access_t access, + cham_uplo_t uplo, CHAM_desc_t *A, cham_unary_operator_t op_fct, void *op_args ); -int CHAMELEON_map_Tile_Async( cham_uplo_t uplo, +int CHAMELEON_map_Tile_Async( cham_access_t access, + cham_uplo_t uplo, CHAM_desc_t *A, cham_unary_operator_t op_fct, void *op_args, diff --git a/testing/test_fembem b/testing/test_fembem index 906d73c7abb0821e8df787f05fab2d503a2e76ff..a0056374bf0163ba878d842cbc81999fece362b4 160000 --- a/testing/test_fembem +++ b/testing/test_fembem @@ -1 +1 @@ -Subproject commit 906d73c7abb0821e8df787f05fab2d503a2e76ff +Subproject commit a0056374bf0163ba878d842cbc81999fece362b4