Debian Codegraph @

tests/src/test_amdpmfixedr600.cpp

raw symbols SCIP
1 // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/tests/src/test_amdpmfixedr600.cpp`/
2 // Copyright 2019 Juan Palacios <[email protected]>
3
4 #include <catch2/catch_all.hpp>
5
6 #include "common/commandqueuestub.h"cxx . . $ `<file>/tests/src/common/commandqueuestub.h`/
7 #include "common/stringdatasourcestub.h"cxx . . $ `<file>/tests/src/common/stringdatasourcestub.h`/
8 #include "core/components/controls/amd/pm/fixed/pmfixedr600.h"cxx . . $ `<file>/src/core/components/controls/amd/pm/fixed/pmfixedr600.h`/
9
10 namespace Testscxx . . $ Tests/::AMDcxx . . $ Tests/AMD/::PMFixedR600cxx . . $ Tests/AMD/PMFixedR600/ {
11
12 class PMFixedR600TestAdaptercxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter# : public ::AMDcxx . . $ AMD/::PMFixedR600cxx . . $ AMD/PMFixedR600#
13 {
14 public:
15 using ::AMDcxx . . $ AMD/::PMFixedR600cxx . . $ AMD/PMFixedR600#::PMFixedR600cxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter#PMFixedR600TestAdapter(7ee7cebdbe575548).;
16
17 using ::AMDcxx . . $ AMD/::PMFixedR600cxx . . $ AMD/PMFixedR600#::cleanControlcxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter#cleanControl(151e9138769f295e).;
18 using ::AMDcxx . . $ AMD/::PMFixedR600cxx . . $ AMD/PMFixedR600#::modecxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter#mode(9c546c94e5fcce4e).;
19 using ::AMDcxx . . $ AMD/::PMFixedR600cxx . . $ AMD/PMFixedR600#::modescxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter#modes(f5f2959be38ccc08).;
20 using ::AMDcxx . . $ AMD/::PMFixedR600cxx . . $ AMD/PMFixedR600#::syncControlcxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter#syncControl(151e9138769f295e).;
21 };
22
23 TEST_CASEcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:144:11`!("AMD PMFixedR600 tests", "[GPU][AMD][PM][PMFixed][R600]")
24 {
25 stdcxx . . $ std/::stringcxx . . $ std/string# const perfLevelPathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"power_dpm_force_performance_level"};
26 CommandQueueStubcxx . . $ CommandQueueStub# ctlCmds;
27
28 SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Has 'low' mode selected by default")
29 {
30 PMFixedR600TestAdaptercxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>());
31
32 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.mode() == "low");
33 }
34
35 SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Has [low, high] modes")
36 {
37 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const perfLevelscxx . . $ std/vector#vector(9619226211e5a241).{"low", "high"};
38 PMFixedR600TestAdaptercxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter# ts(stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>());
39
40 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.modes() == perfLevels);
41 }
42
43 SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does generate clean control commands")
44 {
45 PMFixedR600TestAdaptercxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter# ts(
46 stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(perfLevelPath, "low"));
47 ts.cleanControlcxx . . $ AMD/PMFixedR600#cleanControl(151e9138769f295e).(ctlCmds);
48
49 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 1);
50
51 auto &[path, value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).();
52 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(path == perfLevelPath);
53 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(value == "auto");
54 }
55
56 SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate sync control commands when is synced")
57 {
58 PMFixedR600TestAdaptercxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter# ts(
59 stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(perfLevelPath, "low"));
60 ts.syncControlcxx . . $ AMD/PMFixedR600#syncControl(151e9138769f295e).(ctlCmds);
61
62 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty());
63 }
64
65 SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does generate sync control commands when is out of sync")
66 {
67 PMFixedR600TestAdaptercxx . . $ Tests/AMD/PMFixedR600/PMFixedR600TestAdapter# ts(
68 stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(perfLevelPath, "_other_"));
69 ts.syncControlcxx . . $ AMD/PMFixedR600#syncControl(151e9138769f295e).(ctlCmds);
70
71 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 1);
72
73 auto &[path, value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).();
74 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(path == perfLevelPath);
75 REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(value == "low");
76 }
77 }
78
79 } // namespace Tests::AMD::PMFixedR600