Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Print.h - github.com/marian-nmt/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 42001d5ee2a2a8c35e626e4f0033a3d1bb6ba33d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <stdint.h>
#include <iostream>

namespace intgemm {

template <class T> T PrintWrap(const T val) {
  return val;
}
inline int16_t PrintWrap(const int8_t val) {
  return val;
}

template <class T, class Reg> void Print(const Reg reg) {
  const T *val = reinterpret_cast<const T*>(&reg);
  for (std::size_t i = 0; i < sizeof(Reg) / sizeof(T); ++i) {
    std::cout << ' ' << PrintWrap(val[i]);
  }
}

} // namespace intgemm