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
5 years ago
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Execute function nodes as parallel tasks.
parent
df021243
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
lib/pls/include/pls/dataflow/internal/build_state.h
+15
-0
lib/pls/include/pls/dataflow/internal/function_node.h
+10
-6
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_
This diff is collapsed.
Click to expand it.
lib/pls/include/pls/dataflow/internal/function_node.h
View file @
7239d842
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include "outputs.h"
#include "outputs.h"
#include "pls/internal/helpers/seqence.h"
#include "pls/internal/helpers/seqence.h"
#include "pls/pls.h"
namespace
pls
{
namespace
pls
{
namespace
dataflow
{
namespace
dataflow
{
...
@@ -75,12 +76,15 @@ class function_node<pls::dataflow::inputs<I0, I...>, pls::dataflow::outputs<O0,
...
@@ -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
)
{
void
execute_function
(
invocation_memory
*
invocation_memory
,
invocation_info
invocation_info
)
{
input_tuple
&
inputs
=
invocation_memory
->
input_buffer_
;
auto
lambda
=
[
&
]()
{
output_tuple
outputs
;
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
);
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
>
template
<
typename
T
>
void
set_invocation_info
(
token
<
T
>
&
token
,
invocation_info
invocation_info
)
{
void
set_invocation_info
(
token
<
T
>
&
token
,
invocation_info
invocation_info
)
{
...
...
This diff is collapsed.
Click to expand it.
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