-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Use public interfaces in function_pointer.hpp (#1097)
This patch is a part of effort to decouple SYCL Runtime library interface from its actual implementation. The goal is to improve SYCL ABI/API compatibility between different versions of library. Two helper functions were introduced to eliminate calls to _impl classes. This caused 3 tests fail. 2 tests were found to use internal APIs. Missing include clauses were added to workaround those fails. A more robust solution will be provided in separate patches. Signed-off-by: Alexander Batashev <alexander.batashev@intel.com>
- Loading branch information
Alexander Batashev
committed
Feb 6, 2020
1 parent
c5641a7
commit e026a0d
Showing
7 changed files
with
44 additions
and
12 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
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,30 @@ | ||
//==----------- function_pointer.cpp --- SYCL Function pointers ------------==// | ||
// | ||
// 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/intel/function_pointer.hpp> | ||
#include <CL/sycl/detail/device_impl.hpp> | ||
#include <CL/sycl/detail/program_impl.hpp> | ||
|
||
__SYCL_INLINE namespace cl { | ||
namespace sycl { | ||
namespace detail { | ||
intel::device_func_ptr_holder_t | ||
getDeviceFunctionPointerImpl(device &D, program &P, const char *FuncName) { | ||
intel::device_func_ptr_holder_t FPtr = 0; | ||
// FIXME: return value must be checked here, but since we cannot yet check | ||
// if corresponding extension is supported, let's silently ignore it here. | ||
PI_CALL(piextGetDeviceFunctionPointer)( | ||
detail::pi::cast<pi_device>(detail::getSyclObjImpl(D)->getHandleRef()), | ||
detail::pi::cast<pi_program>(detail::getSyclObjImpl(P)->getHandleRef()), | ||
FuncName, &FPtr); | ||
return FPtr; | ||
} | ||
|
||
} // namespace detail | ||
} // namespace sycl | ||
} // namespace cl |
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
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