curandGenerateUniformDouble() private method

private curandGenerateUniformDouble ( ManagedCuda.CudaRand.CurandGenerator generator, ManagedCuda.BasicTypes.CUdeviceptr outputPtr, ManagedCuda.BasicTypes.SizeT num ) : CurandStatus
generator ManagedCuda.CudaRand.CurandGenerator
outputPtr ManagedCuda.BasicTypes.CUdeviceptr
num ManagedCuda.BasicTypes.SizeT
return CurandStatus
Example #1
0
 /// <summary>
 /// Use generator to generate num double results into the device memory at
 /// outputPtr. The device memory must have been previously allocated and be
 /// large enough to hold all the results. Launches are done with the stream
 /// set using curandSetStream(), or the null stream if no stream has been set.
 /// <para/>
 /// Results are 64-bit double precision floating point values between
 /// 0.0 and 1.0, excluding 0.0 and including 1.0.
 /// </summary>
 /// <param name="output">DevicePtr of type double*</param>
 /// <param name="size">Number of random elements to create</param>
 public void GenerateUniform64(CUdeviceptr output, SizeT size)
 {
     _status = CudaRandNativeMethods.curandGenerateUniformDouble(_generator, output, size);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "curandGenerateUniformDouble", _status));
     if (_status != CurandStatus.Success)
     {
         throw new CudaRandException(_status);
     }
 }
Example #2
0
 /// <summary>
 /// Use generator to generate num double results into the device memory at
 /// outputPtr. The device memory must have been previously allocated and be
 /// large enough to hold all the results. Launches are done with the stream
 /// set using curandSetStream(), or the null stream if no stream has been set.
 /// <para/>
 /// Results are 64-bit double precision floating point values between
 /// 0.0 and 1.0, excluding 0.0 and including 1.0.
 /// </summary>
 /// <param name="output">CudaDeviceVariable</param>
 public void GenerateUniform(CudaDeviceVariable <double> output)
 {
     _status = CudaRandNativeMethods.curandGenerateUniformDouble(_generator, output.DevicePointer, output.Size);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "curandGenerateUniformDouble", _status));
     if (_status != CurandStatus.Success)
     {
         throw new CudaRandException(_status);
     }
 }
Example #3
0
 /// <summary>
 /// Use generator to generate num double results into the device memory at
 /// outputPtr. The device memory must have been previously allocated and be
 /// large enough to hold all the results. Launches are done with the stream
 /// set using curandSetStream(), or the null stream if no stream has been set.
 /// <para/>
 /// Results are 64-bit double precision floating point values between
 /// 0.0 and 1.0, excluding 0.0 and including 1.0.
 /// </summary>
 /// <param name="output">CudaDeviceVariable</param>
 public void GenerateUniform(double[] output)
 {
     _status = CudaRandNativeMethods.curandGenerateUniformDouble(_generator, output, output.LongLength);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "curandGenerateUniformDouble", _status));
     if (_status != CurandStatus.Success)
     {
         throw new CudaRandException(_status);
     }
 }