Skip to content

Commit d7264c9

Browse files
committed
Make style consistent
1 parent 215bf25 commit d7264c9

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

sycl/test-e2e/Basic/device_config_file_consistency.cpp

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// UNSUPPORTED: accelerator
99
// UNSUPPORTED-INTENDED: Accelerator is not supported by
10-
// sycl_ext_oneapi_device_architecture
10+
// sycl_ext_oneapi_device_architecture.
1111
// REQUIRES: device-config-file
1212
// RUN: %{build} -o %t.out %device_config_file_include_flag
1313
// RUN: %{run} %t.out
@@ -23,8 +23,8 @@ using namespace sycl;
2323

2424
const char *getArchName(const device &Device) {
2525
namespace syclex = sycl::ext::oneapi::experimental;
26-
auto arch = Device.get_info<syclex::info::device::architecture>();
27-
switch (arch) {
26+
auto Arch = Device.get_info<syclex::info::device::architecture>();
27+
switch (Arch) {
2828
#define __SYCL_ARCHITECTURE(ARCH, VAL) \
2929
case syclex::architecture::ARCH: \
3030
return #ARCH;
@@ -36,14 +36,14 @@ const char *getArchName(const device &Device) {
3636
return "unknown";
3737
}
3838

39-
// checks if a container contains a specific element
39+
// Checks if a container contains a specific element
4040
template <typename Container, typename T>
41-
bool contains(const Container &c, const T &elem) {
42-
return std::find(c.begin(), c.end(), elem) != c.end();
41+
bool contains(const Container &C, const T &Elem) {
42+
return std::find(C.begin(), C.end(), Elem) != C.end();
4343
}
4444

45-
std::string_view getAspectName(aspect asp) {
46-
switch (asp) {
45+
std::string_view getAspectName(aspect Asp) {
46+
switch (Asp) {
4747
#define __SYCL_ASPECT(ASPECT, ID) \
4848
case aspect::ASPECT: \
4949
return #ASPECT;
@@ -53,87 +53,87 @@ std::string_view getAspectName(aspect asp) {
5353
return "unknown";
5454
}
5555

56-
aspect getAspectByName(std::string_view name) {
56+
aspect getAspectByName(std::string_view Name) {
5757
#define __SYCL_ASPECT(ASPECT, ID) \
58-
if (name == #ASPECT) \
58+
if (Name == #ASPECT) \
5959
return aspect::ASPECT;
6060
#include <sycl/info/aspects.def>
6161
throw std::invalid_argument("Unknown aspect name");
6262
}
6363

6464
int main() {
6565
// Get the device arch
66-
queue q;
67-
auto dev = q.get_device();
68-
auto device_name = getArchName(dev);
66+
queue Q;
67+
auto Dev = Q.get_device();
68+
auto DeviceName = getArchName(Dev);
6969

70-
auto TargetInfo = DeviceConfigFile::TargetTable.find(device_name);
70+
auto TargetInfo = DeviceConfigFile::TargetTable.find(DeviceName);
7171
if (TargetInfo == DeviceConfigFile::TargetTable.end()) {
72-
std::cout << "No aspects found for device " << device_name << std::endl;
72+
std::cout << "No aspects found for device " << DeviceName << "\n";
7373
return 1;
7474
}
7575

7676
// Check aspects consistency
77-
int nAspectInconsistencies = 0;
78-
std::cout << "Checking consistency of aspects for device " << device_name
77+
int NAspectInconsistencies = 0;
78+
std::cout << "Checking consistency of aspects for device " << DeviceName
7979
<< "...\n";
8080

81-
auto supportedAspects = dev.get_info<info::device::aspects>();
82-
auto deviceConfigAspectNames = TargetInfo->second.aspects;
83-
std::vector<aspect> deviceConfigAspects;
84-
for (auto aspectName : deviceConfigAspectNames) {
85-
deviceConfigAspects.push_back(getAspectByName(aspectName));
81+
auto SupportedAspects = Dev.get_info<info::device::aspects>();
82+
auto DeviceConfigAspectNames = TargetInfo->second.aspects;
83+
std::vector<aspect> DeviceConfigAspects;
84+
for (auto AspectName : DeviceConfigAspectNames) {
85+
DeviceConfigAspects.push_back(getAspectByName(AspectName));
8686
}
8787

88-
for (auto asp : deviceConfigAspects) {
89-
if (!contains(supportedAspects, asp)) {
90-
std::cout << "error: " << device_name << " does not support aspect "
91-
<< getAspectName(asp)
88+
for (auto Asp : DeviceConfigAspects) {
89+
if (!contains(SupportedAspects, Asp)) {
90+
std::cout << "error: " << DeviceName << " does not support aspect "
91+
<< getAspectName(Asp)
9292
<< " but it is declared in the device config file\n";
93-
++nAspectInconsistencies;
93+
++NAspectInconsistencies;
9494
}
9595
}
96-
for (auto asp : supportedAspects) {
97-
if (!contains(deviceConfigAspects, asp)) {
98-
std::cout << "note: the device " << device_name << " supports aspect "
99-
<< getAspectName(asp)
96+
for (auto Asp : SupportedAspects) {
97+
if (!contains(DeviceConfigAspects, Asp)) {
98+
std::cout << "note: the device " << DeviceName << " supports aspect "
99+
<< getAspectName(Asp)
100100
<< " but it is not declared in the device config file\n";
101101
// Not necessarily an error, so we won't increment n_fail
102102
}
103103
}
104104

105-
if (nAspectInconsistencies == 0)
105+
if (NAspectInconsistencies == 0)
106106
std::cout << "All aspects are consistent\n";
107107

108108
// Check sub-group sizes consistency
109-
int nSubGroupSizeInconsistencies = 0;
109+
int NSubGroupSizeInconsistencies = 0;
110110
std::cout << "Checking consistency of sub-group sizes for device "
111-
<< device_name << "...\n";
111+
<< DeviceName << "...\n";
112112

113-
auto supportedSubGroupSizes = dev.get_info<info::device::sub_group_sizes>();
114-
auto deviceConfigSubGroupSizes = TargetInfo->second.subGroupSizes;
113+
auto SupportedSubGroupSizes = Dev.get_info<info::device::sub_group_sizes>();
114+
auto DeviceConfigSubGroupSizes = TargetInfo->second.subGroupSizes;
115115

116-
for (auto size : deviceConfigSubGroupSizes) {
117-
if (!contains(supportedSubGroupSizes, size)) {
118-
std::cout << "error: " << device_name
119-
<< " does not support sub-group size " << size
116+
for (auto Size : DeviceConfigSubGroupSizes) {
117+
if (!contains(SupportedSubGroupSizes, Size)) {
118+
std::cout << "error: " << DeviceName
119+
<< " does not support sub-group size " << Size
120120
<< " but it is declared in the device config file\n";
121-
++nSubGroupSizeInconsistencies;
121+
++NSubGroupSizeInconsistencies;
122122
}
123123
}
124-
for (auto size : supportedSubGroupSizes) {
125-
if (!contains(deviceConfigSubGroupSizes, size)) {
126-
std::cout << "note: the device " << device_name
127-
<< " supports sub-group size " << size
124+
for (auto Size : SupportedSubGroupSizes) {
125+
if (!contains(DeviceConfigSubGroupSizes, Size)) {
126+
std::cout << "note: the device " << DeviceName
127+
<< " supports sub-group size " << Size
128128
<< " but it is not declared in the device config file\n";
129129
// Not necessarily an error, so we won't increment n_fail
130130
}
131131
}
132132

133-
if (nSubGroupSizeInconsistencies == 0)
133+
if (NSubGroupSizeInconsistencies == 0)
134134
std::cout << "All sub-group sizes are consistent\n";
135135

136-
return nAspectInconsistencies + nSubGroupSizeInconsistencies;
136+
return NAspectInconsistencies + NSubGroupSizeInconsistencies;
137137
}
138138

139139
#undef __SYCL_ASPECT_DEPRECATED_ALIAS

0 commit comments

Comments
 (0)