From 0415b68513f6e6b177ee98d1ff1525cbee27b5d9 Mon Sep 17 00:00:00 2001 From: Francois Coppens Date: Fri, 16 Dec 2022 11:43:52 +0100 Subject: [PATCH] Added QMCkl NULL-context checking in template. --- org/qmckl_sherman_morrison_woodbury.org | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/org/qmckl_sherman_morrison_woodbury.org b/org/qmckl_sherman_morrison_woodbury.org index 4ea6059..55d639d 100644 --- a/org/qmckl_sherman_morrison_woodbury.org +++ b/org/qmckl_sherman_morrison_woodbury.org @@ -129,6 +129,13 @@ static inline qmckl_exit_code qmckl_sherman_morrison_{Dim}(const qmckl_context c double* Slater_inv, 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 // const uint LDS=(1+({Dim}-1)/SIMD) * SIMD; const uint LDS={Dim}; @@ -231,7 +238,10 @@ qmckl_exit_code qmckl_sherman_morrison(const qmckl_context context, double* determinant) { 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) {