From the course: Complete Guide to Parallel and Concurrent Programming with C++
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Solution: Matrix multiply - C++ Tutorial
From the course: Complete Guide to Parallel and Concurrent Programming with C++
Solution: Matrix multiply
(upbeat music) - [Instructor] To design our parallel solution for the matrix multiplication challenge, we began with domain decomposition to consider ways that we could partition this problem. One very convenient aspect of matrix multiplication is that every element in the result matrix C can be calculated independently. For example, calculating element C two one only requires knowledge of row two from matrix A and column one from matrix B. Likewise, calculating C zero two only requires row zero from A and column two from B. The elements of matrix C don't need to know anything about any other elements in C. So calculating the individual elements of C for a four by three result matrix can be partitioned into 12 independent tasks. This type of problem is sometimes called embarrassingly parallel because it breaks apart so easily and doesn't require communication between each of the tasks. Now that can turn into a lot of tasks, especially for a large result matrix. So we decided to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.