@@ -3161,18 +3161,17 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
3161
3161
if (DeviceIsIntegrated) {
3162
3162
if (enableBufferPooling ())
3163
3163
Result = piextUSMHostAlloc (&Ptr, Context, nullptr , Size, Alignment);
3164
- else {
3165
- ZeHostMemAllocHelper (&Ptr, Context, Size);
3166
- }
3164
+ else
3165
+ Result = ZeHostMemAllocHelper (&Ptr, Context, Size);
3167
3166
} else if (Context->SingleRootDevice ) {
3168
3167
// If we have a single discrete device or all devices in the context are
3169
3168
// sub-devices of the same device then we can allocate on device
3170
3169
if (enableBufferPooling ())
3171
3170
Result = piextUSMDeviceAlloc (&Ptr, Context, Context->SingleRootDevice ,
3172
3171
nullptr , Size, Alignment);
3173
- else {
3174
- ZeDeviceMemAllocHelper (&Ptr, Context, Context->SingleRootDevice , Size);
3175
- }
3172
+ else
3173
+ Result = ZeDeviceMemAllocHelper (&Ptr, Context, Context->SingleRootDevice ,
3174
+ Size);
3176
3175
} else {
3177
3176
// Context with several gpu cards. Temporarily use host allocation because
3178
3177
// it is accessible by all devices. But it is not good in terms of
@@ -3182,9 +3181,8 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
3182
3181
// resources as backing buffers to allow those transfers.
3183
3182
if (enableBufferPooling ())
3184
3183
Result = piextUSMHostAlloc (&Ptr, Context, nullptr , Size, Alignment);
3185
- else {
3186
- ZeHostMemAllocHelper (&Ptr, Context, Size);
3187
- }
3184
+ else
3185
+ Result = ZeHostMemAllocHelper (&Ptr, Context, Size);
3188
3186
}
3189
3187
3190
3188
if (enableBufferPooling () && Result != PI_SUCCESS)
0 commit comments