Commit 006c3b3f authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

Use tempab notation for dimension variable

parent 1a7a2139
......@@ -26,138 +26,135 @@
**/
#include "control/common.h"
#define A(m, n) dA, m, n
#define B(m, n) &dB, m, n
#define A(m, n) A, m, n
#define B(m, n) &B, m, n
/*******************************************************************************
* 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_context_t *morse;
MORSE_option_t options;
MORSE_desc_t dB;
int X, Y;
int n, m, ldt;
MORSE_desc_t B;
int m, n;
int ldam;
int tempmm, tempnn;
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
return;
RUNTIME_options_init(&options, morse, sequence, request);
dB = morse_desc_init(
MorseComplexDouble, dA->mb, dA->nb, dA->bsiz,
lda, dA->n, 0, 0, dA->m, dA->n, 1, 1);
B = morse_desc_init(
MorseComplexDouble, A->mb, A->nb, A->bsiz,
ldaf77, A->n, 0, 0, A->m, A->n, 1, 1);
dB.get_blkaddr = morse_getaddr_cm;
dB.get_blkldd = morse_getblkldd_cm;
dB.mat = Af77;
dB.styp = MorseCM;
B.get_blkaddr = morse_getaddr_cm;
B.get_blkldd = morse_getblkldd_cm;
B.mat = Af77;
B.styp = MorseCM;
RUNTIME_desc_create( &dB );
RUNTIME_desc_create( &B );
for (m = 0; m < dA->mt; m++)
{
Y = m == dA->mt-1 ? dA->m-m*dA->mb : dA->mb;
ldt = BLKLDD(dA, m);
for (n = 0; n < dA->nt; n++)
{
X = n == dA->nt-1 ? dA->n-n*dA->nb : dA->nb;
for (m = 0; m < A->mt; m++) {
tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
ldam = BLKLDD(A, m);
for (n = 0; n < A->nt; n++) {
tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
MORSE_TASK_zlacpy(
&options,
MorseUpperLower,
Y, X, dA->mb,
B(m, n), lda,
A(m, n), ldt);
tempmm, tempnn, A->mb,
B(m, n), ldaf77,
A(m, n), ldam);
}
}
RUNTIME_sequence_wait( morse, sequence );
RUNTIME_options_finalize( &options, morse );
MORSE_TASK_dataflush_all();
RUNTIME_desc_getoncpu( &dB );
RUNTIME_desc_destroy( &dB );
RUNTIME_desc_getoncpu( &B );
RUNTIME_desc_destroy( &B );
}
/*******************************************************************************
* 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_context_t *morse;
MORSE_option_t options;
MORSE_desc_t dB;
int X, Y;
int n, m, ldt;
MORSE_desc_t B;
int m, n;
int ldam;
int tempmm, tempnn;
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
return;
RUNTIME_options_init(&options, morse, sequence, request);
dB = morse_desc_init(
MorseComplexDouble, dA->mb, dA->nb, dA->bsiz,
lda, dA->n, 0, 0, dA->m, dA->n, 1, 1);
B = morse_desc_init(
MorseComplexDouble, A->mb, A->nb, A->bsiz,
ldaf77, A->n, 0, 0, A->m, A->n, 1, 1);
dB.get_blkaddr = morse_getaddr_cm;
dB.get_blkldd = morse_getblkldd_cm;
dB.mat = Af77;
dB.styp = MorseCM;
B.get_blkaddr = morse_getaddr_cm;
B.get_blkldd = morse_getblkldd_cm;
B.mat = Af77;
B.styp = MorseCM;
RUNTIME_desc_create( &dB );
RUNTIME_desc_create( &B );
for (m = 0; m < dA->mt; m++)
{
Y = m == dA->mt-1 ? dA->m-m*dA->mb : dA->mb;
ldt = BLKLDD(dA, m);
for (n = 0; n < dA->nt; n++)
{
X = n == dA->nt-1 ? dA->n-n*dA->nb : dA->nb;
for (m = 0; m < A->mt; m++) {
tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
ldam = BLKLDD(A, m);
for (n = 0; n < A->nt; n++) {
tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
MORSE_TASK_zlacpy(
&options,
MorseUpperLower,
Y, X, dA->mb,
A(m, n), ldt,
B(m, n), lda);
tempmm, tempnn, A->mb,
A(m, n), ldam,
B(m, n), ldaf77);
}
}
RUNTIME_sequence_wait( morse, sequence );
RUNTIME_options_finalize( &options, morse );
MORSE_TASK_dataflush_all();
RUNTIME_desc_getoncpu( &dB );
RUNTIME_desc_destroy( &dB );
RUNTIME_desc_getoncpu( &B );
RUNTIME_desc_destroy( &B );
}
/*******************************************************************************
* 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_option_t options;
int X, Y;
int n, m, ldt;
int m, n;
int ldam;
int tempmm, tempnn;
morse = morse_context_self();
if (sequence->status != MORSE_SUCCESS)
return;
RUNTIME_options_init(&options, morse, sequence, request);
for (m = 0; m < dA->mt; m++)
{
Y = m == dA->mt-1 ? dA->m-m*dA->mb : dA->mb;
ldt = BLKLDD(dA, m);
for (n = 0; n < dA->nt; n++)
{
X = n == dA->nt-1 ? dA->n-n*dA->nb : dA->nb;
for (m = 0; m < A->mt; m++) {
tempmm = m == A->mt-1 ? A->m-m*A->mb : A->mb;
ldam = BLKLDD(A, m);
for (n = 0; n < A->nt; n++) {
tempnn = n == A->nt-1 ? A->n-n*A->nb : A->nb;
MORSE_TASK_ztile_zero(
&options,
0, X, 0, Y,
A(m, n), ldt);
0, tempnn, 0, tempmm,
A(m, n), ldam);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment