Skip to content

Commit 0c35456

Browse files
schittirvladimirlaz
authored andcommitted
[SYCL] Avoid OpenCL API call in cl::sycl::queue::get_info() on host device.
Signed-off-by: Chittireddy, Sindhu <[email protected]> Signed-off-by: Vladimir Lazarev <[email protected]>
1 parent ee4fe59 commit 0c35456

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ namespace sycl {
1616
namespace detail {
1717
template <> cl_uint queue_impl::get_info<info::queue::reference_count>() const {
1818
cl_uint result = 0;
19-
CHECK_OCL_CODE(clGetCommandQueueInfo(m_CommandQueue, CL_QUEUE_REFERENCE_COUNT,
20-
sizeof(result), &result, nullptr));
19+
if (!is_host())
20+
CHECK_OCL_CODE(clGetCommandQueueInfo(m_CommandQueue,
21+
CL_QUEUE_REFERENCE_COUNT,
22+
sizeof(result), &result, nullptr));
2123
return result;
2224
}
2325

0 commit comments

Comments
 (0)