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.

System Flavor Millions Discounts per second (SP) Millions Discounts per second (DP) Comment
INTEL – i7-4770S – 3.1 GHz [C#] 325 359
INTEL – i7-4770S – 3.1 GHz AVX 1165 1111
NVIDIA – K20C CUDA 23628 9426 usage of float4 in C#
NVIDIA – K40 CUDA 23757 11646 usage of float4 in C#

Tags: ,