Enable OpenMP task parallelism for C kernels

This commit is contained in:
2026-03-30 20:34:34 +08:00
parent 8c1f4d8108
commit 5f664716ab
9 changed files with 137 additions and 79 deletions

View File

@@ -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);
}