DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
tpglibs
include
tpglibs
AVXUtils.hpp
Go to the documentation of this file.
1
8
9
#include <fmt/core.h>
10
#include <fmt/ranges.h>
11
#include <immintrin.h>
12
13
#include <array>
14
15
#ifndef TPGLIBS_AVXUTILS_HPP_
16
#define TPGLIBS_AVXUTILS_HPP_
17
18
namespace
tpglibs
{
19
29
inline
__m256i
30
_mm256_div_epi16
(
const
__m256i& va,
const
int16_t& b)
31
{
32
// NaiveUtils.hpp has the lay version.
33
__m256i vb = _mm256_set1_epi16(32768 / b);
34
return
_mm256_mulhrs_epi16(va, vb);
35
}
36
47
inline
void
48
_mm256_print_epi16
(
const
__m256i& input)
49
{
50
std::array<int16_t, 16> prints;
51
_mm256_storeu_si256(
reinterpret_cast<
__m256i*
>
(prints.begin()), input);
52
53
fmt::print(
"{}"
, prints);
54
}
55
56
}
// namespace tpglibs
57
58
#endif
// TPGLIBS_AVXUTILS_HPP_
tpglibs
Definition
AbstractFactory.hpp:20
tpglibs::_mm256_div_epi16
__m256i _mm256_div_epi16(const __m256i &va, const int16_t &b)
Hack-ish AVX division function.
Definition
AVXUtils.hpp:30
tpglibs::_mm256_print_epi16
void _mm256_print_epi16(const __m256i &input)
AVX printing function.
Definition
AVXUtils.hpp:48
Generated on
for DUNE-DAQ by
1.18.0