Skip to content

Commit 2c78174

Browse files
committed
Check for direct extension support, remove redundancy, improve if statement check performance and cosmetic changes
1 parent 7af3b4c commit 2c78174

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

sycl/include/sycl/ext/intel/experimental/usm_properties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ struct is_property<ext::intel::experimental::property::usm::buffer_location>
3434
: std::true_type {};
3535

3636
} // namespace sycl
37-
} // __SYCL_INLINE_NAMESPACE(cl)
37+
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/source/detail/usm/usm_impl.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,11 @@ void *alignedAlloc(size_t Alignment, size_t Size, const context &Ctxt,
129129
Id = detail::getSyclObjImpl(Dev)->getHandleRef();
130130
// Parse out buffer location property
131131
// Buffer location is only supported on FPGA devices
132-
bool IsBufferLocSupported = true;
133-
if (!Dev.has_extension("cl_intel_mem_alloc_buffer_location")) {
134-
IsBufferLocSupported = false;
135-
}
136-
if (PropList.has_property<cl::sycl::ext::intel::experimental::property::
137-
usm::buffer_location>() &&
138-
IsBufferLocSupported) {
132+
bool IsBufferLocSupported =
133+
Dev.has_extension("cl_intel_mem_alloc_buffer_location");
134+
if (IsBufferLocSupported &&
135+
PropList.has_property<cl::sycl::ext::intel::experimental::property::
136+
usm::buffer_location>()) {
139137
auto location = PropList
140138
.get_property<cl::sycl::ext::intel::experimental::
141139
property::usm::buffer_location>()

0 commit comments

Comments
 (0)