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
7239d842
authored
Jul 29, 2019
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Execute function nodes as parallel tasks.
parent
df021243
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
+20
-1
lib/pls/include/pls/dataflow/internal/build_state.h
+15
-0
lib/pls/include/pls/dataflow/internal/function_node.h
+5
-1
No files found.
lib/pls/include/pls/dataflow/internal/build_state.h
0 → 100644
View file @
7239d842
#ifndef PLS_DATAFLOW_INTERNAL_BUILD_STATE_H_
#define PLS_DATAFLOW_INTERNAL_BUILD_STATE_H_
namespace
pls
{
namespace
dataflow
{
namespace
internal
{
enum
class
build_state
{
fresh
,
building
,
built
,
teardown
};
}
}
}
#endif //PLS_DATAFLOW_INTERNAL_BUILD_STATE_H_
lib/pls/include/pls/dataflow/internal/function_node.h
View file @
7239d842
...
...
@@ -14,6 +14,7 @@
#include "outputs.h"
#include "pls/internal/helpers/seqence.h"
#include "pls/pls.h"
namespace
pls
{
namespace
dataflow
{
...
...
@@ -75,12 +76,15 @@ class function_node<pls::dataflow::inputs<I0, I...>, pls::dataflow::outputs<O0,
}
void
execute_function
(
invocation_memory
*
invocation_memory
,
invocation_info
invocation_info
)
{
auto
lambda
=
[
&
]()
{
input_tuple
&
inputs
=
invocation_memory
->
input_buffer_
;
output_tuple
outputs
;
execute_function_internal
(
inputs
,
typename
sequence_gen
<
1
+
sizeof
...(
I
)
>::
type
(),
outputs
,
typename
sequence_gen
<
1
+
sizeof
...(
O
)
>::
type
(),
invocation_info
);
};
// TODO: maybe replace this with 'continuation' style invocation
pls
::
scheduler
::
spawn_child_and_wait
<
pls
::
lambda_task_by_reference
<
decltype
(
lambda
)
>>
(
lambda
);
}
template
<
typename
T
>
void
set_invocation_info
(
token
<
T
>
&
token
,
invocation_info
invocation_info
)
{
...
...
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