This repository contains various CUDA C programs demonstrating parallel computing techniques using NVIDIA's CUDA platform.
This program demonstrates basic addition of two numbers using CUDA kernels.
kernel.cu
: CUDA source file for addition of two numbers.
-
Compile the program:
nvcc kernel.cu -o addition_cuda
-
Run the program:
./addition_cuda
-
Input:
Follow the on-screen instructions to input two integers.
-
Output:
The program will compute the sum using CUDA and display the result.
This program determines if a number is even or odd using CUDA.
kernel.cu
: CUDA source file for even or odd determination.
-
Compile the program:
nvcc kernel.cu -o even_odd_cuda
-
Run the program:
./even_odd_cuda
-
Input:
Enter a number when prompted.
-
Output:
The program will use CUDA to check if the number is even or odd and display the result.
This program performs matrix multiplication using CUDA for parallel computation.
kernel.cu
: CUDA source file for matrix multiplication.
-
Compile the program:
nvcc kernel.cu -o matrix_mult_cuda
-
Run the program:
./matrix_mult_cuda
-
Input:
Adjust the matrix dimensions and values directly in the
kernel.cu
file as needed. -
Output:
The program will use CUDA to perform matrix multiplication and display the resulting matrix.
This program demonstrates CUDA programming with multiple threads.
kernel.cu
: CUDA source file demonstrating thread usage.
-
Compile the program:
nvcc kernel.cu -o threads_cuda
-
Run the program:
./threads_cuda
-
Input/Output:
Follow the specific instructions provided within the
kernel.cu
file for thread management and usage.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature
) - Make your changes
- Commit your changes (
git commit -am 'Add feature'
) - Push to the branch (
git push origin feature
) - Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.