This repository contains the GPU-accelerated financial models using CUDA. The directory structure organizes the source files, headers, binaries, and data.
This project includes visualization capabilities for the financial models using OpenGL in conjunction with CUDA.
CUDA-Financial-Modeling/
│
├── src/
│ ├── black_scholes.cu # Black-Scholes model implementation
│ ├── barrier_option.cu # Barrier option pricing
│ ├── asian_option.cu # Asian option pricing
│ └── pso_heston_calibration.cu # PSO for Heston model calibration
│
├── include/ # Directory for header files (currently empty, but can be populated later)
│
├── bin/ # Compiled binaries (currently empty, binaries will be placed here after compilation)
│
└── data/ # Data files (e.g., market data for calibration)
This project now includes visualization capabilities for the financial models using OpenGL in conjunction with CUDA.
- Ensure you have the OpenGL Utility Toolkit (GLUT) installed. This is used for the visualization.
- Compile the CUDA code with both nvcc and a C++ compiler. For example:
nvcc -o output_name filename.cu -lglut -lGL -lGLU - Run the compiled binary to see the visualization of the Black-Scholes model results.
The visualization currently shows a simple sine wave as placeholder data. To integrate real financial data and visualize it:
- Modify the
blackScholesKernelto compute the desired financial model. - Retrieve the results from the GPU after computation.
- Update the
displayFunctionto visualize this data using OpenGL calls.
This setup involves the combination of CUDA with OpenGL for visualization. Before using the visualization aspect, ensure that you have the OpenGL and GLUT libraries installed on your system.
To compile the CUDA code files, navigate to the src directory and use the nvcc compiler:
nvcc filename.cu -o ../bin/output_nameFor example, to compile the Black-Scholes model:
nvcc black_scholes.cu -o ../bin/black_scholesReplace filename.cu with the appropriate filename and output_name with the desired binary name.