예제 #1
0
        /// <summary>
        /// Creates an instance based on the specified gpu.
        /// </summary>
        /// <param name="gpu">The gpu.</param>
        /// <param name="rng_type">The type of generator.</param>
        /// <param name="host">if set to <c>true</c> the uses generator on the host (if applicable).</param>
        /// <returns>New instance.</returns>
        public static GPGPURAND Create(GPGPU gpu, curandRngType rng_type, bool host = false)
        {
            GPGPURAND rand;

            if (!host && gpu is CudaGPU)
            {
                rand = new CudaDeviceRAND(gpu, rng_type);
            }
            else if (gpu is CudaGPU)
            {
                rand = new CudaHostRAND(gpu, rng_type);
            }
            else
            {
                rand = new HostRAND(gpu, rng_type);
            }

            return(rand);
        }
예제 #2
0
 /// <summary>
 /// Creates an instance based on the specified gpu.
 /// </summary>
 /// <param name="gpu">The gpu.</param>
 /// <param name="rng_type">The type of generator.</param>
 /// <param name="host">if set to <c>true</c> the uses generator on the host (if applicable).</param>
 /// <returns>New instance.</returns>
 public static GPGPURAND Create(GPGPU gpu, curandRngType rng_type, bool host = false)
 {
     GPGPURAND rand;
     if (!host && gpu is CudaGPU)
         rand = new CudaDeviceRAND(gpu, rng_type);
     else if (gpu is CudaGPU)
         rand = new CudaHostRAND(gpu, rng_type);
     else
         rand = new HostRAND(gpu, rng_type);
   
     return rand;
 }