Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
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
55983af6
authored
Oct 27, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataflow_cpp: moved processing of sources to worker threads
parent
754854ab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
1 deletions
+21
-1
dataflow_cpp/include/embb/dataflow/internal/scheduler.h
+3
-0
dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h
+10
-0
dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h
+5
-0
dataflow_cpp/include/embb/dataflow/internal/source.h
+2
-1
dataflow_cpp/test/dataflow_cpp_test_simple.cc
+1
-0
No files found.
dataflow_cpp/include/embb/dataflow/internal/scheduler.h
View file @
55983af6
...
@@ -46,6 +46,9 @@ class Scheduler {
...
@@ -46,6 +46,9 @@ class Scheduler {
int
process_id
,
int
process_id
,
Action
&
action
,
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
=
0
;
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
=
0
;
virtual
void
Run
(
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
=
0
;
virtual
void
WaitForSlice
(
int
slice
)
=
0
;
virtual
void
WaitForSlice
(
int
slice
)
=
0
;
virtual
int
GetSlices
()
=
0
;
virtual
int
GetSlices
()
=
0
;
};
};
...
...
dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h
View file @
55983af6
...
@@ -105,6 +105,16 @@ class SchedulerMTAPI : public Scheduler {
...
@@ -105,6 +105,16 @@ class SchedulerMTAPI : public Scheduler {
group_
[
idx
].
Start
(
job_
,
&
action
,
static_cast
<
void
*>
(
NULL
),
group_
[
idx
].
Start
(
job_
,
&
action
,
static_cast
<
void
*>
(
NULL
),
task_attr
);
task_attr
);
}
}
virtual
void
Run
(
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
{
embb
::
mtapi
::
Node
&
node
=
embb
::
mtapi
::
Node
::
GetInstance
();
embb
::
mtapi
::
TaskAttributes
task_attr
;
task_attr
.
SetPolicy
(
policy
);
embb
::
mtapi
::
Task
task
=
node
.
Start
(
job_
,
&
action
,
static_cast
<
void
*>
(
NULL
),
task_attr
);
task
.
Wait
();
}
virtual
void
Enqueue
(
virtual
void
Enqueue
(
int
process_id
,
int
process_id
,
Action
&
action
,
Action
&
action
,
...
...
dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h
View file @
55983af6
...
@@ -43,6 +43,11 @@ class SchedulerSequential : public Scheduler {
...
@@ -43,6 +43,11 @@ class SchedulerSequential : public Scheduler {
embb
::
mtapi
::
ExecutionPolicy
const
&
)
{
embb
::
mtapi
::
ExecutionPolicy
const
&
)
{
action
.
RunSequential
();
action
.
RunSequential
();
}
}
virtual
void
Run
(
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
)
{
action
.
RunSequential
();
}
virtual
void
Enqueue
(
virtual
void
Enqueue
(
int
,
int
,
Action
&
action
,
Action
&
action
,
...
...
dataflow_cpp/include/embb/dataflow/internal/source.h
View file @
55983af6
...
@@ -67,7 +67,8 @@ class Source< Outputs<O1, O2, O3, O4, O5> >
...
@@ -67,7 +67,8 @@ class Source< Outputs<O1, O2, O3, O4, O5> >
virtual
bool
Start
(
int
clock
)
{
virtual
bool
Start
(
int
clock
)
{
if
(
not_done_
)
{
if
(
not_done_
)
{
Run
(
clock
);
Action
act
(
this
,
clock
);
sched_
->
Run
(
act
,
embb
::
mtapi
::
ExecutionPolicy
());
}
}
return
not_done_
;
return
not_done_
;
}
}
...
...
dataflow_cpp/test/dataflow_cpp_test_simple.cc
View file @
55983af6
...
@@ -155,6 +155,7 @@ void SimpleTest::TestBasic() {
...
@@ -155,6 +155,7 @@ void SimpleTest::TestBasic() {
embb
::
base
::
CoreSet
core_set
(
true
);
embb
::
base
::
CoreSet
core_set
(
true
);
embb
::
mtapi
::
NodeAttributes
node_attr
;
embb
::
mtapi
::
NodeAttributes
node_attr
;
node_attr
node_attr
.
SetReuseMainThread
(
MTAPI_TRUE
)
.
SetCoreAffinity
(
core_set
)
.
SetCoreAffinity
(
core_set
)
.
SetMaxQueues
(
2
);
.
SetMaxQueues
(
2
);
embb
::
mtapi
::
Node
::
Initialize
(
embb
::
mtapi
::
Node
::
Initialize
(
...
...
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