Skip to content

Commit 863d204

Browse files
authored
[SYCL][E2E] Fix warnings in KernelParams e2e tests (intel#13954)
1 parent 46db721 commit 863d204

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

sycl/test-e2e/KernelParams/array-kernel-param-nested-run.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ bool test_accessor_array_in_struct(queue &myQueue) {
8686
return verify_1D("Accessor array in struct", c_num_items, output, ref);
8787
}
8888

89-
template <typename T> struct S { T a[c_num_items]; };
89+
template <typename T> struct S {
90+
T a[c_num_items];
91+
};
9092
bool test_templated_array_in_struct(queue &myQueue) {
9193
std::array<int, c_num_items> output;
9294
std::array<int, c_num_items> ref;
@@ -119,11 +121,11 @@ bool run_tests() {
119121
for (auto ep : L) {
120122
try {
121123
std::rethrow_exception(ep);
122-
} catch (std::exception &E) {
123-
std::cout << "*** std exception caught:\n";
124-
std::cout << E.what();
125-
} catch (sycl::exception const &E1) {
124+
} catch (sycl::exception const &E) {
126125
std::cout << "*** SYCL exception caught:\n";
126+
std::cout << E.what();
127+
} catch (std::exception const &E1) {
128+
std::cout << "*** std exception caught:\n";
127129
std::cout << E1.what();
128130
}
129131
}
@@ -147,8 +149,7 @@ bool run_tests() {
147149

148150
int main(int argc, char *argv[]) {
149151
bool passed = true;
150-
default_selector selector{};
151-
auto D = selector.select_device();
152+
device D{default_selector_v};
152153
const char *devType = D.is_cpu() ? "CPU" : "GPU";
153154
std::cout << "Running on device " << devType << " ("
154155
<< D.get_info<sycl::info::device::name>() << ")\n";

sycl/test-e2e/KernelParams/array-kernel-param-run.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ bool run_tests() {
173173
for (auto ep : L) {
174174
try {
175175
std::rethrow_exception(ep);
176-
} catch (std::exception &E) {
177-
std::cout << "*** std exception caught:\n";
178-
std::cout << E.what();
179-
} catch (sycl::exception const &E1) {
176+
} catch (sycl::exception const &E) {
180177
std::cout << "*** SYCL exception caught:\n";
178+
std::cout << E.what();
179+
} catch (std::exception const &E1) {
180+
std::cout << "*** std exception caught:\n";
181181
std::cout << E1.what();
182182
}
183183
}
@@ -207,8 +207,7 @@ bool run_tests() {
207207

208208
int main(int argc, char *argv[]) {
209209
bool passed = true;
210-
default_selector selector{};
211-
auto D = selector.select_device();
210+
device D{default_selector_v};
212211
const char *devType = D.is_cpu() ? "CPU" : "GPU";
213212
std::cout << "Running on device " << devType << " ("
214213
<< D.get_info<sycl::info::device::name>() << ")\n";

sycl/test-e2e/KernelParams/union_kernel_param.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int main(int argc, char **argv) {
3030
}
3131

3232
if (myfloat != 5.0f) {
33-
printf("FAILED\nmyfloat = %d\n", myfloat);
33+
std::cout << "FAILED\nmyfloat = " << myfloat << std::endl;
3434
return 1;
3535
}
3636
return 0;

0 commit comments

Comments
 (0)