41 #if defined(__x86_64__) || defined(__amd64__) || defined(__amd64)
51 #include <immintrin.h>
68 for (; i < size - 15; i += 16) {
69 __m256i a = _mm256_loadu_si256(
70 reinterpret_cast<const __m256i *
>(data1 + i));
71 __m256i b = _mm256_loadu_si256(
72 reinterpret_cast<const __m256i *
>(data2 + i));
73 __m256i c = _mm256_add_epi8(a, b);
74 _mm256_storeu_si256(
reinterpret_cast<__m256i *
>(result_data + i),
78 for (; i < size; ++i) {
79 result_data[i] = data1[i] + data2[i];
84 const std::vector<int16_t> &vec2,
85 std::vector<int16_t> &result) {
87 const size_t size = vec1.size();
92 const std::vector<uint16_t> &vec2,
93 std::vector<uint16_t> &result) {
94 const size_t size = vec1.size();
void vector_add_i16(const T *data1, const T *data2, T *result_data, size_t size)
Performs vector addition for signed 16-bit integers.
void vector_add(const std::vector< int8_t > &vec1, const std::vector< int8_t > &vec2, std::vector< int8_t > &result)
Performs vector addition for vectors of signed 8-bit integers.