MCPcopy Create free account
hub / github.com/chrxh/alien / processIntern

Method processIntern

source/Gui/GpuSettingsDialog.cpp:37–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35{}
36
37void GpuSettingsDialog::processIntern()
38{
39 auto gpuSettings = _simulationFacade->getGpuSettings();
40 auto origGpuSettings = _simulationFacade->getOriginalGpuSettings();
41 auto lastGpuSettings = gpuSettings;
42
43 AlienImGui::InputInt(
44 AlienImGui::InputIntParameters()
45 .name("Blocks")
46 .textWidth(RightColumnWidth)
47 .defaultValue(origGpuSettings.numBlocks)
48 .tooltip("This values specifies the number of CUDA thread blocks. If you are using a high-end graphics card, you can try to increase the number of "
49 "blocks."),
50 gpuSettings.numBlocks);
51
52 ImGui::Dummy({0, ImGui::GetContentRegionAvail().y - scale(50.0f)});
53 AlienImGui::Separator();
54
55 if (AlienImGui::Button("Adopt")) {
56 close();
57 }
58 ImGui::SetItemDefaultFocus();
59
60 ImGui::SameLine();
61 if (AlienImGui::Button("Cancel")) {
62 close();
63 gpuSettings = _gpuSettings;
64 }
65
66 validateAndCorrect(gpuSettings);
67
68 if (gpuSettings != lastGpuSettings) {
69 _simulationFacade->setGpuSettings_async(gpuSettings);
70 }
71}
72
73void GpuSettingsDialog::openIntern()
74{

Callers

nothing calls this directly

Calls 5

InputIntParametersClass · 0.85
scaleFunction · 0.85
getGpuSettingsMethod · 0.80
setGpuSettings_asyncMethod · 0.45

Tested by

no test coverage detected