Beispiel #1
0
        private void initControls()
        {
            TbxIpAddr.Text     = IpAddr;
            TbxUsername.Text   = Username;
            TbxPassword.Text   = Password;
            BtnConnect.Content = "连接";

            TbxTest.Text = "";

            tbxPlatName.Text = "";
            tbxPlatVen.Text  = "";
            tbxPlatVer.Text  = "";

            tbxDevName.Text = "";
            tbxDevVen.Text  = "";
            tbxDevVer.Text  = "";
            tbxDevCU.Text   = "";
            tbxDevFreq.Text = "";
            tbxDevPerf.Text = "";
            lbxDevList.Items.Clear();

            tbxN.Text         = N.ToString();
            tbxC.Text         = C.ToString();
            tbxH.Text         = H.ToString();
            tbxW.Text         = W.ToString();
            tbxK.Text         = K.ToString();
            tbxOutW.Text      = OutW.ToString();
            tbxOutH.Text      = OutH.ToString();
            tbxGroupSz.Text   = String.Format("{0:D}, {1:D}, 1", group_size_x, group_size_y);
            tbxGlobalSz.Text  = String.Format("{0:D}, {1:D}, 1", global_size_x, global_size_y);
            tbxPck.Text       = pck_order.ToString();
            tbxLdsAtomic.Text = c_lds_atomic.ToString();
            tbxLdsSplit.Text  = c_lds_split.ToString();
            tbxL2Atomic.Text  = c_l2_atomic.ToString();
            tbxL2Split.Text   = c_l2_split.ToString();
            tbxKoutMaps.Text  = k_out_maps.ToString();
            tbxInSize.Text    = InputSize.ToString();
            tbxWeiSize.Text   = WeightSize.ToString();
            tbxOutSize.Text   = OutputSize.ToString();
            tbxSigSize.Text   = sig_slot_size.ToString();
            tbxL2Size.Text    = l2_tmp_size.ToString();
            tbxElapsed.Text   = BestElapsedTime.ToString();
            tbxPerf.Text      = BestPerformence.ToString();
            tbxEffic.Text     = BestEfficiency.ToString();
            tbxCalcu.Text     = Calculation.ToString();
            tbxtheore.Text    = TheoryElapsedTime.ToString();

            tbxProcess.Text = String.Format("Tunning Problem: {0:D}/{1:D}... Searching Kernel: {2:D}/{3:D}...",
                                            TunnedProblem, TotalProblem, SearchedKernel, TotalProblem);
            tbxPercent.Text      = String.Format("{0:F2}%", SearchingPercent * 100);
            btnTensile.IsEnabled = false;
        }
