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
c291e97a
authored
Mar 31, 2015
by
Tobias Fuchs
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'embb448_dataflow_test' into development
parents
41613a67
4e2b486e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
4 deletions
+39
-4
dataflow_cpp/test/dataflow_cpp_test_simple.cc
+27
-3
tasks_cpp/src/queue.cc
+12
-1
No files found.
dataflow_cpp/test/dataflow_cpp_test_simple.cc
View file @
c291e97a
...
...
@@ -36,6 +36,9 @@
#include <embb/dataflow/dataflow.h>
#define NUM_SLICES 8
#define TEST_COUNT 12
typedef
embb
::
dataflow
::
Network
<
8
>
MyNetwork
;
typedef
MyNetwork
::
ConstantSource
<
int
>
MyConstantSource
;
typedef
MyNetwork
::
Source
<
int
>
MySource
;
...
...
@@ -49,8 +52,6 @@ typedef MyNetwork::Sink< int > MySink;
typedef
MyNetwork
::
Switch
<
int
>
MySwitch
;
typedef
MyNetwork
::
Select
<
int
>
MySelect
;
#define TEST_COUNT 12
embb
::
base
::
Atomic
<
int
>
source_counter
;
int
source_array
[
TEST_COUNT
];
...
...
@@ -142,8 +143,25 @@ SimpleTest::SimpleTest() {
CreateUnit
(
"dataflow_cpp simple test"
).
Add
(
&
SimpleTest
::
TestBasic
,
this
);
}
#define MTAPI_DOMAIN_ID 1
#define MTAPI_NODE_ID 1
void
SimpleTest
::
TestBasic
()
{
embb
::
tasks
::
Node
::
Initialize
(
1
,
1
);
// All available cores
embb
::
base
::
CoreSet
core_set
(
true
);
int
num_cores
=
core_set
.
Count
();
embb
::
tasks
::
Node
::
Initialize
(
MTAPI_DOMAIN_ID
,
MTAPI_NODE_ID
,
core_set
,
1024
,
// max tasks (default: 1024)
128
,
// max groups (default: 128)
// Currently needs to be initialized
// with (max_queues + 1), see defect embb449
num_cores
+
1
,
// max queues (default: 16)
1024
,
// queue capacity (default: 1024)
4
// num priorities (default: 4)
);
for
(
int
ii
=
0
;
ii
<
10000
;
ii
++
)
{
ArraySink
<
TEST_COUNT
>
asink
;
...
...
@@ -163,6 +181,7 @@ void SimpleTest::TestBasic() {
filter_array
[
kk
]
=
-
1
;
mult_array
[
kk
]
=
-
1
;
}
source_counter
=
0
;
pred_counter
=
0
;
mult_counter
=
0
;
...
...
@@ -189,7 +208,11 @@ void SimpleTest::TestBasic() {
network
.
AddSource
(
constant
);
network
.
AddSource
(
source
);
try
{
network
();
}
catch
(
embb
::
base
::
ErrorException
&
e
)
{
PT_ASSERT_MSG
(
false
,
e
.
What
());
}
PT_EXPECT
(
asink
.
Check
());
}
...
...
@@ -198,3 +221,4 @@ void SimpleTest::TestBasic() {
PT_EXPECT
(
embb_get_bytes_allocated
()
==
0
);
}
tasks_cpp/src/queue.cc
View file @
c291e97a
...
...
@@ -54,7 +54,18 @@ Queue::Queue(mtapi_uint_t priority, bool ordered) {
mtapi_job_hndl_t
job
=
mtapi_job_get
(
TASKS_CPP_JOB
,
domain_id
,
&
status
);
assert
(
MTAPI_SUCCESS
==
status
);
handle_
=
mtapi_queue_create
(
MTAPI_QUEUE_ID_NONE
,
job
,
&
attr
,
&
status
);
if
(
MTAPI_SUCCESS
!=
status
)
{
// Handle MTAPI error status in appropriate exceptions
if
(
status
==
MTAPI_SUCCESS
)
{
return
;
}
else
if
(
status
==
MTAPI_ERR_QUEUE_LIMIT
)
{
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"mtapi::Queue could not be constructed, "
"maximum number of queues exceeded"
);
}
else
if
(
status
==
MTAPI_ERR_JOB_INVALID
)
{
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"mtapi::Queue could not be constructed, "
"invalid job"
);
}
else
{
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"mtapi::Queue could not be constructed"
);
}
...
...
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