Class RandomVariableOpenCL

  • All Implemented Interfaces:
    Serializable, RandomVariable

    public class RandomVariableOpenCL
    extends Object
    implements RandomVariable
    This class represents a random variable being the evaluation of a stochastic process at a certain time within a Monte-Carlo simulation. It is thus essentially a vector of floating point numbers - the realizations - together with a double - the time. The index of the vector represents path. The class may also be used for non-stochastic quantities which may potentially be stochastic (e.g. volatility). If only non-stochastic random variables are involved in an operation the class uses optimized code. Accesses performed exclusively through the interface RandomVariable is thread safe (and does not mutate the class). This implementation uses floats for the realizations on a OpenCL device. There is a CPU implementation in RandomVariableFromFloatArray which give exactly the same results for all methods (checked by unit test). Configuration The class can be configured with system property to use a chosen OpenCL device. The properties are:
    "net.finmath.montecarlo.opencl.RandomVariableOpenCL.deviceType"
    with possible values "GPU", "CPU", "ALL"
    "net.finmath.montecarlo.opencl.RandomVariableOpenCL.deviceIndex"
    being an integer. For a positive values, the device with the corresponding index is used. For a negative value the device with the index numberOfDevices - deviceIndex is used. That is, a value of -1 selects the last device in the list of devices. To select the dedicated GPU in a MacBook Pro you may use "GPU" with index "-1".
    Version:
    2.1
    Author:
    Christian Fries
    See Also:
    Serialized Form