-
Notifications
You must be signed in to change notification settings - Fork 20
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
Removal of Pointless References in Function Args #946
Conversation
There are actually quite a few places inside curve and message iterator functions where this might save a few registers. |
Much of the device API stuff is marked inline/forceinline. So if it is actually being inlined, the function calls are presumably irrelevant. |
Template types have also been modified to be passed by value. This may be detrimental if we decide to support complex types in the future although (as Rob has pointed out) most of the device functions are inlined so copies wouldn't need to be made for function calls. All C++ tests pass Python tests not run due to #939. |
Windows/Release/SEATBELTS=ON tests pass. I need to look through the code changes before I put a review in though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked through all the changes, added a bunch of suggestions where I think you made mistakes. However, given the length of changes my eyes may have glazed over and missed some.
Doesn't appear you changed any non-const references, which is where I was worried issues may occur.
Additionally you should probably do:
cudaStream_t
doesn't need to be a reference, it's merely a typedef for a ptr
size_t
too (CUDAScatter.cuh:243
)
Tests all pased for a debug build under linux (C++ and python). I won't do a full review right now, but will take a look when Rob's suggestions have been resolved to see if any bits still jump out. It's possible to run the python tests as long as you do it one folder at a time, which somehow avoids the gc related issues (usually) |
Additional types added. Tests passing with SEATBELTS. |
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
Co-authored-by: Robert Chisholm <r.chisholm@sheffield.ac.uk>
8f5afa2
to
312259d
Compare
Fixes #825
Data types fixed
Each items has been searched for using
const type &
as well asconst type&
as linting allows either.Where const references appear in declarations they have been made primitive (pass by value) type argument and
const
has been removed as it is meaningless. Within definitionsconst
primitive types are allowed as this signals an intention that the argument should not be changed in the function body.