Git Product home page Git Product logo

matrix-multiplication's Introduction

Matrix Multiplication

The purpose of the project is to multiply two matrices in the size of 1K to 5K in 3 different ways and analyze the effects on performance.

The multiplication of two matrices is to be implemented as:

  • a serial program
  • an OpenMP shared memory program (parallel)
  • a loop blocking method program

Installation

You can install the application with clone this repository by the commands given below

# clone the repository
$ git clone https://github.com/selenkutanoglu/Matrix-Multiplication

Editing

Matix size, value type of the matrix and the block size of for looping part defined as macro variables in functions.h file.

#define SIZE 1000       //Set the size of matrix
#define type double     //Set the type of matrix (double - float)
#define block_size 10   //System block size (optimum value as a result of tests)

Project Files

. bFunctions.cpp          loop blocing program functions
. functions.h             whole funtions declarations, matrix parameters and libraries needed
. main.cpp                main program 
. pFunctions.cpp          OpenMP parallel program functions
. README.md               This README file you're looking
. sFunctions.cpp          serial program functions

Compile and run

To compile the serial program, sFunctions.cpp and main.cpp will be to compiled with g++ and object file named as serial.

$ g++ -o serial sFunctions.cpp main.cpp
$ ./serial

To compile the OpenMP parallel program, pFunctions.cpp and main.cpp will be to compiled with g++ (with -fopenmp parameter) and object file named as parallel.

$ g++ -O -Wall -std=c++0x -g -fopenmp -o parallel pFunctions.cpp main.cpp
$ ./parallel

To compile the loop blocking program, bFunctions.cpp and main.cpp will be to compiled with g++ and object file named as block.

$ g++ -o block bFunctions.cpp main.cpp
$ ./block

matrix-multiplication's People

Contributors

selenoruc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.