예제 #1
0
 /// <summary>
 /// Creates a CPU accelerator that simulates a common configuration specified
 /// by the given <paramref name="kind"/>.
 /// </summary>
 /// <param name="context">The current context.</param>
 /// <param name="kind">The desired CPU accelerator kind.</param>
 /// <param name="mode">The accelerator mode.</param>
 /// <returns>The created CPU accelerator instance.</returns>
 public static CPUAccelerator Create(
     Context context,
     CPUAcceleratorKind kind,
     CPUAcceleratorMode mode) =>
 kind <CPUAcceleratorKind.Default || kind> CPUAcceleratorKind.Intel
     ? throw new ArgumentOutOfRangeException(nameof(kind))
     : CreateAccelerators[(int)kind](context, mode);
예제 #2
0
 /// <summary>
 /// Creates a CPU accelerator that simulates a common configuration specified
 /// by the given <paramref name="kind"/>.
 /// </summary>
 /// <param name="context">The current context.</param>
 /// <param name="kind">The desired CPU accelerator kind.</param>
 /// <returns>The created CPU accelerator instance.</returns>
 /// <remarks>
 /// Note that this accelerator will use <see cref="CPUAcceleratorMode.Auto"/>.
 /// </remarks>
 public static CPUAccelerator Create(Context context, CPUAcceleratorKind kind) =>
 Create(context, kind, CPUAcceleratorMode.Auto);