40 #if defined(__x86_64__) || defined(__amd64__) || defined(__amd64)
50 #include <immintrin.h>
59 void gpmp::linalg::Mtx::mtx_add(
const float *
A,
65 for (
int i = 0; i <
rows; ++i) {
68 for (; j <
cols - 7; j += 8) {
70 __m256 a = _mm256_loadu_ps(&
A[i *
cols + j]);
71 __m256 b = _mm256_loadu_ps(&
B[i *
cols + j]);
72 __m256 c = _mm256_loadu_ps(&
C[i *
cols + j]);
74 c = _mm256_add_ps(a, b);
77 _mm256_storeu_ps(&
C[i *
cols + j], c);
81 for (; j <
cols; ++j) {
void std_mtx_add(const T *A, const T *B, T *C, int rows, int cols)
Perform matrix addition on two matrices as flat arrays.