Skip to content

Commit eaa436f

Browse files
authored
[SYCL][CUDA] Add std::ignore for USM alloc args that are only used in an assert. (#10899)
This should fix the post-commit build fails.
1 parent 12fb6e9 commit eaa436f

File tree

1 file changed

+12
-0
lines changed
  • sycl/plugins/unified_runtime/ur/adapters/cuda

1 file changed

+12
-0
lines changed

sycl/plugins/unified_runtime/ur/adapters/cuda/usm.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,12 @@ ur_result_t USMDeviceAllocImpl(void **ResultPtr, ur_context_handle_t Context,
144144
return Err;
145145
}
146146

147+
#ifdef NDEBUG
148+
std::ignore = Alignment;
149+
#else
147150
assert((Alignment == 0 ||
148151
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0));
152+
#endif
149153
return UR_RESULT_SUCCESS;
150154
}
151155

@@ -161,8 +165,12 @@ ur_result_t USMSharedAllocImpl(void **ResultPtr, ur_context_handle_t Context,
161165
return Err;
162166
}
163167

168+
#ifdef NDEBUG
169+
std::ignore = Alignment;
170+
#else
164171
assert((Alignment == 0 ||
165172
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0));
173+
#endif
166174
return UR_RESULT_SUCCESS;
167175
}
168176

@@ -176,8 +184,12 @@ ur_result_t USMHostAllocImpl(void **ResultPtr, ur_context_handle_t Context,
176184
return Err;
177185
}
178186

187+
#ifdef NDEBUG
188+
std::ignore = Alignment;
189+
#else
179190
assert((Alignment == 0 ||
180191
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0));
192+
#endif
181193
return UR_RESULT_SUCCESS;
182194
}
183195

0 commit comments

Comments
 (0)