Skip to content

Commit 8a32b7d

Browse files
authored
[SYCL] Restore old behavior of get() method (#3356)
Logical revert of the patch: "Fix get() method for non-opencl backends" Signed-off-by: Alexander Flegontov <[email protected]>
1 parent c9a65fc commit 8a32b7d

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

sycl/source/detail/context_impl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ context_impl::context_impl(RT::PiContext PiContext, async_handler AsyncHandler,
107107
}
108108

109109
cl_context context_impl::get() const {
110-
if (MHostContext || getPlugin().getBackend() != cl::sycl::backend::opencl) {
110+
if (MHostContext) {
111111
throw invalid_object_error(
112112
"This instance of context doesn't support OpenCL interoperability.",
113113
PI_INVALID_CONTEXT);

sycl/source/detail/device_impl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool device_impl::is_affinity_supported(
8989
}
9090

9191
cl_device_id device_impl::get() const {
92-
if (MIsHostDevice || getPlugin().getBackend() != cl::sycl::backend::opencl) {
92+
if (MIsHostDevice) {
9393
throw invalid_object_error(
9494
"This instance of device doesn't support OpenCL interoperability.",
9595
PI_INVALID_DEVICE);

sycl/source/detail/event_impl.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ extern xpti::trace_event_data_t *GSYCLGraphEvent;
3535
bool event_impl::is_host() const { return MHostEvent || !MOpenCLInterop; }
3636

3737
cl_event event_impl::get() const {
38-
if (!MOpenCLInterop ||
39-
getPlugin().getBackend() != cl::sycl::backend::opencl) {
38+
if (!MOpenCLInterop) {
4039
throw invalid_object_error(
4140
"This instance of event doesn't support OpenCL interoperability.",
4241
PI_INVALID_EVENT);

sycl/source/detail/kernel_impl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class kernel_impl {
8080
///
8181
/// \return a valid cl_kernel instance
8282
cl_kernel get() const {
83-
if (is_host() || getPlugin().getBackend() != cl::sycl::backend::opencl) {
83+
if (is_host()) {
8484
throw invalid_object_error(
8585
"This instance of kernel doesn't support OpenCL interoperability.",
8686
PI_INVALID_KERNEL);

sycl/source/detail/platform_impl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class platform_impl {
7676

7777
/// \return an instance of OpenCL cl_platform_id.
7878
cl_platform_id get() const {
79-
if (is_host() || getPlugin().getBackend() != cl::sycl::backend::opencl) {
79+
if (is_host()) {
8080
throw invalid_object_error(
8181
"This instance of platform doesn't support OpenCL interoperability.",
8282
PI_INVALID_PLATFORM);

sycl/source/detail/program_impl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ program_impl::~program_impl() {
210210

211211
cl_program program_impl::get() const {
212212
throw_if_state_is(program_state::none);
213-
if (is_host() || getPlugin().getBackend() != cl::sycl::backend::opencl) {
213+
if (is_host()) {
214214
throw invalid_object_error(
215215
"This instance of program doesn't support OpenCL interoperability.",
216216
PI_INVALID_PROGRAM);

sycl/source/detail/queue_impl.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class queue_impl {
126126

127127
/// \return an OpenCL interoperability queue handle.
128128
cl_command_queue get() {
129-
if (MHostQueue || getPlugin().getBackend() != cl::sycl::backend::opencl) {
129+
if (MHostQueue) {
130130
throw invalid_object_error(
131131
"This instance of queue doesn't support OpenCL interoperability",
132132
PI_INVALID_QUEUE);

0 commit comments

Comments
 (0)