Skip to content

Commit

Permalink
Rest of them
Browse files Browse the repository at this point in the history
  • Loading branch information
pvasireddy-amd committed Nov 6, 2024
1 parent 401a55b commit 2b6e8ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 35 deletions.
20 changes: 3 additions & 17 deletions test/npu-xrt/dynamic_object_fifo/sliding_window/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include "xrt/xrt_kernel.h"

#ifndef XCLBIN
#define XCLBIN "build/final.xclbin"
#define XCLBIN "final.xclbin"
#endif

#ifndef INSTS_TXT
#define INSTS_TXT "build/insts.txt"
#define INSTS_TXT "insts.txt"
#endif

#ifndef KERNEL_NAME
Expand All @@ -28,26 +28,12 @@
#define INPUT_SIZE (100 * sizeof(int)) // in bytes
#define OUTPUT_SIZE (100 * sizeof(int)) // in bytes
#define WIDTH_SIZE (10 * sizeof(int)) // in bytes
#define WIDTH 10
#define INPUT_ROWS INPUT_SIZE / WIDTH_SIZE
#define OUTPUT_ROWS OUTPUT_SIZE / WIDTH_SIZE

#include "test_utils.h"

std::vector<uint32_t> load_instr_sequence(std::string instr_path) {
std::ifstream instr_file(instr_path);
std::string line;
std::vector<uint32_t> instr_v;
while (std::getline(instr_file, line)) {
std::istringstream iss(line);
uint32_t a;
if (!(iss >> std::hex >> a)) {
throw std::runtime_error("Unable to parse instruction file\n");
}
instr_v.push_back(a);
}
return instr_v;
}

int main(int argc, const char *argv[]) {

std::vector<uint32_t> instr_v = test_utils::load_instr_sequence(INSTS_TXT);
Expand Down
22 changes: 4 additions & 18 deletions test/npu-xrt/dynamic_object_fifo/two_core_sliding_window/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include "xrt/xrt_kernel.h"

#ifndef XCLBIN
#define XCLBIN "build/final.xclbin"
#define XCLBIN "final.xclbin"
#endif

#ifndef INSTS_TXT
#define INSTS_TXT "build/insts.txt"
#define INSTS_TXT "insts.txt"
#endif

#ifndef KERNEL_NAME
Expand All @@ -28,29 +28,15 @@
#define INPUT_SIZE (100 * sizeof(int)) // in bytes
#define OUTPUT_SIZE (100 * sizeof(int)) // in bytes
#define WIDTH_SIZE (10 * sizeof(int)) // in bytes
#define WIDTH 10
#define INPUT_ROWS INPUT_SIZE / WIDTH_SIZE
#define OUTPUT_ROWS OUTPUT_SIZE / WIDTH_SIZE

#include "test_utils.h"

std::vector<uint32_t> load_instr_sequence(std::string instr_path) {
std::ifstream instr_file(instr_path);
std::string line;
std::vector<uint32_t> instr_v;
while (std::getline(instr_file, line)) {
std::istringstream iss(line);
uint32_t a;
if (!(iss >> std::hex >> a)) {
throw std::runtime_error("Unable to parse instruction file\n");
}
instr_v.push_back(a);
}
return instr_v;
}

int main(int argc, const char *argv[]) {

std::vector<uint32_t> instr_v = load_instr_sequence(INSTS_TXT);
std::vector<uint32_t> instr_v = test_utils::load_instr_sequence(INSTS_TXT);
assert(instr_v.size() > 0);

// Get a device handle
Expand Down

0 comments on commit 2b6e8ec

Please sign in to comment.