Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 006c3b3f authored by MIJIEUX Thomas's avatar MIJIEUX Thomas
Browse files

Use tempab notation for dimension variable

parent 1a7a2139
No related branches found
No related tags found
1 merge request!48Fix #30. Incorrect descriptor initialization for Lapack matrix.
...@@ -26,138 +26,135 @@ ...@@ -26,138 +26,135 @@
**/ **/
#include "control/common.h" #include "control/common.h"
#define A(m, n) dA, m, n #define A(m, n) A, m, n
#define B(m, n) &dB, m, n #define B(m, n) &B, m, n
/******************************************************************************* /*******************************************************************************
* Conversion from LAPACK F77 matrix layout to tile layout - dynamic scheduling * Conversion from LAPACK F77 matrix layout to tile layout - dynamic scheduling
**/ **/
void morse_pzlapack_to_tile(MORSE_Complex64_t *Af77, int lda, MORSE_desc_t *dA, void morse_pzlapack_to_tile(MORSE_Complex64_t *Af77, int ldaf77, MORSE_desc_t *A,
MORSE_sequence_t *sequence, MORSE_request_t *request) MORSE_sequence_t *sequence, MORSE_request_t *request)
{ {
MORSE_context_t *morse; MORSE_context_t *morse;
MORSE_option_t options; MORSE_option_t options;
MORSE_desc_t dB; MORSE_desc_t B;
int X, Y; int m, n;
int n, m, ldt; int ldam;
int tempmm, tempnn;
morse = morse_context_self(); morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS) if (sequence->status != MORSE_SUCCESS)
return; return;
RUNTIME_options_init(&options, morse, sequence, request); RUNTIME_options_init(&options, morse, sequence, request);
dB = morse_desc_init( B = morse_desc_init(
MorseComplexDouble, dA->mb, dA->nb, dA->bsiz, MorseComplexDouble, A->mb, A->nb, A->bsiz,
lda, dA->n, 0, 0, dA->m, dA->n, 1, 1); ldaf77, A->n, 0, 0, A->m, A->n, 1, 1);
dB.get_blkaddr = morse_getaddr_cm; B.get_blkaddr = morse_getaddr_cm;
dB.get_blkldd = morse_getblkldd_cm; B.get_blkldd = morse_getblkldd_cm;
dB.mat = Af77; B.mat = Af77;
dB.styp = MorseCM; B.styp = MorseCM;
RUNTIME_desc_create( &dB ); RUNTIME_desc_create( &B );
for (m = 0; m < dA->mt; m++) for (m = 0; m < A->mt; m++) {
{ tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
Y = m == dA->mt-1 ? dA->m-m*dA->mb : dA->mb; ldam = BLKLDD(A, m);
ldt = BLKLDD(dA, m); for (n = 0; n < A->nt; n++) {
for (n = 0; n < dA->nt; n++) tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
{
X = n == dA->nt-1 ? dA->n-n*dA->nb : dA->nb;
MORSE_TASK_zlacpy( MORSE_TASK_zlacpy(
&options, &options,
MorseUpperLower, MorseUpperLower,
Y, X, dA->mb, tempmm, tempnn, A->mb,
B(m, n), lda, B(m, n), ldaf77,
A(m, n), ldt); A(m, n), ldam);
} }
} }
RUNTIME_sequence_wait( morse, sequence ); RUNTIME_sequence_wait( morse, sequence );
RUNTIME_options_finalize( &options, morse ); RUNTIME_options_finalize( &options, morse );
MORSE_TASK_dataflush_all(); MORSE_TASK_dataflush_all();
RUNTIME_desc_getoncpu( &dB ); RUNTIME_desc_getoncpu( &B );
RUNTIME_desc_destroy( &dB ); RUNTIME_desc_destroy( &B );
} }
/******************************************************************************* /*******************************************************************************
* Conversion from LAPACK F77 matrix layout to tile layout - dynamic scheduling * Conversion from LAPACK F77 matrix layout to tile layout - dynamic scheduling
**/ **/
void morse_pztile_to_lapack(MORSE_desc_t *dA, MORSE_Complex64_t *Af77, int lda, void morse_pztile_to_lapack(MORSE_desc_t *A, MORSE_Complex64_t *Af77, int ldaf77,
MORSE_sequence_t *sequence, MORSE_request_t *request) MORSE_sequence_t *sequence, MORSE_request_t *request)
{ {
MORSE_context_t *morse; MORSE_context_t *morse;
MORSE_option_t options; MORSE_option_t options;
MORSE_desc_t dB; MORSE_desc_t B;
int X, Y; int m, n;
int n, m, ldt; int ldam;
int tempmm, tempnn;
morse = morse_context_self(); morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS) if (sequence->status != MORSE_SUCCESS)
return; return;
RUNTIME_options_init(&options, morse, sequence, request); RUNTIME_options_init(&options, morse, sequence, request);
dB = morse_desc_init( B = morse_desc_init(
MorseComplexDouble, dA->mb, dA->nb, dA->bsiz, MorseComplexDouble, A->mb, A->nb, A->bsiz,
lda, dA->n, 0, 0, dA->m, dA->n, 1, 1); ldaf77, A->n, 0, 0, A->m, A->n, 1, 1);
dB.get_blkaddr = morse_getaddr_cm; B.get_blkaddr = morse_getaddr_cm;
dB.get_blkldd = morse_getblkldd_cm; B.get_blkldd = morse_getblkldd_cm;
dB.mat = Af77; B.mat = Af77;
dB.styp = MorseCM; B.styp = MorseCM;
RUNTIME_desc_create( &dB ); RUNTIME_desc_create( &B );
for (m = 0; m < dA->mt; m++) for (m = 0; m < A->mt; m++) {
{ tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
Y = m == dA->mt-1 ? dA->m-m*dA->mb : dA->mb; ldam = BLKLDD(A, m);
ldt = BLKLDD(dA, m); for (n = 0; n < A->nt; n++) {
for (n = 0; n < dA->nt; n++) tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
{
X = n == dA->nt-1 ? dA->n-n*dA->nb : dA->nb;
MORSE_TASK_zlacpy( MORSE_TASK_zlacpy(
&options, &options,
MorseUpperLower, MorseUpperLower,
Y, X, dA->mb, tempmm, tempnn, A->mb,
A(m, n), ldt, A(m, n), ldam,
B(m, n), lda); B(m, n), ldaf77);
} }
} }
RUNTIME_sequence_wait( morse, sequence ); RUNTIME_sequence_wait( morse, sequence );
RUNTIME_options_finalize( &options, morse ); RUNTIME_options_finalize( &options, morse );
MORSE_TASK_dataflush_all(); MORSE_TASK_dataflush_all();
RUNTIME_desc_getoncpu( &dB ); RUNTIME_desc_getoncpu( &B );
RUNTIME_desc_destroy( &dB ); RUNTIME_desc_destroy( &B );
} }
/******************************************************************************* /*******************************************************************************
* Zeroes a submatrix in tile layout - dynamic scheduling * Zeroes a submatrix in tile layout - dynamic scheduling
**/ **/
void morse_pztile_zero(MORSE_desc_t *dA, MORSE_sequence_t *sequence, MORSE_request_t *request) void morse_pztile_zero(MORSE_desc_t *A, MORSE_sequence_t *sequence, MORSE_request_t *request)
{ {
MORSE_context_t *morse; MORSE_context_t *morse;
MORSE_option_t options; MORSE_option_t options;
int X, Y; int m, n;
int n, m, ldt; int ldam;
int tempmm, tempnn;
morse = morse_context_self(); morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS) if (sequence->status != MORSE_SUCCESS)
return; return;
RUNTIME_options_init(&options, morse, sequence, request); RUNTIME_options_init(&options, morse, sequence, request);
for (m = 0; m < dA->mt; m++) for (m = 0; m < A->mt; m++) {
{ tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
Y = m == dA->mt-1 ? dA->m-m*dA->mb : dA->mb; ldam = BLKLDD(A, m);
ldt = BLKLDD(dA, m); for (n = 0; n < A->nt; n++) {
for (n = 0; n < dA->nt; n++) tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
{
X = n == dA->nt-1 ? dA->n-n*dA->nb : dA->nb;
MORSE_TASK_ztile_zero( MORSE_TASK_ztile_zero(
&options, &options,
0, X, 0, Y, 0, tempnn, 0, tempmm,
A(m, n), ldt); A(m, n), ldam);
} }
} }
......
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