This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
/* Example code to demonstrate matrix multiplication of any appropriate dimensions using CUDA | |
* Matrix Multiplication is a routine operation in any BLAS Library , see https://docs.nvidia.com/cuda/cublas/index.html | |
* Before working with CUDA , it is advisable to go over the CUDA Documentation : | |
* https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html | |
* Author : Omar Mohamed <omarmsamir27@gmail.com> <github.com/omarsamir27> | |
* for HPC Centre in Alexandria Library <https://hpc.bibalex.org> <github.com/hpcalex> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <mpi.h> | |
#include <iomanip> | |
/* This program approximates the value of pi using the Leibniz formula. | |
The Leibniz formula for pi [1] is attributed to Gottfried Wilhelm | |
Leibniz (1646-1716) . The formula goes as follows: | |
1 - 1/3 + 1/5 - 1/7 + 1/9 - ... = pi/4 | |
This is an MPI implementation, MPI (Message Passing Interface) is a C API for multiprocessing , | |
it works for multicore , multiprocessor and multi-node setups. |