This is a CUDA program to multiply two matrices Pa x b and Qb x c to calculate Ra x c. The values for a, b and c are specified by user and their default value is 1024
. The program also accepts the number of blocks and threads per blocks from user.
I have used MS Windows as my development environment. If you are using Linux, please check steps to build.
MS Windows environment:
- MS Visual Studio
- NVCC and Nsight
Linux:
- NVCC
MS Windows environment:
- Import the kernel.cu file in MS Visual Studio
- Set the value of
WINDOWS
to1
. It has been#define
d on first line of kernel.cu - Build the project
Linux:
- Open kernel.cu and unset the value of
WINDOWS
to0
. It has been#define
d on first line of kernel.cu - Make the project
$ cd matrix_mult
$ make
MS Windows environment:
- Execute the project in MS Visual Studio using Nsight
Linux:
- Execute kernel binary file
$ cd matrix_mult
$ ./kernel
Note: It accepts the values of a, b and c using command-line arguments if all three values are provided. Otherwise, the program uses default value.