Пример #1
0
 public MainForm()
 {
     InitializeComponent();
     InitializeSettings();
     editorTextBox.Font = Settings.Default.EditorFont;
     fontDialog.FontMustExist = true;
     logTextBox.Font = Settings.Default.LogFont;
     openFileDialog.Multiselect = false;
     saveFileDialog.OverwritePrompt = true;
     configForm = new ConfigForm();
 }
Пример #2
0
        public MainForm()
        {
            InitializeComponent();
            InitializeSettings();

            textBoxLog.Font = new Font(FontFamily.GenericMonospace, 10);
            textBoxLog.Text =
@"[Platform] - Select the OpenCL platform that should be used to run the examples.
[Devices] - Select the OpenCL devices that should be used to run the examples.
[Run] - Runs the selected examples.
[Copy Log] - Copies the content of this box.";

            configForm = new ConfigForm();

            devices = new List<ComputeDevice>();

            checkedListDevices.CheckOnClick = true;
            checkedListDevices.ItemCheck += new ItemCheckEventHandler(checkedListDevices_ItemCheck);

            comboBoxPlatform.SelectedIndexChanged += new EventHandler(comboBoxPlatform_SelectedIndexChanged);

            // Populate OpenCL Platform ComboBox
            object[] availablePlatforms = new object[ComputePlatform.Platforms.Count];
            for (int i = 0; i < availablePlatforms.Length; i++)
                availablePlatforms[i] = ComputePlatform.Platforms[i].Name;
            comboBoxPlatform.Items.AddRange(availablePlatforms);
            comboBoxPlatform.SelectedIndex = 0;            

            // Set up the example list
            exampleList = new List<IExample>();
            exampleList.Add(new Example());
            exampleList.Add(new InfoExample());
            exampleList.Add(new MappingExample());
            exampleList.Add(new ProgramExample());
            exampleList.Add(new MultipleKernelsExample());
            exampleList.Add(new VectorAddExample());
            exampleList.Add(new CL11Example());

            checkedListExamples.CheckOnClick = true;
            foreach (IExample example in exampleList)
                checkedListExamples.Items.Add(example.Name, true);
        }