MLIR-AIE 1.4.5.dev
test_utils.h File Reference
#include "cxxopts.hpp"
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
Include dependency graph for test_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  xrt
namespace  test_utils

Macros

#define print_row(what)

Typedefs

using test_utils::bfloat16_t = std::uint16_t

Functions

void test_utils::check_arg_file_exists (const cxxopts::ParseResult &result, std::string name)
void test_utils::add_default_options (cxxopts::Options &options)
void test_utils::parse_options (int argc, const char *argv[], cxxopts::Options &options, cxxopts::ParseResult &result)
std::vector< uint32_t > test_utils::load_instr_sequence (std::string instr_path)
std::vector< uint32_t > test_utils::load_instr_binary (std::string instr_path)
std::string test_utils::get_kernel_name (const xrt::xclbin &xclbin, const std::string &name_prefix, int verbosity=0)
void test_utils::init_xrt_load_kernel (xrt::device &device, xrt::kernel &kernel, int verbosity, std::string xclbinFileName, std::string kernelNameInXclbin)
bool test_utils::nearly_equal (float a, float b, float epsilon=128 *FLT_EPSILON, float abs_th=FLT_MIN)
template<typename T>
void test_utils::print_matrix (const std::vector< T > matrix, int n_cols, int n_printable_rows=10, int n_printable_cols=10, std::ostream &ostream=std::cout, const char col_sep[]=" ", const char elide_sym[]=" ... ", int w=-1)
void test_utils::write_out_trace (char *traceOutPtr, size_t trace_size, std::string path)

Macro Definition Documentation

◆ print_row

#define print_row ( what)
Value:
for (int col = 0; col < n_printable_cols / 2; col++) { \
ostream << std::right << std::setw(w) << (what); \
ostream << std::setw(0) << col_sep; \
} \
if (elide_cols) { \
ostream << std::setw(0) << elide_sym; \
} \
for (int col = n_printable_cols / 2 + 1; col < n_printable_cols; col++) { \
ostream << std::right << std::setw(w) << (what); \
ostream << std::setw(0) << col_sep; \
}

Referenced by test_utils::print_matrix().