Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. #include 2. void dgemm (int n, double* A, double* B, double* C) 3. { 4. for (int i = 0; i < n; i

1. #include 2. void dgemm (int n, double* A, double* B, double* C) 3. { 4. for (int i = 0; i < n; i += 4) 5. for (int j = 0; j < n; j++) { 6. __m256 c0 = _mm256_load_pd(C + i + j * n); /*c0 = C[i][j]*/ 7. for (int k = 0; k < n ; k++) 8. c0 = _mm256_add_pd (c0 , /*c0 += A[i][k] * B[k][j] */ 9. _mm256_mul_pd (_mm256_load_pd(A+i+k*n), 10. _mm256_broadcast_sd(B+k+j*n))); 11. _mm256_store_pd(C+i+j*n, c0); /* C[i][j] = c0 */ 12. } 13. } In line 10, what is the intrinsic function " __m256_broadcast_sd(B+k+j*n)" trying to do?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions