func (g *Generator) NormalDouble(buf cuda.Buffer, mean, stddev float64) error {
	var res error
	buf.WithPtr(func(ptr unsafe.Pointer) {
		status := C.curandGenerateNormalDouble(g.gen, (*C.double)(ptr),
			C.size_t(buf.Size()/8), C.double(mean), C.double(stddev))
		res = newError("curandGenerateNormalDouble", status)
	})
	return res
}
NormalDouble generates normally distributed doubles.

This must be called inside a cuda.Context.
package curand
import "C"
import (
	"runtime"
	"unsafe"
	"github.com/unixpickle/cuda"
)
type Type int
const (
	PseudoDefault Type = iota
	PseudoXORWOW
	PseudoMRG32K3A
	PseudoMTGP32
	PseudoMT19937
	PseudoPHILOX43210
	QuasiDefault
	QuasiSobol32
	QuasiScrambledSobol32
	QuasiSobol64
	QuasiScrambledSobol64
)
type Generator struct {
	ctx *cuda.Context
	gen C.curandGenerator_t
}
func NewGenerator(c *cuda.Context, t Type) (*Generator, error) {
	if t > QuasiScrambledSobol64 || t < 0 {
		panic("type out of bounds")
	}
	realType := C.go_curand_rng_type(C.int(t))
	res := &Generator{ctx: c}
	code := C.curandCreateGenerator(&res.gen, realType)
	if err := newError("curandCreateGenerator", code); err != nil {
		return nil, err
	}
	runtime.SetFinalizer(res, func(g *Generator) {
		go g.ctx.Run(func() error {
			C.curandDestroyGenerator(g.gen)
			return nil
		})
	})
	return res, nil
}
func (g *Generator) Seed(seed int64) error {
	status := C.curandSetPseudoRandomGeneratorSeed(g.gen, C.ulonglong(seed))
	return newError("curandSetPseudoRandomGeneratorSeed", status)
}
func (g *Generator) GenerateSeeds() error {
	return newError("curandGenerateSeeds", C.curandGenerateSeeds(g.gen))
}
func (g *Generator) Uniform(buf cuda.Buffer) error {
	var res error
	buf.WithPtr(func(ptr unsafe.Pointer) {
		status := C.curandGenerateUniform(g.gen, (*C.float)(ptr),
			C.size_t(buf.Size()/4))
		res = newError("curandGenerateUniform", status)
	})
	return res
}
func (g *Generator) UniformDouble(buf cuda.Buffer) error {
	var res error
	buf.WithPtr(func(ptr unsafe.Pointer) {
		status := C.curandGenerateUniformDouble(g.gen, (*C.double)(ptr),
			C.size_t(buf.Size()/8))
		res = newError("curandGenerateUniformDouble", status)
	})
	return res
}
func (g *Generator) Normal(buf cuda.Buffer, mean, stddev float32) error {
	var res error
	buf.WithPtr(func(ptr unsafe.Pointer) {
		status := C.curandGenerateNormal(g.gen, (*C.float)(ptr),
			C.size_t(buf.Size()/4), C.float(mean), C.float(stddev))
		res = newError("curandGenerateNormal", status)
	})
	return res
}