Beispiel #1
0
        /// <summary>
        /// Returns CPU devices.
        /// </summary>
        /// <param name="predicate">
        /// The predicate to include a given device.
        /// </param>
        /// <returns>All CPU devices.</returns>
        public static ImmutableArray <Device> GetDevices(Predicate <CPUDevice> predicate)
        {
            var registry = new DeviceRegistry();

            GetDevices(predicate, registry);
            return(registry.ToImmutable());
        }
Beispiel #2
0
 /// <summary>
 /// Converts this builder instance into a context instance.
 /// </summary>
 /// <returns>The created context instance.</returns>
 public Context ToContext() => new Context(
     this,
     DeviceRegistry.ToImmutable());