Beispiel #2
0
        private void procTensileLog(String logStr)
        {
            Action act;
            String tmpLog;

            tmpLog = delLogHead(logStr);

            if (initInfoFlag == true)
            {
                if (tmpLog.StartsWith("output WHKN"))
                {
                    tmpLog = tmpLog.Split('=')[1];
                    tmpLog = tmpLog.Trim();
                    OutW   = int.Parse(tmpLog.Split(',')[0].Trim());
                    OutH   = int.Parse(tmpLog.Split(',')[1].Trim());
                    OutK   = int.Parse(tmpLog.Split(',')[2].Trim());
                    OutN   = int.Parse(tmpLog.Split(',')[3].Trim());
                }
                if (tmpLog.StartsWith("init tensor input"))
                {
                    InputSize = tmpLog.Split('=')[2].Trim();
                }
                if (tmpLog.StartsWith("init tensor weight"))
                {
                    WeightSize = tmpLog.Split('=')[2].Trim();
                }
                if (tmpLog.StartsWith("init tensor output"))
                {
                    OutputSize = tmpLog.Split('=')[2].Trim();
                }
                if (tmpLog.StartsWith("Calculation"))
                {
                    Calculation       = tmpLog.Split(',')[0].Trim().Split('=')[1].Trim();
                    TheoryElapsedTime = tmpLog.Split(',')[1].Trim().Split('=')[1].Trim();
                }
                if (tmpLog.StartsWith("run host calculate"))
                {
                    initInfoFlag    = false;
                    kernelParamFlag = false;

                    act = new Action(() =>
                    {
                        tbxOutW.Text    = OutW.ToString();
                        tbxOutH.Text    = OutH.ToString();
                        tbxInSize.Text  = InputSize.ToString();
                        tbxWeiSize.Text = WeightSize.ToString();
                        tbxOutSize.Text = OutputSize.ToString();
                        tbxCalcu.Text   = Calculation.ToString();
                        tbxtheore.Text  = TheoryElapsedTime.ToString();
                    });
                    this.Dispatcher.Invoke(act);
                }
            }

            if (kernelParamFlag == true)
            {
                if (tmpLog.Contains("PCK_order"))
                {
                    pck_order = int.Parse(getNumStr(tmpLog.Split('=')[1].Trim()));
                }
                if (tmpLog.Contains("c_lds_atomic") && tmpLog.Contains("c_lds_split"))
                {
                    c_lds_atomic = int.Parse(tmpLog.Split(',')[0].Split('=')[1].Trim());
                    c_lds_split  = int.Parse(tmpLog.Split(',')[1].Split('=')[1].Trim());
                }
                if (tmpLog.Contains("c_l2_atomic") && tmpLog.Contains("c_l2_split"))
                {
                    c_l2_atomic = int.Parse(tmpLog.Split(',')[0].Split('=')[1].Trim());
                    c_l2_split  = int.Parse(tmpLog.Split(',')[1].Split('=')[1].Trim());
                }
                if (tmpLog.Contains("k_out_maps") && tmpLog.Contains("k_out_group"))
                {
                    k_out_maps = int.Parse(tmpLog.Split(',')[0].Split('=')[1].Trim());
                }
                if (tmpLog.Contains("group_size"))
                {
                    group_size_x = int.Parse(tmpLog.Split('=')[1].Split(',')[0].Trim());
                    group_size_y = int.Parse(tmpLog.Split('=')[1].Split(',')[1].Trim());
                }
                if (tmpLog.Contains("sigal_size") && tmpLog.Contains("l2_size"))
                {
                    sig_slot_size = tmpLog.Split(',')[0].Split('=')[1].Trim();
                    l2_tmp_size   = tmpLog.Split(',')[1].Split('=')[1].Trim();
                }
                if (tmpLog.Contains("-------------------------------------------------------------------------"))
                {
                    kernelParamFlag = false;

                    act = new Action(() =>
                    {
                        tbxPck.Text       = pck_order.ToString();
                        tbxLdsAtomic.Text = c_lds_atomic.ToString();
                        tbxLdsSplit.Text  = c_lds_split.ToString();
                        tbxL2Atomic.Text  = c_l2_atomic.ToString();
                        tbxL2Split.Text   = c_l2_split.ToString();
                        tbxKoutMaps.Text  = k_out_maps.ToString();
                        tbxSigSize.Text   = sig_slot_size.ToString();
                        tbxL2Size.Text    = l2_tmp_size.ToString();
                        tbxGroupSz.Text   = String.Format("{0:D}, {1:D}, 1", group_size_x, group_size_y);
                    });
                    this.Dispatcher.Invoke(act);
                }
            }
            else
            {
                if (tmpLog.StartsWith("launch kernel"))
                {
                    KernelIterations = int.Parse(getNumStr(tmpLog));
                }
                if (tmpLog.Contains("elapsed") && tmpLog.Contains("performence") && (!tmpLog.StartsWith("Best for now")))
                {
                    ElapsedTime = tmpLog.Split(',')[0].Split('=')[1].Trim();
                    Performence = tmpLog.Split(',')[1].Split('=')[1].Trim();
                    Efficiency  = tmpLog.Split(',')[1].Split('=')[2].Trim();
                }
                if (tmpLog.StartsWith("Best for now:"))
                {
                    BestElapsedTime = tmpLog.Split(',')[0].Split('=')[1].Trim();
                    BestEfficiency  = tmpLog.Split(',')[1].Split('=')[1].Trim();
                }
                if (tmpLog.StartsWith("Searching"))
                {
                    SearchedKernel   = int.Parse(getNumStr(tmpLog.Split(':')[1]).Split('/')[0].Trim());
                    TotalKernel      = int.Parse(getNumStr(tmpLog.Split(':')[1]).Split('/')[1].Trim());
                    SearchingPercent = 1.0 * SearchedKernel / TotalKernel;
                }
                if (tmpLog.Contains("Kernel Param:"))
                {
                    kernelParamFlag = true;

                    act = new Action(() =>
                    {
                        tbxElapsed.Text = BestElapsedTime.ToString();
                        tbxPerf.Text    = BestPerformence.ToString();
                        tbxEffic.Text   = BestEfficiency.ToString();
                        tbxProcess.Text = String.Format("Tunning Problem: {0:D}/{1:D}... Searching Kernel: {2:D}/{3:D}...",
                                                        TunnedProblem, TotalProblem, SearchedKernel, TotalKernel);
                        tbxPercent.Text     = String.Format("{0:F2}%", SearchingPercent * 100);
                        pbProcPercent.Value = SearchingPercent * 100;
                    });
                    this.Dispatcher.Invoke(act);
                }
                if (tmpLog.Contains("search kernel parameters finished"))
                {
                    finishFlag = true;
                }
            }

            if (finishFlag == true)
            {
                if (tmpLog.Contains("Best score"))
                {
                    BestElapsedTime = tmpLog.Split(':')[1].Split(',')[0].Trim();
                    BestPerformence = tmpLog.Split(':')[1].Split(',')[1].Trim();
                    BestEfficiency  = tmpLog.Split(':')[1].Split(',')[2].Trim();
                }
                if (tmpLog.Contains("+ group_size ="))
                {
                    group_size_x = int.Parse(tmpLog.Split('=')[1].Split(',')[0].Trim());
                    group_size_y = int.Parse(tmpLog.Split('=')[1].Split(',')[1].Trim());
                }
                if (tmpLog.Contains("global_size"))
                {
                    global_size_x = int.Parse(tmpLog.Split('=')[1].Split(',')[0].Trim());
                    global_size_y = int.Parse(tmpLog.Split('=')[1].Split(',')[1].Trim());
                }
                if (tmpLog.Contains("PCK_order"))
                {
                    pck_order = int.Parse(tmpLog.Split('=')[1].Trim());
                }
                if (tmpLog.Contains("c_in_lds_atomic_group"))
                {
                    c_lds_atomic = int.Parse(tmpLog.Split('=')[1].Trim());
                }
                if (tmpLog.Contains("c_in_lds_split_group"))
                {
                    c_lds_split = int.Parse(tmpLog.Split('=')[1].Trim());
                }
                if (tmpLog.Contains("c_in_l2_atomic_group"))
                {
                    c_l2_atomic = int.Parse(tmpLog.Split('=')[1].Trim());
                }
                if (tmpLog.Contains("c_in_l2_split_group"))
                {
                    c_l2_split = int.Parse(tmpLog.Split('=')[1].Trim());
                }
                if (tmpLog.Contains("k_out_maps") && (!tmpLog.Contains("k_out_group")))
                {
                    k_out_maps = int.Parse(tmpLog.Split('=')[1].Trim());
                }
                if (tmpLog.Contains("mean err"))
                {
                    if (tmpLog.Contains('@'))
                    {
                        mean_err = double.Parse(getNumStr(tmpLog.Split('=')[1].Split('@')[1]));
                    }
                    else
                    {
                        mean_err = double.Parse(tmpLog.Split('=')[1].Trim());
                    }
                }
                if (tmpLog.Contains("release host"))
                {
                    act = new Action(() =>
                    {
                        tbxElapsed.Text   = BestElapsedTime.ToString();
                        tbxPerf.Text      = BestPerformence.ToString();
                        tbxEffic.Text     = BestEfficiency.ToString();
                        tbxPck.Text       = pck_order.ToString();
                        tbxLdsAtomic.Text = c_lds_atomic.ToString();
                        tbxLdsSplit.Text  = c_lds_split.ToString();
                        tbxL2Atomic.Text  = c_l2_atomic.ToString();
                        tbxL2Split.Text   = c_l2_split.ToString();
                        tbxKoutMaps.Text  = k_out_maps.ToString();
                        tbxSigSize.Text   = sig_slot_size.ToString();
                        tbxL2Size.Text    = l2_tmp_size.ToString();
                        SearchedKernel    = TotalKernel;
                        tbxGroupSz.Text   = String.Format("{0:D}, {1:D}, 1", group_size_x, group_size_y);
                        tbxGlobalSz.Text  = String.Format("{0:D}, {1:D}, 1", global_size_x, global_size_y);
                        tbxProcess.Text   = String.Format("Tunning Problem: {0:D}/{1:D}... Searching Kernel: {2:D}/{3:D}...",
                                                          TunnedProblem, TotalProblem, SearchedKernel, TotalKernel);
                        tbxPercent.Text     = String.Format("{0:F2}%", SearchingPercent * 100);
                        pbProcPercent.Value = 100;
                    });
                    this.Dispatcher.Invoke(act);
                }
            }
        }