Fixed Cash Flow

Fixed Cash Flow

Fixed Cash Flow

In financial applications, many premium, greek evaluations and risk analysis use discounting. This benchmark is our hello world to discounting: we discount some number of cash flows, for a large number of simulations. Yield curves are stored as their rates, linearly interpolated. Pseudo code is given below.

float price = 0.0f;
for (int k = 0; k < _cashFlowsCount; ++k)
{
    if (simulDate >= _paymentDate[k]) 
        continue;
    cashFlowCount++;
    price += _values[k] * _yc.GetDiscountFactor(simId, timePoint, _paymentDate[k] - simulDate) ;
}
return price ;

The number of cash flows is 2000, the number of tenors, that is number of rate values per yield curve is 31. We compute the sum of discounted cash flows for a number of simulations, and a number of dates in the future (500 in our case).

We count the number of actual discounting to have a cash flows per second metric.

SystemFlavorMillions Discounts per second (SP)Millions Discounts per second (DP)Comment
INTEL – i7-4770S – 3.1 GHz[C#]325359
INTEL – i7-4770S – 3.1 GHzAVX11651111
NVIDIA – K20CCUDA236289426usage of float4 in C#
NVIDIA – K40CUDA2375711646usage of float4 in C#