Enable OpenMP task parallelism for C kernels
This commit is contained in:
@@ -43,7 +43,13 @@ void lopsided_kodis(const int ex[3],
|
||||
const size_t nz = (size_t)ex3 + 3;
|
||||
const size_t fh_size = nx * ny * nz;
|
||||
|
||||
double *fh = (double*)malloc(fh_size * sizeof(double));
|
||||
static thread_local double *fh = NULL;
|
||||
static thread_local size_t cap = 0;
|
||||
if (fh_size > cap) {
|
||||
free(fh);
|
||||
fh = (double*)aligned_alloc(64, fh_size * sizeof(double));
|
||||
cap = fh_size;
|
||||
}
|
||||
if (!fh) return;
|
||||
|
||||
symmetry_bd(3, ex, f, fh, SoA);
|
||||
@@ -243,6 +249,4 @@ void lopsided_kodis(const int ex[3],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(fh);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user