Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
48804e8f
authored
Apr 11, 2019
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add notes on why anonymous, generic lambda wrappers are not possible in our context.
parent
6802681d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
NOTES.md
+23
-0
No files found.
NOTES.md
View file @
48804e8f
...
@@ -4,6 +4,29 @@ A collection of stuff that we noticed during development.
...
@@ -4,6 +4,29 @@ A collection of stuff that we noticed during development.
Useful later on two write a project report and to go back
Useful later on two write a project report and to go back
in time to find out why certain decisions where made.
in time to find out why certain decisions where made.
## 11.04.2019 - Lambda Pointer Abstraction
The question is if we could use a pointer to a lambda without
needing templating (for the type of the lambda) at the place that
we use it.
We looked into different techniques to achieve this:
-
Using std::function
<
...
>
-
Using custom wrappers
std::function uses dynamic memory, thus ruling it out.
All methods that we can think of involve storing a pointer
to the lambda and then calling on it later on.
This works well enough with a simple wrapper, but has one
major downside: It involves virtual function calls,
making it impossible to inline the lambda.
This property broke the technique for us in most places,
as inlining is crucial, especially in small functions like loop
iterations. See
`invoke_parallel_impl.h`
for an example where we
did this (wrapper with virtual function call), but we only did it there,
as the generic
`fork_join_sub_task`
requires the virtual call anyway,
thus making us not loose ANY performance with this technique.
## 11.04.2019 - Notes on C++ Templating
## 11.04.2019 - Notes on C++ Templating
After working more with templating and talking to mike,
After working more with templating and talking to mike,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment