/// <summary> /// Enables all Cuda devices. /// </summary> /// <param name="builder">The builder instance.</param> /// <param name="predicate"> /// The predicate to include a given device. /// </param> /// <returns>The updated builder instance.</returns> public static Context.Builder Cuda( this Context.Builder builder, Predicate <CudaDevice> predicate) { CudaDevice.GetDevices( predicate, builder.DeviceRegistry); return(builder); }
/// <summary> /// Enables all Cuda devices. /// </summary> /// <param name="builder">The builder instance.</param> /// <param name="predicate"> /// The predicate to include a given device. /// </param> /// <returns>The updated builder instance.</returns> public static Context.Builder Cuda( this Context.Builder builder, Predicate <CudaDevice> predicate) { if (Backend.RuntimePlatform != TargetPlatform.X64) { throw new NotSupportedException(string.Format( RuntimeErrorMessages.CudaPlatformX64, Backend.RuntimePlatform)); } CudaDevice.GetDevices( predicate, builder.DeviceRegistry); return(builder); }