1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-23 03:07:46 +02:00

Added QMCkl NULL-context checking in template.

This commit is contained in:
Francois Coppens 2022-12-16 11:43:52 +01:00
parent 1af5ddc76c
commit 0415b68513

View File

@ -129,6 +129,13 @@ static inline qmckl_exit_code qmckl_sherman_morrison_{Dim}(const qmckl_context c
double* Slater_inv, double* Slater_inv,
double* determinant) { double* determinant) {
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return qmckl_failwith( context,
QMCKL_NULL_CONTEXT,
"qmckl_sherman_morrison_{Dim}",
NULL);
}
// TODO: Specialize for padding // TODO: Specialize for padding
// const uint LDS=(1+({Dim}-1)/SIMD) * SIMD; // const uint LDS=(1+({Dim}-1)/SIMD) * SIMD;
const uint LDS={Dim}; const uint LDS={Dim};
@ -231,7 +238,10 @@ qmckl_exit_code qmckl_sherman_morrison(const qmckl_context context,
double* determinant) { double* determinant) {
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return QMCKL_NULL_CONTEXT; return qmckl_failwith( context,
QMCKL_NULL_CONTEXT,
"qmckl_sherman_morrison",
NULL);
} }
if (Dim == LDS) { if (Dim == LDS) {