log_normal2#

nvmath.device.random.log_normal2(state, mean, stddev)#

Sample two floats from log-normal distribution using the specified bit generator state.

Parameters:
  • state – a state object corresponding to one of the bit generators.

  • mean – The mean value.

  • stddev – The standard deviation.

Returns:

A value of type nvmath.device.float32x2.

Example

The states parameter of the kernel below should be an array of already initialized bit generator states. See the documentation of nvmath.device.random.init() for more details on how to create and initialize the bit generator states.

>>> from numba import cuda
>>> from nvmath.device import random
>>> compiled_apis = random.Compile()
>>> @cuda.jit(link=compiled_apis.files, extensions=compiled_apis.extension)
... def kernel(states, mean, stddev):
...     i = cuda.grid(1)
...     value = random.log_normal2(states[i], mean, stddev)