示例#1
0
 /// <summary>
 /// Generate Poisson-distributed unsigned ints.<para/>
 /// Use <c>generator</c> to generate <c>num</c> unsigned int results into the device memory at
 /// <c>outputPtr</c>.  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 <c>curandSetStream()</c>, or the null stream if no stream has been set.
 /// Results are 32-bit unsigned int point values with poisson distribution based on
 /// an associated poisson distribution with lambda <c>lambda</c>.
 /// </summary>
 /// <param name="generator">Generator to use</param>
 /// <param name="output">Pointer to host memory to store CPU-generated results</param>
 public void Generate(CudaRandHost generator, uint[] output)
 {
     _status = CudaRandNativeMethods.curandGeneratePoisson(generator.Generator, output, output.Length, _lambda);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "curandGeneratePoisson", _status));
     if (_status != CurandStatus.Success)
     {
         throw new CudaRandException(_status);
     }
 }
		/// <summary> 
		/// Generate Poisson-distributed unsigned ints.<para/>
		/// Use <c>generator</c> to generate <c>num</c> unsigned int results into the device memory at
		/// <c>outputPtr</c>.  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 <c>curandSetStream()</c>, or the null stream if no stream has been set.
		/// Results are 32-bit unsigned int point values with poisson distribution based on
		/// an associated poisson distribution with lambda <c>lambda</c>.
		/// </summary>
		/// <param name="generator">Generator to use</param>
		/// <param name="output">Pointer to host memory to store CPU-generated results</param>
		public void Generate(CudaRandHost generator, uint[] output)
		{
			_status = CudaRandNativeMethods.curandGeneratePoisson(generator.Generator, output, output.Length, _lambda);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "curandGeneratePoisson", _status));
			if (_status != CurandStatus.Success) throw new CudaRandException(_status);
		}