Skip to content

Commit

Permalink
Fix Hessian/teshessUtility test on i586
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailMihov committed Mar 19, 2024
1 parent 101f8da commit 147da0e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/Hessian/testhessUtility.C
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// RUN: %cladclang -Xclang -plugin-arg-clad -Xclang -enable-tbr %s -I%S/../../include -otesthessUtility.out
// RUN: ./testhessUtility.out | FileCheck -check-prefix=CHECK-EXEC %s
// CHECK-NOT: {{.*error|warning|note:.*}}
// XFAIL: target={{i586.*}}

#include "clad/Differentiator/Differentiator.h"

Expand All @@ -19,16 +18,16 @@ clad::array_ref<double>mat_ref_f1(mat_ref1, 9);
double fn(double x, double y) { return x * y; }

//CHECK: void fn_hessian(double x, double y, clad::array_ref<double> hessianMatrix) {
//CHECK-NEXT: fn_darg0_grad(x, y, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 1UL));
//CHECK-NEXT: fn_darg1_grad(x, y, hessianMatrix.slice(2UL, 1UL), hessianMatrix.slice(3UL, 1UL));
//CHECK-NEXT: fn_darg0_grad(x, y, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{1U|1UL}}));
//CHECK-NEXT: fn_darg1_grad(x, y, hessianMatrix.slice({{2U|2UL}}, {{1U|1UL}}), hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}}));
//CHECK-NEXT:}

double g(double i, double j[2]) { return i * (j[0] + j[1]); }

//CHECK: void g_hessian(double i, double j[2], clad::array_ref<double> hessianMatrix) {
//CHECK-NEXT: g_darg0_grad(i, j, hessianMatrix.slice(0UL, 1UL), hessianMatrix.slice(1UL, 2UL));
//CHECK-NEXT: g_darg1_0_grad(i, j, hessianMatrix.slice(3UL, 1UL), hessianMatrix.slice(4UL, 2UL));
//CHECK-NEXT: g_darg1_1_grad(i, j, hessianMatrix.slice(6UL, 1UL), hessianMatrix.slice(7UL, 2UL));
//CHECK-NEXT: g_darg0_grad(i, j, hessianMatrix.slice({{0U|0UL}}, {{1U|1UL}}), hessianMatrix.slice({{1U|1UL}}, {{2U|2UL}}));
//CHECK-NEXT: g_darg1_0_grad(i, j, hessianMatrix.slice({{3U|3UL}}, {{1U|1UL}}), hessianMatrix.slice({{4U|4UL}}, {{2U|2UL}}));
//CHECK-NEXT: g_darg1_1_grad(i, j, hessianMatrix.slice({{6U|6UL}}, {{1U|1UL}}), hessianMatrix.slice({{7U|7UL}}, {{2U|2UL}}));
//CHECK-NEXT: }

int main() {
Expand All @@ -39,4 +38,4 @@ int main() {
TEST_HESSIAN(fn, 2, 2, 3, mat_ref_f); // CHECK-EXEC: {0.00, 1.00, 1.00, 0.00}
TEST_HESSIAN(g, 2, 2, j, mat_ref_f1); // CHECK-EXEC: {0.00, 1.00, 1.00, 1.00, 0.00, 0.00, 1.00, 0.00, 0.00}

}
}

0 comments on commit 147da0e

Please sign in to comment.