Пример #1
0
        private DeviceEntry[] searchForDevices()
        {
            if (mainForm.Renderer.Context == null)
            {
                return(null);                                              //bail out if the GL context hasn't been created
            }
            DeviceEntry[]      eDevs   = null;
            List <DeviceEntry> devList = new List <DeviceEntry>();

            try{
                OpenCLDeviceEntry.CheckSupport();                 //will throw an exception if not supported

                eDevs = OpenCLDeviceEntry.GetDevices();
                if (eDevs != null)
                {
                    devList.AddRange(eDevs);
                }
            }
            catch {}

            try{
                CudaDeviceEntry.CheckSupport();                 //will throw an exception if not supported

                eDevs = CudaDeviceEntry.GetDevices();
                if (eDevs != null)
                {
                    devList.AddRange(eDevs);
                }
            }
            catch {}

            try{
                CPUDeviceEntry.CheckSupport();                 //will throw an exception if not supported

                eDevs = CPUDeviceEntry.GetDevices();
                if (eDevs != null)
                {
                    devList.AddRange(eDevs);
                }
            }
            catch {}

            return(devList.ToArray());
        }
Пример #2
0
        private void hardwareInfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            System.IO.StringWriter text = new System.IO.StringWriter();

            if (engineMgr.FoundDevices == null)
            {
                return;
            }

            try{
                CPUDeviceEntry.CheckSupport();
            }catch (Exception ex) {
                text.WriteLine("No CPU/OpenGL Support: " + ex.Message);
            }
            try{
                OpenCLDeviceEntry.CheckSupport();
            }catch (Exception ex) {
                text.WriteLine("No OpenCL Support: " + ex.Message);
            }
            try{
                CudaDeviceEntry.CheckSupport();
            }catch (Exception ex) {
                text.WriteLine("No CUDA Support: " + ex.Message);
            }
            text.WriteLine();
            foreach (DeviceEntry dev in engineMgr.FoundDevices)
            {
                text.WriteLine(dev.GetReport());
            }


            beginDlg();
            TextDisplayForm dlg = new TextDisplayForm();

            dlg.Text    = "Hardware Info";
            dlg.Content = text.ToString();
            dlg.ShowDialog();
            endDlg();
        }