/// <summary> /// Ensures that the batchApiList and batchGpuFamilyList fields are not empty, then /// compiles the permutations of associated counters /// </summary> /// <param name="sender">the compile button</param> /// <param name="e">default event args</param> private void BatchCompile_Click(object sender, EventArgs e) { richTextBoxOutput.Text = ""; _counterCompiler.StartRSTDocumentation(); if (string.IsNullOrEmpty(batchApiList.Text.Trim()) || string.IsNullOrEmpty(batchGpuFamilyList.Text.Trim())) { MessageBox.Show("Required data not provided.\nPlease fill in all the fields on the form.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string[] apis = batchApiList.Text.Trim().Split(','); string[] gpus = batchGpuFamilyList.Text.Trim().Split(','); foreach (var api in apis) { foreach (var gpu in gpus) { var doneEvent = new AutoResetEvent(false); StartCompileCounters(api, gpu, doneEvent); // Wait with timeout so we can pump the UI update while (false == doneEvent.WaitOne(100)) { Application.DoEvents(); } } } _counterCompiler.DoneRSTDocumentation(DisplayMessageHandler, ErrorHandler); }
/// <summary> /// Ensures that the batchApiList and batchGpuFamilyList fields are not empty, then /// compiles the permutations of associated counters /// </summary> /// <param name="sender">the compile button</param> /// <param name="e">default event args</param> private void BatchCompile_Click(object sender, EventArgs e) { richTextBoxOutput.Text = ""; counterCompiler.StartRSTDocumentation(); if (string.IsNullOrEmpty(batchApiList.Text.Trim()) || string.IsNullOrEmpty(batchGpuFamilyList.Text.Trim())) { MessageBox.Show("Required data not provided.\nPlease fill in all the fields on the form.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string[] apis = batchApiList.Text.Trim().Split(','); string[] gpus = batchGpuFamilyList.Text.Trim().Split(','); foreach (var api in apis) { foreach (var gpu in gpus) { DisplayMessageHandler("\nCompiling API " + api + " for GPU Family " + gpu); // For compatibility with InternalCounterCompiler project if (false == counterCompiler.CompileCounters(api, gpu, DisplayMessageHandler, ErrorHandler)) { ErrorHandler("Failed to compile counters"); } } } counterCompiler.DoneRSTDocumentation(DisplayMessageHandler, ErrorHandler); }