Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eddierichter-amd committed Mar 20, 2024
1 parent df33295 commit 77958f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions reference_designs/IRON-examples/vector_add/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int main(int argc, const char *argv[]) {
uint32_t *bufInB = bo_inB.map<uint32_t *>();
std::vector<uint32_t> srcVecB;
for (int i = 0; i < IN_SIZE; i++)
srcVecA.push_back(i);
srcVecB.push_back(i);
memcpy(bufInB, srcVecB.data(), (srcVecB.size() * sizeof(uint32_t)));

void *bufInstr = bo_instr.map<void *>();
Expand All @@ -175,13 +175,12 @@ int main(int argc, const char *argv[]) {
int errors = 0;

for (uint32_t i = 0; i < 64; i++) {
uint32_t ref = i + 2;
if (*(bufOut + i) != *(bufInA + i) + *(bufInB + i) ) {
std::cout << "Error in output " << *(bufOut + i) << " != " << *(bufInA + i) << " + " << *(bufInB + i)
<< std::endl;
errors++;
} else {
std::cout << "Correct output " << *(bufOut + i) << " == " << ref
std::cout << "Correct output " << *(bufOut + i) << " == " << *(bufInA + i) + *(bufInB + i)
<< std::endl;
}
}
Expand Down
4 changes: 2 additions & 2 deletions reference_designs/IRON-examples/vector_mult/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int main(int argc, const char *argv[]) {
uint32_t *bufInB = bo_inB.map<uint32_t *>();
std::vector<uint32_t> srcVecB;
for (int i = 0; i < IN_SIZE; i++)
srcVecA.push_back(i);
srcVecB.push_back(i);
memcpy(bufInB, srcVecB.data(), (srcVecB.size() * sizeof(uint32_t)));

void *bufInstr = bo_instr.map<void *>();
Expand Down Expand Up @@ -181,7 +181,7 @@ int main(int argc, const char *argv[]) {
<< std::endl;
errors++;
} else {
std::cout << "Correct output " << *(bufOut + i) << " == " << ref
std::cout << "Correct output " << *(bufOut + i) << " == " << *(bufInA + i) * *(bufInB + i)
<< std::endl;
}
}
Expand Down

0 comments on commit 77958f9

Please sign in to comment.