Final Project for CS 550 Computer Architecture Team member: Webster Bei, Yanming Lai, Joey Liang
This repository contains code for generating random samples according to a given distribution function using the independent Metropolis-Hastings algorithm. There are three different sub-directories in this repository.
- MCMC_CPU: implementation on CPU
- MCMC_CUDA: implementation on CUDA, using only a single thread from a single block
- MCMC_CUDA_Parallel: implementation on CUDA, one can specify the number of blocks and number of threads per block through the commandline input
Compile
make
Run
./main.o [number_of_samples]
Compile
make
Run
./main.o [number_of_samples]
Compile
make
Run
./main.o [number_of_samples] [number_of_blocks] [number_of_threads_per_block]
The programs will output a samples.csv file which contains all the random samples generated. There will also be console output that details the amount of time that the program spent on memory allocation and actual computation.