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

Add benchmark for expression templates #634

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

vaithak
Copy link
Collaborator

@vaithak vaithak commented Oct 3, 2023

  • also added const& qualifiers while creating array_expression objects to avoid the copying of arrays.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

clang-tidy review says "All clean, LGTM! 👍"

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #634 (0ab1f9a) into master (bba8a47) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #634   +/-   ##
=======================================
  Coverage   94.05%   94.05%           
=======================================
  Files          43       43           
  Lines        6237     6237           
=======================================
  Hits         5866     5866           
  Misses        371      371           

benchmark/mybenchmark Outdated Show resolved Hide resolved
@vaithak vaithak force-pushed the benchmark-exptemp branch from 430293a to 01bf9b1 Compare October 3, 2023 12:50
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

clang-tidy review says "All clean, LGTM! 👍"

@vaithak vaithak force-pushed the benchmark-exptemp branch from 01bf9b1 to 432377d Compare October 3, 2023 14:37
@vaithak
Copy link
Collaborator Author

vaithak commented Oct 3, 2023

results of the benchmark from github action:

-----------------------------------------------------------------
Benchmark                       Time             CPU   Iterations
-----------------------------------------------------------------
BM_ExpressionTemplates       1216 ns         1214 ns       576674
BM_ManualTemporaries         2495 ns         2495 ns       280512
BM_LoopsOnCladArrays         1008 ns         1008 ns       693204
BM_LoopsOnNativeArrays       1212 ns         1212 ns       577641

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

clang-tidy review says "All clean, LGTM! 👍"

return array_expression<T, BinarySub, array<T>>(static_cast<T>(0), *this);
CUDA_HOST_DEVICE array_expression<T, BinarySub, array<T> const&>
operator-() const {
return array_expression<T, BinarySub, array<T> const&>(static_cast<T>(0),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return array_expression<T, BinarySub, array<T> const&>(static_cast<T>(0),
return array_expression<T, BinarySub, const array<T>&>(static_cast<T>(0),

We spell const in clad this way. Can you update the rest of the occurrences?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed and also added to .clang-format

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

clang-tidy review says "All clean, LGTM! 👍"

@vaithak vaithak force-pushed the benchmark-exptemp branch from 272bb99 to 0ab1f9a Compare October 3, 2023 18:32
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Owner

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vgvassilev vgvassilev merged commit 41699e8 into vgvassilev:master Oct 3, 2023
77 checks passed
@vaithak vaithak deleted the benchmark-exptemp branch March 13, 2024 13:23
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

Successfully merging this pull request may close these issues.

2 participants