diff --git a/sycl/include/sycl/usm.hpp b/sycl/include/sycl/usm.hpp index 54fa09694c37e..4ee726f1ecb1c 100644 --- a/sycl/include/sycl/usm.hpp +++ b/sycl/include/sycl/usm.hpp @@ -179,7 +179,7 @@ T *aligned_alloc_device( size_t Alignment, size_t Count, const device &Dev, const context &Ctxt, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return static_cast(aligned_alloc_device(max(Alignment, alignof(T)), Count * sizeof(T), Dev, Ctxt, PropList, CodeLoc)); @@ -193,7 +193,7 @@ T *aligned_alloc_device( size_t Alignment, size_t Count, const queue &Q, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return aligned_alloc_device(Alignment, Count, Q.get_device(), Q.get_context(), PropList, CodeLoc); } else { @@ -238,7 +238,7 @@ T *aligned_alloc_host( size_t Alignment, size_t Count, const context &Ctxt, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return static_cast(aligned_alloc_host(std ::max(Alignment, alignof(T)), Count * sizeof(T), Ctxt, PropList, CodeLoc)); @@ -252,7 +252,7 @@ T *aligned_alloc_host( size_t Alignment, size_t Count, const queue &Q, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return aligned_alloc_host(Alignment, Count, Q.get_context(), PropList, CodeLoc); } else { @@ -265,7 +265,7 @@ T *aligned_alloc_shared( size_t Alignment, size_t Count, const device &Dev, const context &Ctxt, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return static_cast(aligned_alloc_shared(max(Alignment, alignof(T)), Count * sizeof(T), Dev, Ctxt, PropList, CodeLoc)); @@ -279,7 +279,7 @@ T *aligned_alloc_shared( size_t Alignment, size_t Count, const queue &Q, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return aligned_alloc_shared(Alignment, Count, Q.get_device(), Q.get_context(), PropList, CodeLoc); } else { @@ -310,7 +310,7 @@ T *aligned_alloc( size_t Alignment, size_t Count, const device &Dev, const context &Ctxt, usm::alloc Kind, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return static_cast(aligned_alloc(max(Alignment, alignof(T)), Count * sizeof(T), Dev, Ctxt, Kind, PropList, CodeLoc)); @@ -324,7 +324,7 @@ T *aligned_alloc( size_t Alignment, size_t Count, const queue &Q, usm::alloc Kind, const property_list &PropList = {}, const detail::code_location &CodeLoc = detail::code_location::current()) { - if (Alignment && !(Alignment & (Alignment - 1))) { + if (!(Alignment & (Alignment - 1))) { return aligned_alloc(Alignment, Count, Q.get_device(), Q.get_context(), Kind, PropList, CodeLoc); } else { diff --git a/sycl/test-e2e/USM/align.cpp b/sycl/test-e2e/USM/align.cpp index 796be73a82444..07da3a6e81ff4 100755 --- a/sycl/test-e2e/USM/align.cpp +++ b/sycl/test-e2e/USM/align.cpp @@ -90,7 +90,7 @@ template void testAlign(sycl::queue &q, unsigned align) { [&]() { return ATDevice(3, q); }, [&]() { return ATDevice(5, dev, Ctx); }, [&]() { return ATHost(7, q); }, [&]() { return ATHost(9, Ctx); }, [&]() { return ATShared(1919, q); }, - [&]() { return ATShared(0, dev, Ctx); }, + [&]() { return ATShared(11, dev, Ctx); }, [&]() { return ATAnnotated(15, q, alloc::device); }, [&]() { return ATAnnotated(17, dev, Ctx, alloc::host); }});