Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Fix test for the case when context has multiple gpu devices #773

Merged
merged 1 commit into from
Jan 27, 2022
Merged
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
10 changes: 7 additions & 3 deletions SYCL/Basic/buffer/buffer_create.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ int main() {
constexpr int Size = 100;
queue Queue;
auto D = Queue.get_device();

auto NumOfDevices = Queue.get_context().get_devices().size();
buffer<::cl_int, 1> Buffer(Size);
Queue.submit([&](handler &cgh) {
accessor Accessor{Buffer, cgh, read_write};
if (D.get_info<info::device::host_unified_memory>())
if (NumOfDevices > 1)
// Currently the Level Zero plugin uses host allocations for multi-device
// contexts because such allocations are accessible by all devices.
std::cerr << "Multi GPU should use zeMemAllocHost\n";
else if (D.get_info<info::device::host_unified_memory>())
std::cerr << "Integrated GPU should use zeMemAllocHost\n";
else
std::cerr << "Discrete GPU should use zeMemAllocDevice\n";
Expand All @@ -26,5 +30,5 @@ int main() {
return 0;
}

// CHECK: {{Integrated|Discrete}} GPU should use [[API:zeMemAllocHost|zeMemAllocDevice]]
// CHECK: {{Integrated|Multi|Discrete}} GPU should use [[API:zeMemAllocHost|zeMemAllocHost|zeMemAllocDevice]]
// CHECK: ZE ---> [[API]](