Skip to content

[SYCL][E2E] Fix deprecated warnings in Regression e2e tests #14168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions sycl/test-e2e/Regression/commandlist/Inputs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ int main(int argc, char *argv[]) {
int nthreadsGPU = 8;
int arr_size = 20;
int iter_gpu = 200;
unsigned int gpu_dev = 999;
unsigned int nitems = 0;
bool passed = true;

Expand Down Expand Up @@ -73,21 +72,7 @@ int main(int argc, char *argv[]) {
cout << " iter GPU: " << iter_gpu << "\n";
#endif

std::vector<sycl::device> dlist;
if (gpu_dev == 999) {
try {
auto sel = sycl::gpu_selector();
sel_dev = sel.select_device();
} catch (...) {
cout << "no gpu device found\n";
}
} else {
if (gpu_dev > dlist.size() - 1) {
cout << "ERROR: selected device index [" << gpu_dev << "] is too large\n";
exit(1);
}
sel_dev = dlist[gpu_dev];
}
sel_dev = sycl::device(sycl::default_selector_v);
std::cout << "selected dev: " << sel_dev.get_info<sycl::info::device::name>()
<< "\n";

Expand Down
20 changes: 8 additions & 12 deletions sycl/test-e2e/Regression/device_num.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,37 +175,33 @@ int main() {
targetDevIndex = GetPreferredDeviceIndex(devices, info::device_type::all);
assert(targetDevIndex >= 0 &&
"Failed to find target device for default selector.");
default_selector ds;
device d = ds.select_device();
std::cout << "default_selector selected ";
device d(default_selector_v);
std::cout << "default_selector_v selected ";
printDeviceType(d);
assert(devices[targetDevIndex] == d &&
"The selected device is not the target device specified.");
}
targetDevIndex = GetPreferredDeviceIndex(devices, info::device_type::gpu);
if (targetDevIndex >= 0) {
gpu_selector gs;
device d = gs.select_device();
std::cout << "gpu_selector selected ";
device d(gpu_selector_v);
std::cout << "gpu_selector_v selected ";
printDeviceType(d);
assert(devices[targetDevIndex] == d &&
"The selected device is not the target device specified.");
}
targetDevIndex = GetPreferredDeviceIndex(devices, info::device_type::cpu);
if (targetDevIndex >= 0) {
cpu_selector cs;
device d = cs.select_device();
std::cout << "cpu_selector selected ";
device d(cpu_selector_v);
std::cout << "cpu_selector_v selected ";
printDeviceType(d);
assert(devices[targetDevIndex] == d &&
"The selected device is not the target device specified.");
}
targetDevIndex =
GetPreferredDeviceIndex(devices, info::device_type::accelerator);
if (targetDevIndex >= 0) {
accelerator_selector as;
device d = as.select_device();
std::cout << "accelerator_selector selected ";
device d(accelerator_selector_v);
std::cout << "accelerator_selector_v selected ";
printDeviceType(d);
assert(devices[targetDevIndex] == d &&
"The selected device is not the target device specified.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int main(int argc, char **argv) {
continue;

std::string PCIAddress =
dev.get_info<info::device::ext_intel_pci_address>();
dev.get_info<ext::intel::info::device::pci_address>();
std::cout << "PCI address = " << PCIAddress << std::endl;
assert(std::regex_match(PCIAddress, ExpectedBDFFormat));
}
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ bool group__get_linear_id() {
cgh.parallel_for<class group__get_linear_id>(
nd_range<3>{GlobalRange, LocalRange}, [=](nd_item<DIMS> I) {
const auto Off = I.get_global_linear_id() * 3;
const auto LI = I.get_group().get_linear_id();
const auto LI = I.get_group().get_group_linear_id();
Ptr[Off + 0] = LI;
Ptr[Off + 1] = LI;
Ptr[Off + 2] = LI;
Expand Down
6 changes: 3 additions & 3 deletions sycl/test-e2e/Regression/image_access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
int main() {
try {
sycl::range<1> Range(32);
std::vector<cl_float> Data(Range.size() * 4, 0.0f);
std::vector<float> Data(Range.size() * 4, 0.0f);
sycl::image<1> Image(Data.data(), sycl::image_channel_order::rgba,
sycl::image_channel_type::fp32, Range);
sycl::queue Queue;

Queue.submit([&](sycl::handler &CGH) {
sycl::accessor<sycl::cl_int4, 1, sycl::access::mode::read,
sycl::accessor<sycl::int4, 1, sycl::access::mode::read,
sycl::access::target::image,
sycl::access::placeholder::false_t>
A(Image, CGH);
CGH.single_task<class MyKernel>([=]() {});
});
Queue.wait_and_throw();

sycl::accessor<sycl::cl_int4, 1, sycl::access::mode::read,
sycl::accessor<sycl::int4, 1, sycl::access::mode::read,
sycl::access::target::host_image,
sycl::access::placeholder::false_t>
A(Image);
Expand Down
Loading