From 562488db4a98f8a3501d4d6a14bbef899a8c6637 Mon Sep 17 00:00:00 2001 From: Mihail Mihov Date: Tue, 19 Mar 2024 19:43:14 +0200 Subject: [PATCH] Fix Hessian/Functors test --- test/Hessian/Functors.C | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/test/Hessian/Functors.C b/test/Hessian/Functors.C index 502f11f86..57803b676 100644 --- a/test/Hessian/Functors.C +++ b/test/Hessian/Functors.C @@ -3,7 +3,6 @@ // RUN: %cladclang -Xclang -plugin-arg-clad -Xclang -enable-tbr %s -I%S/../../include -oFunctors.out // RUN: ./Functors.out | FileCheck -check-prefix=CHECK-EXEC %s // CHECK-NOT: {{.*error|warning|note:.*}} -// XFAIL: target={{i586.*}} #include "clad/Differentiator/Differentiator.h" @@ -19,9 +18,9 @@ struct Experiment { // CHECK: void operator_call_hessian(double i, double j, clad::array_ref hessianMatrix) { // CHECK-NEXT: Experiment _d_this; - // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: Experiment _d_this0; - // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } }; @@ -37,9 +36,9 @@ struct ExperimentConst { // CHECK: void operator_call_hessian(double i, double j, clad::array_ref hessianMatrix) const { // CHECK-NEXT: ExperimentConst _d_this; - // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: ExperimentConst _d_this0; - // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } }; @@ -55,9 +54,9 @@ struct ExperimentVolatile { // CHECK: void operator_call_hessian(double i, double j, clad::array_ref hessianMatrix) volatile { // CHECK-NEXT: volatile ExperimentVolatile _d_this; - // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: volatile ExperimentVolatile _d_this0; - // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } }; @@ -73,9 +72,9 @@ struct ExperimentConstVolatile { // CHECK: void operator_call_hessian(double i, double j, clad::array_ref hessianMatrix) const volatile { // CHECK-NEXT: volatile ExperimentConstVolatile _d_this; - // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: volatile ExperimentConstVolatile _d_this0; - // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } }; @@ -93,9 +92,9 @@ namespace outer { // CHECK: void operator_call_hessian(double i, double j, clad::array_ref hessianMatrix) { // CHECK-NEXT: outer::inner::ExperimentNNS _d_this; - // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, j, &_d_this, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); // CHECK-NEXT: outer::inner::ExperimentNNS _d_this0; - // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg1_grad(i, j, &_d_this0, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } }; @@ -104,8 +103,8 @@ namespace outer { }; // CHECK: inline void operator_call_hessian(double i, double j, clad::array_ref hessianMatrix) const { - // CHECK-NEXT: this->operator_call_darg0_grad(i, j, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); - // CHECK-NEXT: this->operator_call_darg1_grad(i, j, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, j, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); + // CHECK-NEXT: this->operator_call_darg1_grad(i, j, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } } } @@ -141,8 +140,8 @@ int main() { }; // CHECK: inline void operator_call_hessian(double i, double j, clad::array_ref hessianMatrix) const { - // CHECK-NEXT: this->operator_call_darg0_grad(i, j, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); - // CHECK-NEXT: this->operator_call_darg1_grad(i, j, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, j, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); + // CHECK-NEXT: this->operator_call_darg1_grad(i, j, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } auto lambdaWithCapture = [&](double i, double jj) { @@ -150,8 +149,8 @@ int main() { }; // CHECK: inline void operator_call_hessian(double i, double jj, clad::array_ref hessianMatrix) const { - // CHECK-NEXT: this->operator_call_darg0_grad(i, jj, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL)); - // CHECK-NEXT: this->operator_call_darg1_grad(i, jj, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL)); + // CHECK-NEXT: this->operator_call_darg0_grad(i, jj, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}})); + // CHECK-NEXT: this->operator_call_darg1_grad(i, jj, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}})); // CHECK-NEXT: } auto lambdaNNS = outer::inner::lambdaNNS; @@ -195,4 +194,4 @@ int main() { TEST(E_NNS); // CHECK-EXEC: {108.00, 174.00, 174.00, 70.00}, {108.00, 174.00, 174.00, 70.00} TEST(E_NNS_Again); // CHECK-EXEC: {108.00, 174.00, 174.00, 70.00}, {108.00, 174.00, 174.00, 70.00} TEST(lambdaWithCapture); // CHECK-EXEC: {108.00, 174.00, 174.00, 70.00}, {108.00, 174.00, 174.00, 70.00} -} \ No newline at end of file +}