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

Commit 8faf9dd

Browse files
[SYCL] Skip event_profiling_info test if profiling is not supported (#1620)
1 parent 5ec33a8 commit 8faf9dd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

SYCL/Basic/event_profiling_info.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
// Flaky with CUDA and HIP (https://github.com/intel/llvm/issues/6495).
15-
// TODO: Test is failing for acc backend, enable back when the issue
16-
// fixed.
17-
// UNSUPPORTED: cuda, hip, accelerator
15+
// UNSUPPORTED: cuda, hip
1816

1917
#include <cassert>
18+
#include <iostream>
2019
#include <sycl/sycl.hpp>
2120

2221
using namespace sycl;
@@ -41,6 +40,12 @@ bool verifyProfiling(event Event) {
4140
// The test checks that get_profiling_info waits for command asccociated with
4241
// event to complete execution.
4342
int main() {
43+
device Dev;
44+
if (!Dev.has(aspect::queue_profiling)) {
45+
std::cout << "Profiling is not supported, skipping the test" << std::endl;
46+
return 0;
47+
}
48+
4449
const size_t Size = 10000;
4550
int Data[Size] = {0};
4651
for (size_t I = 0; I < Size; ++I) {
@@ -53,7 +58,7 @@ int main() {
5358
buffer<int, 1> BufferTo(Values, range<1>(Size));
5459

5560
// buffer copy
56-
queue copyQueue{sycl::property::queue::enable_profiling()};
61+
queue copyQueue{Dev, sycl::property::queue::enable_profiling()};
5762
event copyEvent = copyQueue.submit([&](sycl::handler &Cgh) {
5863
accessor<int, 1, access::mode::read, access::target::device> AccessorFrom(
5964
BufferFrom, Cgh, range<1>(Size));
@@ -63,7 +68,7 @@ int main() {
6368
});
6469

6570
// kernel launch
66-
queue kernelQueue{sycl::property::queue::enable_profiling()};
71+
queue kernelQueue{Dev, sycl::property::queue::enable_profiling()};
6772
event kernelEvent = kernelQueue.submit([&](sycl::handler &CGH) {
6873
CGH.single_task<class EmptyKernel>([=]() {});
6974
});

0 commit comments

Comments
 (0)