Beispiel #1
0
        public void Init()
        {
            Platform[] platforms = Platform.GetPlatforms();
            if (platforms.Length >= 1)
            {
                platform = platforms[0];

                Device[] devices = platform.GetDevices(DeviceTypeFlags.Default);
                if (devices.Length >= 1)
                {
                    device = devices[0];

                    context = Context.Create(new Device[] { device }, new ContextParam(ContextProperties.Platform, platform));
                    Assert.IsNotNull(context);

                    string[] sources = new string[] { sampleProgram };

                    program = Program.CreateFromSource(context, sources);
                    program.Build(context.Devices, "");

                    Program.UnloadCompiler();
                }
            }
        }
Beispiel #2
0
 public static Device[] GetDevices(Platform platform, DeviceTypeFlags deviceTypeFlags)
 {
     return(platform.GetDevices(deviceTypeFlags));
 }
Beispiel #3
0
 public static Device[] GetDevices(Platform platform)
 {
     return(platform.GetDevices());
 }