curand

package
v0.0.0-...-c9f06ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectionVectorSet

type DirectionVectorSet C.curandDirectionVectorSet_t

DirectionVectorSet are used for flags

func (DirectionVectorSet) ScrambledVector32JoeKuo6

func (d DirectionVectorSet) ScrambledVector32JoeKuo6() DirectionVectorSet

ScrambledVector32JoeKuo6 --Specific set of 32-bit direction vectors generated from polynomials recommended by S. Joe and F. Y. Kuo, for up to 20,000

func (DirectionVectorSet) ScrambledVector64JoeKuo6

func (d DirectionVectorSet) ScrambledVector64JoeKuo6() DirectionVectorSet

ScrambledVector64JoeKuo6 -- Specific set of 64-bit direction vectors generated from polynomials recommended by S. Joe and F. Y. Kuo, for up to 20,000 dimensions, and scrambled

func (DirectionVectorSet) Vector32JoeKuo6

func (d DirectionVectorSet) Vector32JoeKuo6() DirectionVectorSet

Vector32JoeKuo6 -- Specific set of 32-bit direction vectors generated from polynomials recommended by S. Joe and F. Y. Kuo, for up to 20,000 dimensions

func (DirectionVectorSet) Vector64JoeKuo6

func (d DirectionVectorSet) Vector64JoeKuo6() DirectionVectorSet

Vector64JoeKuo6 -- Specific set of 64-bit direction vectors generated from polynomials recommended by S. Joe and F. Y. Kuo, for up to 20,000 dimensions

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is a random number generator for the device.

func CreateGenerator

func CreateGenerator(gentype RngType) *Generator

CreateGenerator creates a Generator

func CreateGeneratorEx

func CreateGeneratorEx(w *gocu.Worker, gentype RngType) *Generator

CreateGeneratorEx creates a generater where the operations will flow through a worker

func (*Generator) Destroy

func (c *Generator) Destroy() error

Destroy destroys the random generator. This doesn't do anything right now

func (*Generator) NormalFloat32

func (c *Generator) NormalFloat32(mem cutil.Mem, sizeinbytes uint, mean, std float32) error

NormalFloat32 -generates a Normal distribution in float32

from cuRAND documentation: The curandGenerateNormal() function is used to generate normally distributed floating point values with the given mean and standard deviation.

func (*Generator) SetPsuedoSeed

func (c *Generator) SetPsuedoSeed(seed uint64) error

SetPsuedoSeed sets the seed for the curand generator

func (*Generator) SetStream

func (c *Generator) SetStream(stream gocu.Streamer) error

SetStream sets the a cuda stream for the curand generator

func (*Generator) Uint

func (c *Generator) Uint(mem cutil.Mem, sizeinbytes uint) error

Uint fills mem with random numbers

From cuRAND documentation: The curandGenerate() function is used to generate pseudo- or quasirandom bits of output for XORWOW, MRG32k3a, MTGP32, MT19937, Philox_4x32_10 and SOBOL32 generators. Each output element is a 32-bit unsigned int where all bits are random. For SOBOL64 generators, each output element is a 64-bit unsigned long long where all bits are random. curandGenerate() returns an error for SOBOL64 generators. Use curandGenerateLongLong() to generate 64 bit integers with the SOBOL64 generators. //values need to be stored as an uint32

func (*Generator) Uint64

func (c *Generator) Uint64(mem cutil.Mem, sizeinbytes uint) error

Uint64 fills mem with unsigned long long random numbers

From cuRAND documentation: The curandGenerate() function is used to generate pseudo- or quasirandom bits of output for XORWOW, MRG32k3a, MTGP32, MT19937, Philox_4x32_10 and SOBOL32 generators. Each output element is a 32-bit unsigned int where all bits are random. For SOBOL64 generators, each output element is a 64-bit unsigned long long where all bits are random. curandGenerate() returns an error for SOBOL64 generators. Use curandGenerateLongLong() to generate 64 bit integers with the SOBOL64 generators. //values need to be stored as an uint32

func (*Generator) UniformFloat32

func (c *Generator) UniformFloat32(mem cutil.Mem, sizeinbytes uint) error

UniformFloat32 - generates uniform distributions in float32

from cuRAND documentation: The curandGenerateUniform() function is used to generate uniformly distributed floating point values between 0.0 and 1.0, where 0.0 is excluded and 1.0 is included.

