File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
source/adapters/native_cpu Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ ur_result_t getProviderNativeError(const char *, int32_t) {
24
24
static ur_result_t alloc_helper (ur_context_handle_t hContext,
25
25
const ur_usm_desc_t *pUSMDesc, size_t size,
26
26
void **ppMem, ur_usm_type_t type) {
27
- auto alignment = pUSMDesc ? pUSMDesc->align : 1u ;
28
- UR_ASSERT ((alignment & (alignment - 1 )) == 0 , UR_RESULT_ERROR_INVALID_VALUE );
27
+ auto alignment = ( pUSMDesc && pUSMDesc-> align ) ? pUSMDesc->align : 1u ;
28
+ UR_ASSERT (isPowerOf2 (alignment), UR_RESULT_ERROR_UNSUPPORTED_ALIGNMENT );
29
29
UR_ASSERT (ppMem, UR_RESULT_ERROR_INVALID_NULL_POINTER);
30
30
// TODO: Check Max size when UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE is implemented
31
31
UR_ASSERT (size > 0 , UR_RESULT_ERROR_INVALID_USM_SIZE);
You can’t perform that action at this time.
0 commit comments