Monte Carlo Method for Stock Options Pricing Sample

Download for Windows*Download for Linux*Download Documentation


This sample demonstrates implementation of the Monte Carlo simulation for the European stock option pricing. The algorithm is an OpenCL™ kernel that unifies three major algorithm components:

  • Mersenne twister - generation of uniformly distributed pseudorandom numbers
  • Box-Muller transform - generation of normally distributed random numbers
  • Option price calculation using Black-Scholes stock pricing model

The exact Black-Scholes model is implemented as native code on the host for comparison with the results, generated with Monte Carlo.

Supported Devices: CPU, Intel® Xeon Phi™ coprocessor
Supported OS: Windows* and Linux* OS
Complexity Level: Intermediate

Refer to the sample release notes for information on system requirements.
For more information about the sample refer to the sample User's Guide inside the sample package.

ZIP sample package contains sample files for Windows* OS
TAR.GZ sample package contains sample files for Linux* OS.

* OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.

For more complete information about compiler optimizations, see our Optimization Notice.