OptimizedSum is a C++ program developed on Visual Studio that provides an optimized parallel method for calculating the sum of numbers.
It demonstrates the performance (execution speed) difference between CPU and CUDA implementations.
You can install OptimizedSum by following these steps:
-
Clone the GitHub repository to your local machine:
git clone https://github.com/babak2/OptimizedSum.git
Navigate to the project directory:
cd OptimizedSum
-
Build the program using Visual Studio or your preferred C++ compiler.
-
Run the compiled program to perform optimized summation calculations.
To use OptimizedSum, you need the following software and hardware requirements:
- C++ compiler (e.g., Visual Studio, g++, clang++)
- CMake (optional, for building with CMake)
- CUDA (Compute Unified Device Architecture) from NVIDIA installed, along with an NVIDIA GPU, if you plan to utilize GPU acceleration for certain calculations.
Make sure you have CUDA from NVIDIA installed and properly configured with a compatible NVIDIA GPU if you intend to take advantage of GPU acceleration.
Users without an NVIDIA GPU may still use the CPU-based functionality of the program.
To use OptimizedSum, follow these steps:
-
Compile the program as mentioned in the Installation section.
-
Run the compiled executable from the command line.
./OptimizedSum
-
Follow the on-screen instructions to input numbers for summation.
-
The program will calculate the sum of the entered numbers using an optimized algorithm.
Here's an example of the OptimizedSum output:
CPU Sum: 494483662 - Time: 0.035 seconds
CUDA Sum: 494483662 - Time: 0.021 seconds
CPU Time: 0.035 seconds
CUDA Time: 0.021 seconds
Speedup: 1.66667x
This project is licensed under the MIT License. See the LICENSE file for details.
Babak Mahdavi Aresetani