From d7e5434cd4aecc9e8a3e61e1660f1543ae5f3954 Mon Sep 17 00:00:00 2001 From: Vaibhav Thakkar Date: Mon, 4 Mar 2024 16:40:20 +0100 Subject: [PATCH] Fix extra lines generated when using clad::array or array_ref fixes #350 --- include/clad/Differentiator/Array.h | 17 +++++++++---- include/clad/Differentiator/ArrayRef.h | 6 ++--- test/Arrays/ArrayInputsReverseMode.C | 3 --- test/ErrorEstimation/Assignments.C | 6 ----- test/ErrorEstimation/BasicOps.C | 5 ---- test/ErrorEstimation/ConditonalStatements.C | 27 ++++++++------------ test/ErrorEstimation/LoopsAndArrays.C | 3 --- test/Gradient/Assignments.C | 28 ++------------------- test/Gradient/FunctionCalls.C | 6 ----- test/Gradient/Gradients.C | 1 - test/Gradient/Loops.C | 1 - test/Gradient/Pointers.C | 4 --- test/Gradient/TestTypeConversion.C | 1 - 13 files changed, 28 insertions(+), 80 deletions(-) diff --git a/include/clad/Differentiator/Array.h b/include/clad/Differentiator/Array.h index b8e291eb3..d16fa574d 100644 --- a/include/clad/Differentiator/Array.h +++ b/include/clad/Differentiator/Array.h @@ -11,6 +11,13 @@ namespace clad { template class array_ref; +// For MSVC, __attribute__((pure)) is not supported. +#if defined(_MSC_VER) +#define PUREFUNC +#else +#define PUREFUNC __attribute__((pure)) +#endif + /// This class is not meant to be used by user. It is used by clad internally /// only @@ -102,16 +109,16 @@ template class array { /// Returns the size of the underlying array CUDA_HOST_DEVICE std::size_t size() const { return m_size; } /// Returns the ptr of the underlying array - CUDA_HOST_DEVICE T* ptr() const { return m_arr; } - CUDA_HOST_DEVICE T*& ptr_ref() { return m_arr; } + CUDA_HOST_DEVICE PUREFUNC T* ptr() const { return m_arr; } + CUDA_HOST_DEVICE PUREFUNC T*& ptr_ref() { return m_arr; } /// Returns the reference to the location at the index of the underlying /// array - CUDA_HOST_DEVICE T& operator[](std::ptrdiff_t i) { return m_arr[i]; } - CUDA_HOST_DEVICE const T& operator[](std::ptrdiff_t i) const { + CUDA_HOST_DEVICE PUREFUNC T& operator[](std::ptrdiff_t i) { return m_arr[i]; } + CUDA_HOST_DEVICE PUREFUNC const T& operator[](std::ptrdiff_t i) const { return m_arr[i]; } /// Returns the reference to the underlying array - CUDA_HOST_DEVICE T& operator*() { return *m_arr; } + CUDA_HOST_DEVICE PUREFUNC T& operator*() { return *m_arr; } // Arithmetic overloads /// Divides the number from every element in the array diff --git a/include/clad/Differentiator/ArrayRef.h b/include/clad/Differentiator/ArrayRef.h index 90e3f992c..fac7ab320 100644 --- a/include/clad/Differentiator/ArrayRef.h +++ b/include/clad/Differentiator/ArrayRef.h @@ -53,8 +53,8 @@ template class array_ref { } /// Returns the size of the underlying array CUDA_HOST_DEVICE std::size_t size() const { return m_size; } - CUDA_HOST_DEVICE T* ptr() const { return m_arr; } - CUDA_HOST_DEVICE T*& ptr_ref() { return m_arr; } + CUDA_HOST_DEVICE PUREFUNC T* ptr() const { return m_arr; } + CUDA_HOST_DEVICE PUREFUNC T*& ptr_ref() { return m_arr; } /// Returns an array_ref to a part of the underlying array starting at /// offset and having the specified size CUDA_HOST_DEVICE array_ref slice(std::size_t offset, std::size_t size) { @@ -64,7 +64,7 @@ template class array_ref { return array_ref(&m_arr[offset], size); } /// Returns the reference to the underlying array - CUDA_HOST_DEVICE T& operator*() { return *m_arr; } + CUDA_HOST_DEVICE PUREFUNC T& operator*() { return *m_arr; } // Arithmetic overloads /// Divides the arrays element wise diff --git a/test/Arrays/ArrayInputsReverseMode.C b/test/Arrays/ArrayInputsReverseMode.C index 7587c89e4..d4bad52cc 100644 --- a/test/Arrays/ArrayInputsReverseMode.C +++ b/test/Arrays/ArrayInputsReverseMode.C @@ -293,7 +293,6 @@ double func5(int k) { //CHECK-NEXT: double _r_d0 = _d_arr[i]; //CHECK-NEXT: _d_arr[i] -= _r_d0; //CHECK-NEXT: * _d_k += _r_d0; -//CHECK-NEXT: _d_arr[i]; //CHECK-NEXT: } //CHECK-NEXT: } //CHECK-NEXT: * _d_k += _d_n; @@ -498,7 +497,6 @@ void modify(double& elem, double val) { //CHECK-NEXT: double _r_d0 = * _d_elem; //CHECK-NEXT: * _d_elem -= _r_d0; //CHECK-NEXT: * _d_val += _r_d0; -//CHECK-NEXT: * _d_elem; //CHECK-NEXT: } //CHECK-NEXT: } @@ -565,7 +563,6 @@ double sq(double& elem) { //CHECK-NEXT: * _d_elem -= _r_d0; //CHECK-NEXT: * _d_elem += _r_d0 * elem; //CHECK-NEXT: * _d_elem += elem * _r_d0; -//CHECK-NEXT: * _d_elem; //CHECK-NEXT: } //CHECK-NEXT: } diff --git a/test/ErrorEstimation/Assignments.C b/test/ErrorEstimation/Assignments.C index 3325b7e60..4817fe4c6 100644 --- a/test/ErrorEstimation/Assignments.C +++ b/test/ErrorEstimation/Assignments.C @@ -31,7 +31,6 @@ float func(float x, float y) { //CHECK-NEXT: float _r_d1 = * _d_y; //CHECK-NEXT: * _d_y -= _r_d1; //CHECK-NEXT: * _d_x += _r_d1; -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: x = _t0; @@ -40,7 +39,6 @@ float func(float x, float y) { //CHECK-NEXT: * _d_x += _r_d0; //CHECK-NEXT: * _d_y += _r_d0; //CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); //CHECK-NEXT: double _delta_y = 0; @@ -73,7 +71,6 @@ float func2(float x, int y) { //CHECK-NEXT: * _d_x += _r_d0 * x; //CHECK-NEXT: * _d_x += x * _r_d0; //CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); //CHECK-NEXT: _final_error += _delta_x; @@ -96,7 +93,6 @@ float func3(int x, int y) { //CHECK-NEXT: int _r_d0 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d0; //CHECK-NEXT: * _d_y += _r_d0; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: } @@ -129,7 +125,6 @@ float func4(float x, float y) { //CHECK-NEXT: _d_z += _r_d0; //CHECK-NEXT: * _d_y += _r_d0; //CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: * _d_y += _d_z; //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); @@ -164,7 +159,6 @@ float func5(float x, float y) { //CHECK-NEXT: _d_z += _r_d0; //CHECK-NEXT: * _d_y += _r_d0; //CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); //CHECK-NEXT: double _delta_y = 0; diff --git a/test/ErrorEstimation/BasicOps.C b/test/ErrorEstimation/BasicOps.C index a0889138b..104ca9721 100644 --- a/test/ErrorEstimation/BasicOps.C +++ b/test/ErrorEstimation/BasicOps.C @@ -53,7 +53,6 @@ float func(float x, float y) { //CHECK-NEXT: _delta_y += std::abs(* _d_y * _EERepl_y1 * {{.+}}); //CHECK-NEXT: * _d_y += _r_d1; //CHECK-NEXT: _delta_y += std::abs(_r_d1 * _EERepl_y2 * {{.+}}); -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: x = _t0; @@ -62,7 +61,6 @@ float func(float x, float y) { //CHECK-NEXT: * _d_x += _r_d0; //CHECK-NEXT: * _d_y += _r_d0; //CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); //CHECK-NEXT: _delta_y += std::abs(* _d_y * _EERepl_y0 * {{.+}}); @@ -108,7 +106,6 @@ float func2(float x, float y) { //CHECK-NEXT: * _d_y += -_r_d0 * y; //CHECK-NEXT: * _d_y += y * -_r_d0; //CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); //CHECK-NEXT: double _delta_y = 0; @@ -176,7 +173,6 @@ float func3(float x, float y) { //CHECK-NEXT: * _d_y += -_r_d0 * y; //CHECK-NEXT: * _d_y += y * -_r_d0; //CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); //CHECK-NEXT: _delta_y += std::abs(* _d_y * _EERepl_y0 * {{.+}}); @@ -236,7 +232,6 @@ float func5(float x, float y) { //CHECK-NEXT: float _r0 = _r_d0 * clad::custom_derivatives{{(::std)?}}::sin_pushforward(x, 1.F).pushforward; //CHECK-NEXT: * _d_x += _r0; //CHECK-NEXT: _delta_y += std::abs(_r_d0 * _EERepl_y1 * {{.+}}); -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: double _delta_x = 0; //CHECK-NEXT: _delta_x += std::abs(* _d_x * x * {{.+}}); diff --git a/test/ErrorEstimation/ConditonalStatements.C b/test/ErrorEstimation/ConditonalStatements.C index 24c88ad99..f9454134b 100644 --- a/test/ErrorEstimation/ConditonalStatements.C +++ b/test/ErrorEstimation/ConditonalStatements.C @@ -60,7 +60,6 @@ float func(float x, float y) { //CHECK-NEXT: * _d_y += _r_d0 * x; //CHECK-NEXT: * _d_x += y * _r_d0; //CHECK-NEXT: _delta_y += std::abs(_r_d0 * _EERepl_y1 * {{.+}}); -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: } else { //CHECK-NEXT: { @@ -68,7 +67,6 @@ float func(float x, float y) { //CHECK-NEXT: float _r_d2 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d2; //CHECK-NEXT: * _d_y += _r_d2; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: temp = _t1; @@ -189,20 +187,17 @@ float func4(float x, float y) { //CHECK-NEXT: float _r0 = 1 * -y / (x * x); //CHECK-NEXT: * _d_x += _r0; //CHECK-NEXT: } -//CHECK-NEXT: { -//CHECK-NEXT: if (_cond0) { -//CHECK-NEXT: x = _t0; -//CHECK-NEXT: float _r_d0 = * _d_x; -//CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); -//CHECK-NEXT: } else { -//CHECK-NEXT: x = _t1; -//CHECK-NEXT: float _r_d1 = * _d_x; -//CHECK-NEXT: * _d_x -= _r_d1; -//CHECK-NEXT: * _d_x += _r_d1 * x; -//CHECK-NEXT: * _d_x += x * _r_d1; -//CHECK-NEXT: _delta_x += std::abs(_r_d1 * _EERepl_x2 * {{.+}}); -//CHECK-NEXT: } -//CHECK-NEXT: _cond0 ? * _d_x : * _d_x; +//CHECK-NEXT: if (_cond0) { +//CHECK-NEXT: x = _t0; +//CHECK-NEXT: float _r_d0 = * _d_x; +//CHECK-NEXT: _delta_x += std::abs(_r_d0 * _EERepl_x1 * {{.+}}); +//CHECK-NEXT: } else { +//CHECK-NEXT: x = _t1; +//CHECK-NEXT: float _r_d1 = * _d_x; +//CHECK-NEXT: * _d_x -= _r_d1; +//CHECK-NEXT: * _d_x += _r_d1 * x; +//CHECK-NEXT: * _d_x += x * _r_d1; +//CHECK-NEXT: _delta_x += std::abs(_r_d1 * _EERepl_x2 * {{.+}}); //CHECK-NEXT: } //CHECK-NEXT: _delta_x += std::abs(* _d_x * _EERepl_x0 * {{.+}}); //CHECK-NEXT: double _delta_y = 0; diff --git a/test/ErrorEstimation/LoopsAndArrays.C b/test/ErrorEstimation/LoopsAndArrays.C index f7ef15517..253c7a68f 100644 --- a/test/ErrorEstimation/LoopsAndArrays.C +++ b/test/ErrorEstimation/LoopsAndArrays.C @@ -158,7 +158,6 @@ float func3(float x, float y) { //CHECK-NEXT: _d_arr[1] += _r_d2; //CHECK-NEXT: _delta_arr[2] += std::abs(_r_d2 * _EERepl_arr2 * {{.+}}); //CHECK-NEXT: _final_error += _delta_arr[2]; -//CHECK-NEXT: _d_arr[2]; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: arr[1] = _t1; @@ -168,7 +167,6 @@ float func3(float x, float y) { //CHECK-NEXT: * _d_x += x * _r_d1; //CHECK-NEXT: _delta_arr[1] += std::abs(_r_d1 * _EERepl_arr1 * {{.+}}); //CHECK-NEXT: _final_error += _delta_arr[1]; -//CHECK-NEXT: _d_arr[1]; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: arr[0] = _t0; @@ -178,7 +176,6 @@ float func3(float x, float y) { //CHECK-NEXT: * _d_y += _r_d0; //CHECK-NEXT: _delta_arr[0] += std::abs(_r_d0 * _EERepl_arr0 * {{.+}}); //CHECK-NEXT: _final_error += _delta_arr[0]; -//CHECK-NEXT: _d_arr[0]; //CHECK-NEXT: } //CHECK-NEXT: double _delta_x = 0; //CHECK-NEXT: _delta_x += std::abs(* _d_x * x * {{.+}}); diff --git a/test/Gradient/Assignments.C b/test/Gradient/Assignments.C index d7bb97384..f209372ab 100644 --- a/test/Gradient/Assignments.C +++ b/test/Gradient/Assignments.C @@ -26,7 +26,6 @@ double f1(double x, double y) { //CHECK-NEXT: double _r_d0 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d0; //CHECK-NEXT: * _d_y += _r_d0; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: } @@ -53,7 +52,6 @@ double f2(double x, double y) { //CHECK-NEXT: double _r_d0 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d0; //CHECK-NEXT: * _d_y += _r_d0; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: } @@ -87,7 +85,6 @@ double f3(double x, double y) { //CHECK-NEXT: double _r_d3 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d3; //CHECK-NEXT: * _d_y += _r_d3; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: y = _t2; @@ -95,7 +92,6 @@ double f3(double x, double y) { //CHECK-NEXT: * _d_y -= _r_d2; //CHECK-NEXT: * _d_x += _r_d2 * x; //CHECK-NEXT: * _d_x += x * _r_d2; -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: x = _t1; @@ -103,14 +99,12 @@ double f3(double x, double y) { //CHECK-NEXT: * _d_x -= _r_d1; //CHECK-NEXT: * _d_x += _r_d1 * x; //CHECK-NEXT: * _d_x += x * _r_d1; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: x = _t0; //CHECK-NEXT: double _r_d0 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d0; //CHECK-NEXT: * _d_x += _r_d0; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: } @@ -135,14 +129,12 @@ double f4(double x, double y) { //CHECK-NEXT: x = _t1; //CHECK-NEXT: double _r_d1 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d1; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: y = _t0; //CHECK-NEXT: double _r_d0 = * _d_y; //CHECK-NEXT: * _d_y -= _r_d0; //CHECK-NEXT: * _d_x += _r_d0; -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: } @@ -325,13 +317,11 @@ double f7(double x, double y) { //CHECK-NEXT: * _d_x -= _r_d6; //CHECK-NEXT: _d_t[0] += _r_d6; //CHECK-NEXT: --t[0]; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: t[0] = _t5; //CHECK-NEXT: double _r_d5 = _d_t[0]; //CHECK-NEXT: _d_t[1] += -_r_d5; -//CHECK-NEXT: _d_t[0]; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: t[0] = _t4; @@ -340,7 +330,6 @@ double f7(double x, double y) { //CHECK-NEXT: _d_t[0] += _r_d4 / t[1]; //CHECK-NEXT: double _r0 = _r_d4 * -t[0] / (t[1] * t[1]); //CHECK-NEXT: _d_t[1] += _r0; -//CHECK-NEXT: _d_t[0]; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: t[0] = _t3; @@ -348,38 +337,28 @@ double f7(double x, double y) { //CHECK-NEXT: _d_t[0] -= _r_d3; //CHECK-NEXT: _d_t[0] += _r_d3 * t[1]; //CHECK-NEXT: _d_t[1] += t[0] * _r_d3; -//CHECK-NEXT: _d_t[0]; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: t[0] = _t2; //CHECK-NEXT: double _r_d2 = _d_t[0]; //CHECK-NEXT: _d_t[1] += _r_d2; -//CHECK-NEXT: _d_t[0]; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: x = _t1; //CHECK-NEXT: double _r_d1 = * _d_x; //CHECK-NEXT: * _d_x -= _r_d1; //CHECK-NEXT: * _d_y += _r_d1; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: t[0] = _t0; //CHECK-NEXT: double _r_d0 = _d_t[0]; //CHECK-NEXT: _d_t[0] -= _r_d0; //CHECK-NEXT: * _d_x += _r_d0; -//CHECK-NEXT: _d_t[0]; //CHECK-NEXT: } //CHECK-NEXT: ++t[0]; //CHECK-NEXT: --t[0]; -//CHECK-NEXT: { -//CHECK-NEXT: t[0]++; -//CHECK-NEXT: _d_t[0]; -//CHECK-NEXT: } -//CHECK-NEXT: { -//CHECK-NEXT: t[0]--; -//CHECK-NEXT: _d_t[0]; -//CHECK-NEXT: } +//CHECK-NEXT: t[0]++; +//CHECK-NEXT: t[0]--; //CHECK-NEXT: { //CHECK-NEXT: * _d_x += _d_t[1]; //CHECK-NEXT: * _d_x += _d_t[2] * x; @@ -426,7 +405,6 @@ double f8(double x, double y) { //CHECK-NEXT: double _r_d3 = _d_t[1]; //CHECK-NEXT: _d_t[1] -= _r_d3; //CHECK-NEXT: _d_t[2] += _r_d3; -//CHECK-NEXT: _d_t[3]; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: * _d_x += _d_t[1]; @@ -853,7 +831,6 @@ double f20(double x, double y) { //CHECK-NEXT: * _d_x -= _r_d1; //CHECK-NEXT: *_d_r += _r_d1 * y; //CHECK-NEXT: * _d_y += r * _r_d1; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: { //CHECK-NEXT: r = _t0; @@ -881,7 +858,6 @@ double f21 (double x, double y) { //CHECK-NEXT: * _d_y += 0; //CHECK-NEXT: y--; //CHECK-NEXT: * _d_x += _r_d0; -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: } diff --git a/test/Gradient/FunctionCalls.C b/test/Gradient/FunctionCalls.C index e5d7b2833..94ca8615c 100644 --- a/test/Gradient/FunctionCalls.C +++ b/test/Gradient/FunctionCalls.C @@ -74,13 +74,11 @@ double modify1(double& i, double& j) { // CHECK-NEXT: j = _t1; // CHECK-NEXT: double _r_d1 = * _d_j; // CHECK-NEXT: * _d_j += _r_d1; -// CHECK-NEXT: * _d_j; // CHECK-NEXT: } // CHECK-NEXT: { // CHECK-NEXT: i = _t0; // CHECK-NEXT: double _r_d0 = * _d_i; // CHECK-NEXT: * _d_j += _r_d0; -// CHECK-NEXT: * _d_i; // CHECK-NEXT: } // CHECK-NEXT: } @@ -149,13 +147,11 @@ void update1(double& i, double& j) { // CHECK-NEXT: j = _t1; // CHECK-NEXT: double _r_d1 = * _d_j; // CHECK-NEXT: * _d_j += _r_d1; -// CHECK-NEXT: * _d_j; // CHECK-NEXT: } // CHECK-NEXT: { // CHECK-NEXT: i = _t0; // CHECK-NEXT: double _r_d0 = * _d_i; // CHECK-NEXT: * _d_j += _r_d0; -// CHECK-NEXT: * _d_i; // CHECK-NEXT: } // CHECK-NEXT: } @@ -248,7 +244,6 @@ void twice(double& d) { // CHECK-NEXT: double _r_d0 = * _d_d; // CHECK-NEXT: * _d_d -= _r_d0; // CHECK-NEXT: * _d_d += 2 * _r_d0; -// CHECK-NEXT: * _d_d; // CHECK-NEXT: } // CHECK-NEXT: } @@ -723,7 +718,6 @@ double fn13(double* x, const double* w) { // CHECK-NEXT: wCopy[i] = clad::pop(_t1); // CHECK-NEXT: double _r_d0 = _d_wCopy[i]; // CHECK-NEXT: _d_wCopy[i] -= _r_d0; -// CHECK-NEXT: _d_wCopy[i]; // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: } diff --git a/test/Gradient/Gradients.C b/test/Gradient/Gradients.C index 2d1e935c0..ac30263e1 100644 --- a/test/Gradient/Gradients.C +++ b/test/Gradient/Gradients.C @@ -313,7 +313,6 @@ double f_cond4(double x, double y) { //CHECK-NEXT: * _d_y -= _r_d0; //CHECK-NEXT: _d_arr[i] += _r_d0 * x; //CHECK-NEXT: * _d_x += arr[i] * _r_d0; -//CHECK-NEXT: * _d_y; //CHECK-NEXT: } //CHECK-NEXT: } //CHECK-NEXT: { diff --git a/test/Gradient/Loops.C b/test/Gradient/Loops.C index 3b1f2cbca..82de66836 100644 --- a/test/Gradient/Loops.C +++ b/test/Gradient/Loops.C @@ -196,7 +196,6 @@ double f5(double x){ //CHECK-NEXT: for (; _t0; _t0--) { //CHECK-NEXT: i--; //CHECK-NEXT: x--; -//CHECK-NEXT: * _d_x; //CHECK-NEXT: } //CHECK-NEXT: } diff --git a/test/Gradient/Pointers.C b/test/Gradient/Pointers.C index 7c299425e..cf5fd322b 100644 --- a/test/Gradient/Pointers.C +++ b/test/Gradient/Pointers.C @@ -296,12 +296,10 @@ double pointerMultipleParams(const double* a, const double* b) { // CHECK-NEXT: { // CHECK-NEXT: a++; // CHECK-NEXT: _d_a.ptr_ref()++; -// CHECK-NEXT: _d_a.ptr_ref(); // CHECK-NEXT: } // CHECK-NEXT: { // CHECK-NEXT: b++; // CHECK-NEXT: _d_b.ptr_ref()++; -// CHECK-NEXT: _d_b.ptr_ref(); // CHECK-NEXT: } // CHECK-NEXT: { // CHECK-NEXT: sum = _t5; @@ -312,12 +310,10 @@ double pointerMultipleParams(const double* a, const double* b) { // CHECK-NEXT: { // CHECK-NEXT: a--; // CHECK-NEXT: _d_a.ptr_ref()--; -// CHECK-NEXT: _d_a.ptr_ref(); // CHECK-NEXT: } // CHECK-NEXT: { // CHECK-NEXT: b--; // CHECK-NEXT: _d_b.ptr_ref()--; -// CHECK-NEXT: _d_b.ptr_ref(); // CHECK-NEXT: } // CHECK-NEXT: { // CHECK-NEXT: sum = _t4; diff --git a/test/Gradient/TestTypeConversion.C b/test/Gradient/TestTypeConversion.C index 4ccaedc8b..a2cac74e1 100644 --- a/test/Gradient/TestTypeConversion.C +++ b/test/Gradient/TestTypeConversion.C @@ -41,7 +41,6 @@ void fn_type_conversion_grad(float z, int a, clad::array_ref _d_z, clad:: // CHECK-NEXT: * _d_z -= _r_d0; // CHECK-NEXT: * _d_z += _r_d0 * a; // CHECK-NEXT: * _d_a += z * _r_d0; -// CHECK-NEXT: * _d_z; // CHECK-NEXT: } // CHECK-NEXT: } // CHECK-NEXT: }