Commit e56e6d9b by Marcus Winter

dataflow_cpp: testing with and without main thread reuse

parent 7f751d55
...@@ -150,12 +150,12 @@ SimpleTest::SimpleTest() { ...@@ -150,12 +150,12 @@ SimpleTest::SimpleTest() {
#define MTAPI_DOMAIN_ID 1 #define MTAPI_DOMAIN_ID 1
#define MTAPI_NODE_ID 1 #define MTAPI_NODE_ID 1
void SimpleTest::TestBasic() { void SimpleTest::TrySimple(bool reuse_main_thread) {
// All available cores // All available cores
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) .SetReuseMainThread(reuse_main_thread ? MTAPI_TRUE : MTAPI_FALSE)
.SetCoreAffinity(core_set) .SetCoreAffinity(core_set)
.SetMaxQueues(2); .SetMaxQueues(2);
embb::mtapi::Node::Initialize( embb::mtapi::Node::Initialize(
...@@ -163,7 +163,7 @@ void SimpleTest::TestBasic() { ...@@ -163,7 +163,7 @@ void SimpleTest::TestBasic() {
MTAPI_NODE_ID, MTAPI_NODE_ID,
node_attr); node_attr);
for (int ii = 0; ii < 10000; ii++) { for (int ii = 0; ii < 1000; ii++) {
ArraySink<TEST_COUNT> asink; ArraySink<TEST_COUNT> asink;
MyNetwork network(NUM_SLICES); MyNetwork network(NUM_SLICES);
MyConstantSource constant(network, 4); MyConstantSource constant(network, 4);
...@@ -226,3 +226,7 @@ void SimpleTest::TestBasic() { ...@@ -226,3 +226,7 @@ void SimpleTest::TestBasic() {
PT_EXPECT(embb_get_bytes_allocated() == 0); PT_EXPECT(embb_get_bytes_allocated() == 0);
} }
void SimpleTest::TestBasic() {
TrySimple(false);
TrySimple(true);
}
...@@ -35,6 +35,8 @@ class SimpleTest : public partest::TestCase { ...@@ -35,6 +35,8 @@ class SimpleTest : public partest::TestCase {
private: private:
void TestBasic(); void TestBasic();
void TrySimple(bool reuse_main_thread);
}; };
#endif // DATAFLOW_CPP_TEST_DATAFLOW_CPP_TEST_SIMPLE_H_ #endif // DATAFLOW_CPP_TEST_DATAFLOW_CPP_TEST_SIMPLE_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment