File: Program.cs
Web Access
Project: src\docs\samples\Microsoft.ML.Samples.GPU\Microsoft.ML.Samples.GPU.csproj (Microsoft.ML.Samples.GPU)
using System;
using System.Reflection;
using Samples.Dynamic;
 
namespace Microsoft.ML.Samples
{
    public static class Program
    {
        public static void Main(string[] args) => RunAll();
 
        internal static void RunAll()
        {
            int samples = 0;
            var types = Assembly.GetExecutingAssembly().GetTypes();
            foreach (var type in types)
            {
                var sample = type.GetMethod("Example", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
 
                if (sample != null)
                {
                    Console.WriteLine(type.Name);
                    sample.Invoke(null, null);
                    samples++;
                }
            }
 
            Console.WriteLine("Number of samples that ran without any exception: " + samples);
        }
    }
}