File tree Expand file tree Collapse file tree 7 files changed +70
-19
lines changed Expand file tree Collapse file tree 7 files changed +70
-19
lines changed Original file line number Diff line number Diff line change 1+ // ==---- cg_types.hpp - Auxiliary types required by command group class ----==//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ // ===----------------------------------------------------------------------===//
8+
19#pragma once
210
311#include < CL/sycl/detail/host_profiling_info.hpp>
Original file line number Diff line number Diff line change 1+ // ==--------- handler_proxy.hpp - Proxy methods to call in handler ---------==//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ // ===----------------------------------------------------------------------===//
8+
19#pragma once
210
311#include < CL/sycl/access/access.hpp>
Original file line number Diff line number Diff line change 1+ // ==------- interop_handler.hpp - Argument for codeplay_introp_task --------==//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ // ===----------------------------------------------------------------------===//
8+
19#pragma once
210
311#include < CL/sycl/accessor.hpp>
Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ set(SYCL_SOURCES
144144 "function_pointer.cpp"
145145 "half_type.cpp"
146146 "handler.cpp"
147+ "interop_handler.cpp"
147148 "kernel.cpp"
148149 "platform.cpp"
149150 "program.cpp"
Original file line number Diff line number Diff line change 2222__SYCL_INLINE_NAMESPACE (cl) {
2323namespace sycl {
2424
25- pi_native_handle interop_handler::GetNativeQueue () const {
26- return MQueue->getNative ();
27- }
28-
29- pi_native_handle interop_handler::GetNativeMem (detail::Requirement *Req) const {
30- auto Iter = std::find_if (std::begin (MMemObjs), std::end (MMemObjs),
31- [=](ReqToMem Elem) { return (Elem.first == Req); });
32-
33- if (Iter == std::end (MMemObjs)) {
34- throw (" Invalid memory object used inside interop" );
35- }
36-
37- auto Plugin = MQueue->getPlugin ();
38- pi_native_handle Handle;
39- Plugin.call <detail::PiApiKind::piextMemGetNativeHandle>(Iter->second ,
40- &Handle);
41- return Handle;
42- }
43-
4425} // sycl
4526} // __SYCL_INLINE_NAMESPACE(cl)
Original file line number Diff line number Diff line change 1+ // ==--------- handler_proxy.cpp - Proxy methods to call in handler ---------==//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ // ===----------------------------------------------------------------------===//
8+
19#include < CL/sycl/detail/handler_proxy.hpp>
210
311#include < CL/sycl/handler.hpp>
Original file line number Diff line number Diff line change 1+ // ==------- interop_handler.cpp - Argument for codeplay_introp_task --------==//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ // ===----------------------------------------------------------------------===//
8+
9+ #include < CL/sycl/detail/defines.hpp>
10+ #include < CL/sycl/detail/pi.hpp>
11+ #include < CL/sycl/interop_handler.hpp>
12+ #include < detail/queue_impl.hpp>
13+
14+ __SYCL_INLINE_NAMESPACE (cl) {
15+ namespace sycl {
16+
17+ pi_native_handle interop_handler::GetNativeQueue () const {
18+ return MQueue->getNative ();
19+ }
20+
21+ pi_native_handle interop_handler::GetNativeMem (detail::Requirement *Req) const {
22+ auto Iter = std::find_if (std::begin (MMemObjs), std::end (MMemObjs),
23+ [=](ReqToMem Elem) { return (Elem.first == Req); });
24+
25+ if (Iter == std::end (MMemObjs)) {
26+ throw (" Invalid memory object used inside interop" );
27+ }
28+
29+ auto Plugin = MQueue->getPlugin ();
30+ pi_native_handle Handle;
31+ Plugin.call <detail::PiApiKind::piextMemGetNativeHandle>(Iter->second ,
32+ &Handle);
33+ return Handle;
34+ }
35+
36+ } // namespace sycl
37+ } // __SYCL_INLINE_NAMESPACE(cl)
You can’t perform that action at this time.
0 commit comments