type Method

type Method C.curandMethod_t

Method are used for flags and are passed through methds

func (Method) Best

func (m Method) Best() Method

Best returns best flag

func (Method) Definition

func (m Method) Definition() Method

Definition returns Definition flag

func (Method) DeviceAPI

func (m Method) DeviceAPI() Method

DeviceAPI returns DeviceAPI flag

func (Method) FastRejection

func (m Method) FastRejection() Method

FastRejection returns FastRejection flag

func (Method) GAUSS

func (m Method) GAUSS() Method

GAUSS returns GAUSS flag

func (Method) HITR

func (m Method) HITR() Method

HITR returns HITR flag

func (Method) ITR

func (m Method) ITR() Method

ITR returns ITR flag

func (Method) KNUTH

func (m Method) KNUTH() Method

KNUTH returns KNUTH flag

func (Method) M1

func (m Method) M1() Method

M1 returns M1 flag

func (Method) M2

func (m Method) M2() Method

M2 returns M2 flag

func (Method) Poisson

func (m Method) Poisson() Method

Poisson returns Poisson flag

func (Method) Rejection

func (m Method) Rejection() Method

Rejection returns Rejection flag

func (Method) SEARCH

func (m Method) SEARCH() Method

SEARCH returns SEARCH flag

func (Method) Third

func (m Method) Third() Method

Third returns Third flag

type Ordering

type Ordering C.curandOrdering_t

Ordering are flags for CURAND ordering of results in memory flags are set through methods type holds

func (Ordering) PseudoBest

func (o Ordering) PseudoBest() Ordering

PseudoBest returns PseudoBest flag

func (Ordering) PseudoDefault

func (o Ordering) PseudoDefault() Ordering

PseudoDefault returns PseudoDefault flag

func (Ordering) PseudoSeeded

func (o Ordering) PseudoSeeded() Ordering

PseudoSeeded returns PseudoSeeded flag

func (Ordering) QuasiDefault

func (o Ordering) QuasiDefault() Ordering

QuasiDefault returns QuasiDefault flag

type RngType

type RngType C.curandRngType_t

RngType holds CURAND generator type flags

func (*RngType) PseudoDefault

func (rng *RngType) PseudoDefault() RngType

PseudoDefault sets and returns PseudoDefault flag

func (*RngType) PseudoMRG32K3A

func (rng *RngType) PseudoMRG32K3A() RngType

PseudoMRG32K3A sets and returns PseudoMRG32K3A flag

func (*RngType) PseudoMT19937

func (rng *RngType) PseudoMT19937() RngType

PseudoMT19937 sets and returns PseudoMT19937 flag

func (*RngType) PseudoMTGP32

func (rng *RngType) PseudoMTGP32() RngType

PseudoMTGP32 sets and returns PseudoMTGP32 flag

func (*RngType) PseudoPhilox43210

func (rng *RngType) PseudoPhilox43210() RngType

PseudoPhilox43210 sets and returns PseudoPhilox43210 flag

func (*RngType) PseudoXORWOW

func (rng *RngType) PseudoXORWOW() RngType

PseudoXORWOW sets and returns PseudoXORWOW flag

func (*RngType) QuasiDefault

func (rng *RngType) QuasiDefault() RngType

QuasiDefault sets and returns QuasiDefault flag

func (*RngType) QuasiSOBOL32

func (rng *RngType) QuasiSOBOL32() RngType

QuasiSOBOL32 sets and returns QuasiSOBOL32 flag

func (*RngType) QuasiSOBOL64

func (rng *RngType) QuasiSOBOL64() RngType

QuasiSOBOL64 sets and returns QuasiSOBOL64 flag

func (*RngType) QuasiScrambledSOBOL32

func (rng *RngType) QuasiScrambledSOBOL32() RngType

QuasiScrambledSOBOL32 sets and returns QuasiScrambledSOBOL32 flag

func (*RngType) QuasiScrambledSOBOL64

func (rng *RngType) QuasiScrambledSOBOL64() RngType

QuasiScrambledSOBOL64 sets and returns QuasiScrambledSOBOL64 flag

func (RngType) String

func (rng RngType) String() string

func (*RngType) Test

func (rng *RngType) Test() RngType

Test sets and returns test flag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL