Skip to content

BhoomishGupta/matrix-multiplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Matrix Multiplication with HPX

Parallel matrix multiplication using HPX (High Performance ParalleX), a C++ standard library for parallelism and concurrency.

Overview

This project multiplies two N × N matrices (double) in parallel using hpx::experimental::for_loop with the par execution policy — each row of the result is computed on a separate HPX thread.

Two storage layouts are provided (compile-time selectable):

Mode Storage Toggle
1D (default) Flat std::vector<double> with IDX(i,j) macro USE_2D = false
2D std::vector<std::vector<double>> USE_2D = true

Prerequisites

  • CMake ≥ 3.18
  • C++17 compatible compiler
  • HPX library installed and discoverable by CMake

Build & Run

# Configure (adjust HPX_DIR if needed)
cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/hpx

# Build
cmake --build build

# Run
./build/matrix_mult

Example Output

HPX parallel matrix multiply (1024x1024) — 1D layout
2048  (expected 2048)

Configuration

Edit the constants at the top of main.cpp:

constexpr bool USE_2D = false;  // switch to true for 2D layout
constexpr int N = 1024;         // matrix dimension

Project Structure

├── CMakeLists.txt   # Build configuration
├── main.cpp         # Matrix multiplication implementation
└── README.md

License

This project is unlicensed — feel free to use it however you like.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors