Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0aa032c5 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

compute/mixed-precision: Fix algorithm for task insertion

parent a59ca4f3
No related branches found
No related tags found
1 merge request!344Mixed Precision: Make sure the mixed precision conversion files are correctly handled during the compilation
...@@ -24,23 +24,54 @@ ...@@ -24,23 +24,54 @@
*/ */
#include "control/common.h" #include "control/common.h"
#define A(m,n) A, m, n #define A( _m_, _n_ ) A, (_m_), (_n_)
#define B(m,n) B, m, n #define B( _m_, _n_ ) B, (_m_), (_n_)
#define SA(m,n) SA, m, n
#define SB(m,n) SB, m, n
/** /**
* *
*/ */
void chameleon_pclag2z( CHAM_desc_t *A, CHAM_desc_t *B,
RUNTIME_sequence_t *sequence, RUNTIME_request_t *request )
{
CHAM_context_t *chamctxt;
RUNTIME_option_t options;
int tempmm, tempnn;
int m, n;
chamctxt = chameleon_context_self();
if (sequence->status != CHAMELEON_SUCCESS) {
return;
}
RUNTIME_options_init(&options, chamctxt, sequence, request);
for(m = 0; m < A->mt; m++) {
tempmm = m == A->mt-1 ? A->m - m * A->mb : A->mb;
for(n = 0; n < A->nt; n++) {
tempnn = n == A->nt-1 ? A->n - n * A->nb : A->nb;
INSERT_TASK_clag2z(
&options,
tempmm, tempnn, A->mb,
A(m, n),
B(m, n));
}
}
RUNTIME_options_finalize(&options, chamctxt);
}
/** /**
* *
*/ */
void chameleon_pclag2z(CHAM_desc_t *SA, CHAM_desc_t *B, void chameleon_pzlag2c( CHAM_desc_t *A, CHAM_desc_t *B,
RUNTIME_sequence_t *sequence, RUNTIME_request_t *request) RUNTIME_sequence_t *sequence, RUNTIME_request_t *request )
{ {
CHAM_context_t *chamctxt; CHAM_context_t *chamctxt;
RUNTIME_option_t options; RUNTIME_option_t options;
int X, Y; int tempmm, tempnn;
int m, n; int m, n;
chamctxt = chameleon_context_self(); chamctxt = chameleon_context_self();
...@@ -49,16 +80,19 @@ void chameleon_pclag2z(CHAM_desc_t *SA, CHAM_desc_t *B, ...@@ -49,16 +80,19 @@ void chameleon_pclag2z(CHAM_desc_t *SA, CHAM_desc_t *B,
} }
RUNTIME_options_init(&options, chamctxt, sequence, request); RUNTIME_options_init(&options, chamctxt, sequence, request);
for(m = 0; m < SA->mt; m++) { for(m = 0; m < A->mt; m++) {
X = m == SA->mt-1 ? SA->m-m*SA->mb : SA->mb; tempmm = m == A->mt-1 ? A->m - m * A->mb : A->mb;
for(n = 0; n < SA->nt; n++) {
Y = n == SA->nt-1 ? SA->n-n*SA->nb : SA->nb; for(n = 0; n < A->nt; n++) {
INSERT_TASK_clag2z( tempnn = n == A->nt-1 ? A->n - n * A->nb : A->nb;
INSERT_TASK_zlag2c(
&options, &options,
X, Y, SA->mb, tempmm, tempnn, A->mb,
SA(m, n), A(m, n),
B(m, n)); B(m, n));
} }
} }
RUNTIME_options_finalize(&options, chamctxt); 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