Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the usage of LIBCLAD_TIMING environment variable #790

Closed
DeadSpheroid opened this issue Mar 1, 2024 · 3 comments
Closed

Document the usage of LIBCLAD_TIMING environment variable #790

DeadSpheroid opened this issue Mar 1, 2024 · 3 comments

Comments

@DeadSpheroid
Copy link
Contributor

The LIBCLAD_TIMING environment variable seen here

clad/tools/ClangPlugin.cpp

Lines 202 to 208 in f242077

#if CLANG_VERSION_MAJOR > 11
bool WantTiming =
getenv("LIBCLAD_TIMING") || m_CI.getCodeGenOpts().TimePasses;
#else
bool WantTiming =
getenv("LIBCLAD_TIMING") || m_CI.getFrontendOpts().ShowTimers;
#endif

needs to documented in some form
Its usage is seen in the performance tests and it serves to print the timings of only clad function calls rather than the compilation phases.
References #779
Example usage:

~/Projects 
❯ LIBCLAD_TIMING=1 clang++ -std=c++11 -I /home/warrenjacinto/Projects/clad/include/ -fplugin=/home/warrenjacinto/Projects/inst/lib/clad.so -lstdc++ -lm issue769.cpp -o issue769
===-------------------------------------------------------------------------===
                             Timers for Clad Funcs
===-------------------------------------------------------------------------===
  Total Execution Time: 0.0421 seconds (0.0531 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   0.0143 ( 37.5%)   0.0040 ( 99.6%)   0.0183 ( 43.4%)   0.0256 ( 48.1%)  fn
   0.0159 ( 41.8%)   0.0000 (  0.0%)   0.0159 ( 37.8%)   0.0197 ( 37.0%)  grad_func
   0.0042 ( 11.1%)   0.0000 (  0.0%)   0.0042 ( 10.0%)   0.0042 (  8.0%)  fn2
   0.0024 (  6.4%)   0.0000 (  0.4%)   0.0024 (  5.8%)   0.0024 (  4.6%)  fnr
   0.0012 (  3.2%)   0.0000 (  0.0%)   0.0012 (  2.9%)   0.0012 (  2.3%)  fns
   0.0381 (100.0%)   0.0040 (100.0%)   0.0421 (100.0%)   0.0531 (100.0%)  Total


~/Projects took 12s 
❯ 
@vgvassilev
Copy link
Owner

I am wondering if should have a separate env variable when we have a flag now...

@DeadSpheroid
Copy link
Contributor Author

DeadSpheroid commented Mar 1, 2024

It doesnt seem necessary yes, im wondering what purpose the performance tests serve? Far as i can tell they seem defunct.

@vgvassilev
Copy link
Owner

vgvassilev commented Mar 2, 2024

Let's remove it. We need to change the tests if needed to the new option.

MihailMihov added a commit to MihailMihov/clad that referenced this issue May 16, 2024
MihailMihov added a commit to MihailMihov/clad that referenced this issue May 16, 2024
MihailMihov added a commit to MihailMihov/clad that referenced this issue May 16, 2024
MihailMihov added a commit to MihailMihov/clad that referenced this issue May 17, 2024
MihailMihov added a commit to MihailMihov/clad that referenced this issue May 17, 2024
MihailMihov added a commit to MihailMihov/clad that referenced this issue May 17, 2024
MihailMihov added a commit to MihailMihov/clad that referenced this issue May 17, 2024
vgvassilev pushed a commit to MihailMihov/clad that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants