mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Add alignment check to CL_DEVICE_MEM_BASE_ADDR_ALIGN for compressed buffers
Change-Id: I44fa231411a754fb24398a4a9727ca16f257220e Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
e9a35fbf88
commit
cefa3e3119
@@ -98,6 +98,11 @@ inline bool isAligned(T *ptr) {
|
||||
return ((reinterpret_cast<uintptr_t>(ptr)) % alignment) == 0;
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
inline bool isAligned(T1 ptr, T2 alignment) {
|
||||
return ((static_cast<size_t>(ptr)) & (static_cast<size_t>(alignment) - 1u)) == 0;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool isAligned(T *ptr) {
|
||||
return (reinterpret_cast<uintptr_t>(ptr) & (alignof(T) - 1)) == 0;
|
||||
|
||||
Reference in New Issue
Block a user