Reuse each widened weight chunk across up to four activation rows. Use a scalar path when the CPU lacks AVX2 or FMA. The blocked kernel reduces scoring time for both locked models. Keep a focused test for row blocks, input tails, and optional bias.
18 lines
364 B
C++
18 lines
364 B
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
|
|
namespace neural
|
|
{
|
|
namespace detail
|
|
{
|
|
|
|
bool supports_avx2_fma();
|
|
|
|
void linear_int8_avx2(const float *x, const std::int8_t *weights, const float *scales, const float *bias,
|
|
std::size_t rows, std::size_t inputs, std::size_t outputs, float *out);
|
|
|
|
} // namespace detail
|
|
} // namespace neural
|