-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][Doc] Clarify error handling in sycl_ext_oneapi_device_architec…
…ture extension (#14077) This patch adds `unknown` field to `architecture` enum and removes error handling based on throwing exception. Instead, `architecture::unknown` will be returned.
- Loading branch information
1 parent
24a6b3b
commit f83c969
Showing
3 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
sycl/test-e2e/DeviceArchitecture/device_architecture_unknown_on_host.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// REQUIRES: accelerator | ||
|
||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
|
||
// Test checks that device_architecture extension implementation correctly | ||
// handles unsupported HW. The unsupported HW in this test is any FPGA device, | ||
// as FPGA currently is not supported at all by the device_architecture | ||
// extension. | ||
|
||
#include <sycl/detail/core.hpp> | ||
|
||
int main() { | ||
sycl::queue q; | ||
sycl::device dev = q.get_device(); | ||
|
||
sycl::ext::oneapi::experimental::architecture arch = dev.get_info< | ||
sycl::ext::oneapi::experimental::info::device::architecture>(); | ||
|
||
assert(arch == sycl::ext::oneapi::experimental::architecture::unknown); | ||
// device::ext_oneapi_architecture_is(syclex::architecture::unknown) should | ||
// return true if the device does not have a known architecture. | ||
assert(dev.ext_oneapi_architecture_is(arch)); | ||
|
||
// No exceptions are expected in this test. | ||
|
||
return 0; | ||
} |