Conversation
…, instead of const reference, to be more consistent with the reality of the variables and values. If nvcc where very strict, or there where no inlining in one function, it would trigger local memory usage.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request changes function parameters from const T& (const reference) to const T (const value) for device function parameters in CUDA/HIP kernels. The motivation is to avoid local memory accesses on GPUs when passing small computed types like Point and Size, which are more efficiently passed by value on GPU architectures.
Changes:
- Modified parameter passing convention from const reference to const value for small computed types (Point, Size, etc.) across device functions
- Updated get_opt function in operation_tuple.h to use forwarding references for better flexibility
- Consolidated multiple get function overloads in tuple.h into a single templated version using perfect forwarding
- Removed an unused build_details function overload in data_parallel_patterns.h
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| operation_tuple.h | Updated get_opt to use forwarding references; improved comment clarity |
| tuple.h | Consolidated four get overloads into one using perfect forwarding |
| vector_operations.h | Changed exec parameters for UnaryType and BinaryV operations to pass by value |
| parent_operations.h | Updated macros to pass Point and InputType parameters by value |
| instantiable_operations.h | Changed InputFoldType constructor and operator| parameters to pass by value |
| fused_operation.h | Updated exec_helper methods to pass Point and InputType by value |
| batch_operations.h | Changed exec and utility function parameters to pass by value, including ThreadFusionType |
| data_parallel_patterns.h | Updated operate/execute methods; removed unused build_details overload |
| rect.h, rawptr.h, ptr_nd.h | Changed Point and Size parameters in constructors/methods to pass by value |
| warping.h, saturate.h, resize.h, etc. | Updated algorithm exec functions to pass small types by value |
| memory_operations.h | Changed parameters including ThreadFusionType to pass by value |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
include/fused_kernel/core/execution_model/operation_model/batch_operations.h
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.