bt_engine (bt_engine.hpp) - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

The code is an implementation of the Cox, Ross, & Rubinstein (CRR) method and is template to accept different data types (float/double). It uses standard C++ and allows the code to be easily used in a software only environment by swapping to the standard math namespace.

The implementation is broken into a number of steps:

  • Calculation of the option at each final node i.e. at the time of expiration
  • Sequential calculation of the option value at each preceding node (working backwards through the tree towards the valuation)
  • Calculation of the early exercise (in the case of the American option only) at each stage.

There are some optimizations to the algorithm for the FPGA to allow for parallelization, i.e to obtain an II value of 1 for each loop; the generated report shows:

Pipelining function ‘pow_generic<double>’. Pipelining result : Target II = 1, Final II = 1, Depth = 89. Pipelining loop ‘Loop 1’. Pipelining result : Target II = 1, Final II = 1, Depth = 112. Pipelining loop ‘Loop 2’. Pipelining result : Target II = 1, Final II = 1, Depth = 5. Pipelining loop ‘Loop 3.1’. Pipelining result : Target II = 1, Final II = 1, Depth = 19. Pipelining loop ‘Loop 3.2’. Pipelining result : Target II = 1, Final II = 1, Depth = 117. Pipelining loop ‘Loop 1’. Pipelining result : Target II = 1, Final II = 1, Depth = 3. Pipelining loop ‘Loop 3’. Pipelining result : Target II = 1, Final II = 1, Depth = 3. Finished kernel compilation