Skip to content

Commit

Permalink
Modified the dump function to print a more readable output.
Browse files Browse the repository at this point in the history
Previously the dump function printed the code immediately after "The code is"
which made the actual code less readable. Now a '\n' character has been added
after "The code is" so that the actual code starts from a new line, making it more
readable.

This patch fixes #377
  • Loading branch information
Nirhar authored and vgvassilev committed May 25, 2022
1 parent a2ed7f2 commit 6f98627
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/clad/Differentiator/Differentiator.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ namespace clad {
}

void dump() const {
printf("The code is: %s\n", getCode());
printf("The code is: \n%s\n", getCode());
}

/// Set object pointed by the functor as the default object for
Expand Down
3 changes: 2 additions & 1 deletion test/Misc/RunDemos.C
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@

// RUN: ./CustomModelTest.out | FileCheck -check-prefix CHECK_CUSTOM_MODEL_EXEC %s
// CHECK_CUSTOM_MODEL_EXEC-NOT:{{.*error|warning|note:.*}}
// CHECK_CUSTOM_MODEL_EXEC: The code is: void func_grad(float x, float y, clad::array_ref<float> _d_x, clad::array_ref<float> _d_y, double &_final_error) {
// CHECK_CUSTOM_MODEL_EXEC: The code is:
// CHECK_CUSTOM_MODEL_EXEC-NEXT: void func_grad(float x, float y, clad::array_ref<float> _d_x, clad::array_ref<float> _d_y, double &_final_error) {
// CHECK_CUSTOM_MODEL_EXEC-NEXT: float _d_z = 0;
// CHECK_CUSTOM_MODEL_EXEC-NEXT: double _delta_z = 0;
// CHECK_CUSTOM_MODEL_EXEC-NEXT: float _EERepl_z0;
Expand Down

0 comments on commit 6f98627

Please sign in to comment.