/// <summary> /// Creates a new random number generator of type Type /// </summary> /// <param name="Type">Generator type</param> public CudaRandHost(GeneratorType Type) { _generator = new CurandGenerator(); _status = CudaRandNativeMethods.curandCreateGeneratorHost(ref _generator, Type); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "curandCreateGeneratorHost", _status)); if (_status != CurandStatus.Success) throw new CudaRandException(_status); }
/// <summary> /// Creates a new random number generator of type Type /// </summary> /// <param name="Type">Generator type</param> public CudaRandDevice(GeneratorType Type) { _generator = new CurandGenerator(); _status = CudaRandNativeMethods.curandCreateGenerator(ref _generator, Type); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "curandCreateGenerator", _status)); if (_status != CurandStatus.Success) { throw new CudaRandException(_status); } }
public static extern CurandStatus curandGenerateNormalDouble(CurandGenerator generator, [Out] double[] outputPtr, SizeT n, double mean, double stddev);
public static extern CurandStatus curandGenerateUniformDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num);
public static extern CurandStatus curandGenerateUniform(CurandGenerator generator, [Out] float[] outputPtr, SizeT num);
public static extern CurandStatus curandGenerateLongLong(CurandGenerator generator, [Out] ulong[] outputPtr, SizeT num);
public static extern CurandStatus curandSetQuasiRandomGeneratorDimensions(CurandGenerator generator, uint num_dimensions);
public static extern CurandStatus curandGeneratePoisson(CurandGenerator generator, uint[] outputPtr, SizeT n, double lambda);
public static extern CurandStatus curandGenerateNormalDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, double mean, double stddev);
public static extern CurandStatus curandGenerateNormal(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, float mean, float stddev);
public static extern CurandStatus curandGenerateNormal(CurandGenerator generator, [Out] float[] outputPtr, SizeT n, float mean, float stddev);
public static extern CurandStatus curandGenerateLongLong(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num);
public static extern CurandStatus curandGenerateLogNormalDouble(CurandGenerator generator, double[] outputPtr, SizeT n, double mean, double stddev);
public static extern CurandStatus curandGenerate(CurandGenerator generator, [Out] uint[] outputPtr, SizeT num);
public static extern CurandStatus curandGenerateLogNormalDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, double mean, double stddev);
public static extern CurandStatus curandCreateGeneratorHost(ref CurandGenerator generator, GeneratorType rng_type);
public static extern CurandStatus curandSetPseudoRandomGeneratorSeed(CurandGenerator generator, ulong seed);
public static extern CurandStatus curandGenerateSeeds(CurandGenerator generator);
public static extern CurandStatus curandSetGeneratorOrdering(CurandGenerator generator, Ordering order);
public static extern CurandStatus curandGenerateUniformDouble(CurandGenerator generator, [Out] double[] outputPtr, SizeT num);
public static extern CurandStatus curandSetGeneratorOffset(CurandGenerator generator, ulong offset);
public static extern CurandStatus curandGenerateLogNormal(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, float mean, float stddev);
public static extern CurandStatus curandDestroyGenerator(CurandGenerator generator);
public static extern CurandStatus curandSetStream(CurandGenerator generator, CUstream stream);