forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new property for manual_interop_sync
Add a new property for manual interop sync and make a host_task, HostTask specialization taking a property list.
- Loading branch information
Showing
6 changed files
with
78 additions
and
5 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
38 changes: 38 additions & 0 deletions
38
sycl/include/sycl/ext/codeplay/experimental/host_task_properties.hpp
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,38 @@ | ||
//==-------- host_task_properties.hpp --- SYCL host task properties --------==// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#pragma once | ||
|
||
#include <sycl/context.hpp> | ||
#include <sycl/detail/property_helper.hpp> | ||
#include <sycl/properties/property_traits.hpp> | ||
|
||
namespace sycl { | ||
inline namespace _V1 { | ||
namespace ext::codeplay::experimental::property::host_task { | ||
|
||
class manual_interop_sync : public ::sycl::detail::DataLessProperty< | ||
::sycl::detail::HostTaskManualInteropSync> {}; | ||
|
||
} // namespace ext::codeplay::experimental::property::host_task | ||
|
||
// Forward declaration | ||
class host_task; | ||
|
||
template <> | ||
struct is_property< | ||
ext::codeplay::experimental::property::host_task::manual_interop_sync> | ||
: std::true_type {}; | ||
|
||
template <> | ||
struct is_property_of< | ||
ext::codeplay::experimental::property::host_task::manual_interop_sync, | ||
host_task> : std::true_type {}; | ||
|
||
} // namespace _V1 | ||
} // namespace sycl |
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
18 changes: 18 additions & 0 deletions
18
sycl/test-e2e/HostInteropTask/native-events/host-task-manual_interop_sync.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,18 @@ | ||
// REQUIRES: cuda | ||
// | ||
// RUN: %{build} -o %t.out -lcuda | ||
// RUN: %{run} %t.out | ||
|
||
#include "host-task-native-events-cuda.hpp" | ||
#include <cuda.h> | ||
#include <sycl/sycl.hpp> | ||
|
||
void test_empty_host_task_with_manual_interop_sync_property() { | ||
sycl::queue{}.submit([&](sycl::handler &cgh) { | ||
cgh.host_task([&](sycl::interop_handle ih) {}, | ||
{sycl::ext::codeplay::experimental::property::host_task:: | ||
manual_interop_sync{}}); | ||
}); | ||
} | ||
|
||
int main() { test_empty_host_task_with_manual_interop_sync_property(); } |