Initial commit
This commit is contained in:
Executable
+21
@@ -0,0 +1,21 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\tin1: " << sin->in1.getValue() << std::endl
|
||||
<< "\tin2: " << sin->in2.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (sin->in2.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in2 value [" << sin->in2.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter+1 != sin->in1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 value [" << sin->in1.getValue() << "] is not equal to iterationID+1 [" << myiter+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->in1.getValue() > sin->in2.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 value [" << sin->in1.getValue() << "] is not less/equal than in2 value [" << sin->in2.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->out1.setValue(sin->in1.getValue());
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\tin2: " << sin->in2.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (sin->in2.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in2 value [" << sin->in2.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->in2.getValue() != sin->in1.getSize()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 collection size [" << sin->in1.getSize() << "] is not equal in2 [" << sin->in2.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tin1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->in1.getSize(); t++) {
|
||||
if (sin->in1.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 collection value index [" << t << "] does not have correct value [" << sin->in1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->in1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
sout->out1 = sin->in1;
|
||||
sout->isOk.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
wfr::lwd::iwir_collection<wfr::lwd::_lwd_iwir_basetype_int, 1> elements1;
|
||||
elements1.init(4);
|
||||
elements1.setEntryValue(0, 1);
|
||||
elements1.setEntryValue(1, 2);
|
||||
elements1.setEntryValue(2, 3);
|
||||
elements1.setEntryValue(3, 4);
|
||||
elements1.setFinalised(true);
|
||||
wfInput.globalIn1 = elements1;
|
||||
wfInput.globalIn2.setValue(elements1.getSize());
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tisOK: " << wfOutput.isOK.getValue() << std::endl;
|
||||
if (!wfOutput.isOK.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOK [" << wfOutput.isOK.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
|
||||
if (wfOutput.globalOut1.getSize() != wfInput.globalIn1.getSize()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut1 collection size [" << wfOutput.globalOut1.getSize() << "] is not equal globalIn1 size [" << wfInput.globalIn1.getSize() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tglobalOut1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.globalOut1.getSize(); t++) {
|
||||
if (wfOutput.globalOut1.getEntryValue(t) != wfInput.globalIn1.getEntryValue(t)) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut1 collection value index [" << t << "] does not have correct value [" << wfOutput.globalOut1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.globalOut1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
Reference in New Issue
Block a user