Accelerating Matrix Multiplication: A Performance Comparison Between Multi-Core CPU and GPU

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Ansari, Mufakir Qamar, Ansari, Mudabir Qamar
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916867862429696
author Ansari, Mufakir Qamar
Ansari, Mudabir Qamar
author_facet Ansari, Mufakir Qamar
Ansari, Mudabir Qamar
contents Matrix multiplication is a foundational operation in scientific computing and machine learning, yet its computational complexity makes it a significant bottleneck for large-scale applications. The shift to parallel architectures, primarily multi-core CPUs and many-core GPUs, is the established solution, and these systems are now ubiquitous from datacenters to consumer laptops. This paper presents a direct, empirical performance analysis of matrix multiplication on a modern, consumer-grade heterogeneous platform. We implemented and benchmarked three versions of the algorithm: a baseline sequential C++ implementation, a parallel version for its multi-core CPU using OpenMP, and a massively parallel version for its discrete GPU using CUDA with shared memory optimizations. The implementations were evaluated with square matrices of varying dimensions, from 128x128 to 4096x4096. Our results show that while the parallel CPU provides a consistent speedup of 12-14x over the sequential version, the GPU's performance scales dramatically with problem size. For a 4096x4096 matrix, the GPU implementation achieved a speedup of approximately 593x over the sequential baseline and 45x over the optimized parallel CPU version. These findings quantitatively demonstrate the profound impact of many-core GPU architectures on accelerating data-parallel workloads, underscoring that significant performance gains are readily accessible even on consumer-level hardware.
format Preprint
id arxiv_https___arxiv_org_abs_2507_19723
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Accelerating Matrix Multiplication: A Performance Comparison Between Multi-Core CPU and GPU
Ansari, Mufakir Qamar
Ansari, Mudabir Qamar
Distributed, Parallel, and Cluster Computing
Primary 68W10, Secondary 65Y05, 68M20
C.1.2; C.4; D.1.3
Matrix multiplication is a foundational operation in scientific computing and machine learning, yet its computational complexity makes it a significant bottleneck for large-scale applications. The shift to parallel architectures, primarily multi-core CPUs and many-core GPUs, is the established solution, and these systems are now ubiquitous from datacenters to consumer laptops. This paper presents a direct, empirical performance analysis of matrix multiplication on a modern, consumer-grade heterogeneous platform. We implemented and benchmarked three versions of the algorithm: a baseline sequential C++ implementation, a parallel version for its multi-core CPU using OpenMP, and a massively parallel version for its discrete GPU using CUDA with shared memory optimizations. The implementations were evaluated with square matrices of varying dimensions, from 128x128 to 4096x4096. Our results show that while the parallel CPU provides a consistent speedup of 12-14x over the sequential version, the GPU's performance scales dramatically with problem size. For a 4096x4096 matrix, the GPU implementation achieved a speedup of approximately 593x over the sequential baseline and 45x over the optimized parallel CPU version. These findings quantitatively demonstrate the profound impact of many-core GPU architectures on accelerating data-parallel workloads, underscoring that significant performance gains are readily accessible even on consumer-level hardware.
title Accelerating Matrix Multiplication: A Performance Comparison Between Multi-Core CPU and GPU
topic Distributed, Parallel, and Cluster Computing
Primary 68W10, Secondary 65Y05, 68M20
C.1.2; C.4; D.1.3
url https://arxiv.org/abs/2507.19723