From 5135b7ee55740bb96feb182c1a227c3c5232336f Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Tue, 7 Jun 2022 19:18:06 -0400 Subject: [PATCH] [SYCL] Query USM buffer location extension only if property is passed to malloc_shared This aligns the implementation with malloc_host and avoids an unneeded call in the case where the FPGA backend is used without buffer location. This amends https://github.com/intel/llvm/pull/6218 See also https://github.com/intel/llvm/pull/6220 --- sycl/source/detail/usm/usm_impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sycl/source/detail/usm/usm_impl.cpp b/sycl/source/detail/usm/usm_impl.cpp index fb32afdd703b4..9fb8bc5d37a46 100644 --- a/sycl/source/detail/usm/usm_impl.cpp +++ b/sycl/source/detail/usm/usm_impl.cpp @@ -162,9 +162,9 @@ void *alignedAlloc(size_t Alignment, size_t Size, const context &Ctxt, *PropsIter++ = PI_MEM_ALLOC_DEVICE_READ_ONLY; } - if (Dev.has_extension("cl_intel_mem_alloc_buffer_location") && - PropList.has_property()) { + if (PropList.has_property() && + Dev.has_extension("cl_intel_mem_alloc_buffer_location")) { *PropsIter++ = PI_MEM_USM_ALLOC_BUFFER_LOCATION; *PropsIter++ = PropList .get_property