-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Align get_profiling_info behavior with the specification
Wait for event in get_profiling_info. Signed-off-by: Vlad Romanov <[email protected]>
- Loading branch information
1 parent
a287f9d
commit 40ce2a7
Showing
2 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// RUN: %clang -std=c++11 -fsycl %s -o %t.out -lstdc++ -lOpenCL -lsycl | ||
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out | ||
// RUN: %CPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %GPU_RUN_PLACEHOLDER %t.out | ||
// RUN: %ACC_RUN_PLACEHOLDER %t.out | ||
//==------------------- event_profiling_info.cpp ---------------------------==// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <CL/sycl.hpp> | ||
|
||
using namespace cl; | ||
|
||
// The test checks that get_profiling_info waits for command asccociated with | ||
// event to complete execution. | ||
int main() { | ||
sycl::queue Q{sycl::property::queue::enable_profiling()}; | ||
sycl::event Event = Q.submit([&](sycl::handler &CGH) { | ||
CGH.single_task<class EmptyKernel>([=]() {}); | ||
}); | ||
|
||
Event.get_profiling_info<sycl::info::event_profiling::command_start>(); | ||
|
||
bool Fail = sycl::info::event_command_status::complete != | ||
Event.get_info<sycl::info::event::command_execution_status>(); | ||
|
||
return Fail; | ||
} |