Skip to content

About

GPU-accelerated quantitative backtesting engine in OpenCL C99 (fp64) and PyOpenCL with bit-exact CPU parity verification.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

opencl-quant-engine

GPU-accelerated quantitative backtesting and large-scale parameter sweep engine written in Python and OpenCL C99 (fp64).

Overview

Running multi-parameter grid searches across multi-year intraday time series in pure Python or single-threaded CPU loops becomes a bottleneck when state transitions depend on path-dependent indicator logic. This repository implements the core state machine and equity simulation directly in OpenCL C99 (strategy.cl) using double-precision floating point (cl_khr_fp64), driven from Python via pyopencl.

Key Components

  • strategy.cl — OpenCL C99 kernel executing parallel parameter combinations across GPU work-items with fp64 precision.
  • strategy_opencl.py — Host-side PyOpenCL buffer allocation, kernel compilation, work-group dispatch, and result aggregation.
  • strategy_numba.py / strategy.py — CPU reference implementations used for verification and fallback execution.
  • test_parity.py — Verification suite checking 1:1 numerical parity between the OpenCL GPU kernel and the Python/NumPy reference implementation.
  • leveraged_equity.py — Path-dependent leveraged equity, drawdown, and liquidation simulator.
  • grid_search.py — Batch orchestrator for multi-dimensional parameter sweeps.

Requirements

  • Python 3.10+
  • pyopencl, numpy, pandas, numba
  • OpenCL 1.2+ compatible GPU or CPU runtime with fp64 support

About

GPU-accelerated quantitative backtesting engine in OpenCL C99 (fp64) and PyOpenCL with bit-exact CPU parity verification.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages