Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 08189a2d authored by LISITO Alycia's avatar LISITO Alycia Committed by Mathieu Faverge
Browse files

driver: corrected pztile2band

parent b904e524
No related branches found
No related tags found
1 merge request!309Tile2band: Fix the lacpyx and tile2band algorithm
......@@ -21,21 +21,25 @@
*/
#include "control/common.h"
#define A(m,n) A, m, n
#define B(m, n) B, m, n
#define A(m,n) A, m, n
#define B(m,n) B, m, n
/**
* Parallel copy of a band matrix from full NxN tile storage to band storage (LDABxN).
*/
void chameleon_pztile2band(cham_uplo_t uplo, CHAM_desc_t *A, CHAM_desc_t *B,
RUNTIME_sequence_t *sequence, RUNTIME_request_t *request)
void chameleon_pztile2band( cham_uplo_t uplo, CHAM_desc_t *A, CHAM_desc_t *B,
RUNTIME_sequence_t *sequence, RUNTIME_request_t *request )
{
CHAM_context_t *chamctxt;
RUNTIME_option_t options;
CHAM_tile_t *tileA;
int j;
int tempjm, tempjn;
int k;
int tempkm, tempkn;
int minmnt = chameleon_min(A->mt, A->nt);
int Bnb = B->nb;
int Bmb = B->mb;
int Amb = A->mb;
chamctxt = chameleon_context_self();
if (sequence->status != CHAMELEON_SUCCESS) {
......@@ -43,71 +47,66 @@ void chameleon_pztile2band(cham_uplo_t uplo, CHAM_desc_t *A, CHAM_desc_t *B,
}
RUNTIME_options_init(&options, chamctxt, sequence, request);
/* The code is actually incorrect due to the removal of the ld (Need new insert_task dedicated) */
assert( 0 );
/*
* ChamLower => Lower Band
*/
if ( uplo == ChamLower ) {
for (j = 0; j < minmnt; j++){
/* Compute dimension on N with B since it is dimensioned with chameleon_min(A->m, A->n) */
assert( A->m == B->n );
assert( A->n >= B->n );
tempjm = j == A->mt-1 ? A->m - j * A->mb : A->mb;
tempjn = j == B->nt-1 ? B->n - j * B->nb : B->nb;
INSERT_TASK_zlaset(
&options,
ChamUpperLower, B->mb, tempjn,
0., 0.,
B(0, j) );
INSERT_TASK_zlacpy(
&options,
ChamLower, tempjm, tempjn, A->nb,
A(j, j),
B(0, j) );
if( j<minmnt-1 ){
tempjm = (j+1) == A->mt-1 ? A->m-(j+1)*A->mb : A->mb;
INSERT_TASK_zlacpyx(
&options,
ChamUpper, tempjm, tempjn, A->nb,
0, A(j+1, j),
A->nb, B(0, j));
}
}
for (k = 0; k < minmnt; k++){
tileA = A->get_blktile( A, k, k );
/* Computes dimension on N with B since it is dimensioned with chameleon_min(A->m, A->n) */
assert( A->i == B->j );
assert( A->j >= B->j );
tempkm = ( k == A->mt-1 ) ? A->m - k * Amb : Amb;
tempkn = ( k == B->nt-1 ) ? B->n - k * Bnb : Bnb;
INSERT_TASK_zlaset( &options, ChamUpperLower, Bmb, tempkn,
0., 0., B, 0, k );
INSERT_TASK_zlacpyx( &options, ChamLower, tempkm, tempkn,
0, A, k, k, tileA->ld,
0, B, 0, k, Bmb-1 );
if ( k < minmnt-1 ) {
tileA = A->get_blktile( A, k+1, k );
tempkm = ( (k+1) == A->mt-1 ) ? A->m - (k+1) * Amb : Amb;
INSERT_TASK_zlacpyx( &options, ChamUpper, tempkm, tempkn,
0, A, k+1, k, tileA->ld,
Bmb-1, B, 0, k, Bmb-1 );
}
}
}
else if ( uplo == ChamUpper ) {
for (j = 0; j < minmnt; j++){
/* Compute dimension on M with B since it is dimensioned with chameleon_min(A->m, A->n) */
assert( A->n == B->n );
assert( A->m >= B->n );
tempjn = j == A->nt-1 ? A->n - j * A->nb : A->nb;
INSERT_TASK_zlaset(
&options,
ChamUpperLower, B->mb, tempjn,
0., 0.,
B(0, j) );
if(j > 0){
INSERT_TASK_zlacpy(
&options,
ChamLower, A->mb, tempjn, A->nb,
A(j-1, j),
B(0, j));
}
tempjm = j == B->nt-1 ? B->n - j * B->nb : B->nb;
INSERT_TASK_zlacpyx(
&options,
ChamUpper, tempjm, tempjn, A->nb,
0, A(j, j),
A->nb, B(0, j));
}
for (k = 0; k < minmnt; k++){
tileA = A->get_blktile( A, k, k );
/* Compute dimension on M with B since it is dimensioned with chameleon_min(A->m, A->n) */
assert( A->i == B->i );
assert( A->i >= B->j );
tempkm = ( k == A->mt-1 ) ? A->m - k * Amb : Amb;
tempkn = ( k == B->nt-1 ) ? B->n - k * Bnb : Bnb;
INSERT_TASK_zlaset( &options, ChamUpperLower, Bmb, tempkn,
0., 0., B, 0, k );
INSERT_TASK_zlacpyx( &options, ChamUpper, tempkm, tempkn,
0, A, k, k, tileA->ld,
Bmb-1, B, 0, k, Bmb-1 );
if ( k > 0 ) {
tileA = A->get_blktile( A, k-1, k );
tempkm = ( (k-1) == A->mt-1 ) ? A->m - (k-1) * Amb : Amb;
INSERT_TASK_zlacpyx( &options, ChamLower, tempkm, tempkn,
0, A, k-1, k, tileA->ld,
0, B, 0, k, Bmb-1 );
}
}
}
RUNTIME_options_finalize(&options, chamctxt);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment