Skip to content

Commit

Permalink
Sun Dec 8 10:47:46 PM PST 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
vagrantxiao24 committed Dec 9, 2024
1 parent 6f8da1a commit 32d8f75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions getting_started/tapa_source/design/VecAdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
// Includes
#include <cstdint>
#include <tapa.h>
#define DATA_SIZE 4096
#define DATA_NUM 4096



void read_mem(tapa::mmap<const uint32_t> mem_in, tapa::ostream<uint32_t>& stream_out) {

for (int i = 0; i < DATA_SIZE; i++) {
for (int i = 0; i < DATA_NUM; i++) {
stream_out.write(mem_in[i]);
}
}

void add_kernel(tapa::istream<uint32_t>& stream_in1, tapa::istream<uint32_t>& stream_in2, tapa::ostream<uint32_t>& stream_out) {

// Compute the addition
for (int i = 0; i < DATA_SIZE; i++) {
for (int i = 0; i < DATA_NUM; i++) {
stream_out.write(stream_in1.read() + stream_in2.read());
}
}

void write_mem(tapa::istream<uint32_t>& stream_in, tapa::mmap<uint32_t> mem_out) {

for (int i = 0; i < DATA_SIZE; i++) {
for (int i = 0; i < DATA_NUM; i++) {
mem_out[i] = stream_in.read();
}
}
Expand Down

0 comments on commit 32d8f75

Please sign in to comment.