ahmadrafidev / learn-cuda

A place where I learn about CUDA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parallel Programming Source Code

A place where I learn about CUDA 🐎

Introduction

This repository contains implementations of Parallel Jacobi Iteration and Gauss-Seidel Iteration using CUDA. These methods are used to solve systems of linear equations and are optimized to run on NVIDIA GPUs.

Prerequisites

To compile and run these programs, you need:

  • An NVIDIA GPU with CUDA support
  • CUDA Toolkit installed
  • A C++ compiler (e.g., g++ or nvcc)

Compilation

Jacobi Iteration

To compile the Jacobi Iteration program, use the following command:

nvcc -o jacobi jacobi.cu

Gauss-Seidel Iteration

To compile the Gauss-Seidel Iteration program, use the following command:

nvcc -o gauss_seidel gauss_seidel.cu

Running the Programs

Jacobi Iteration

To run the Jacobi Iteration program, use the following command:

./jacobi <matrix_size>

Replace <matrix_size> with the size of the matrix you want to use. For example, to run with a 32x32 matrix:

./jacobi 32

Gauss-Seidel Iteration

To run the Gauss-Seidel Iteration program, use the following command:

./gauss_seidel <matrix_size>

Replace <matrix_size> with the size of the matrix you want to use. For example, to run with a 64x64 matrix:

./gauss_seidel 64

Example Output

Gauss Seidel 16 Gauss Seidel 32 Gauss Seidel 64

About

A place where I learn about CUDA


Languages

Language:Cuda 100.0%