@@ -150,7 +150,11 @@ CL_API_ENTRY void *CL_API_CALL clHostMemAllocINTEL(
150
150
{
151
151
auto mmd_properties_it = mmd_properties.begin ();
152
152
if (mem_id) {
153
- *mmd_properties_it++ = AOCL_MMD_MEM_PROPERTIES_BUFFER_LOCATION;
153
+ int use_offline_only;
154
+ acl_get_offline_device_user_setting (&use_offline_only);
155
+ if (use_offline_only == ACL_CONTEXT_MPSIM) {
156
+ *mmd_properties_it++ = AOCL_MMD_MEM_PROPERTIES_BUFFER_LOCATION;
157
+ }
154
158
*mmd_properties_it++ = *mem_id;
155
159
}
156
160
*mmd_properties_it++ = 0 ;
@@ -163,18 +167,9 @@ CL_API_ENTRY void *CL_API_CALL clHostMemAllocINTEL(
163
167
UNLOCK_BAIL_INFO (CL_OUT_OF_HOST_MEMORY, context, " Out of host memory" );
164
168
}
165
169
166
- int use_offline_only;
167
- acl_get_offline_device_user_setting (&use_offline_only);
168
- mem_properties_t *properties_ptr;
169
- if (use_offline_only == ACL_CONTEXT_MPSIM) {
170
- properties_ptr = mmd_properties.data ();
171
- } else {
172
- properties_ptr = nullptr ;
173
- }
174
-
175
170
int error = 0 ;
176
171
void *mem = acl_get_hal ()->host_alloc (devices, size, alignment,
177
- properties_ptr , &error);
172
+ mmd_properties. data () , &error);
178
173
if (error) {
179
174
acl_free (usm_alloc);
180
175
switch (error) {
@@ -445,7 +440,11 @@ clSharedMemAllocINTEL(cl_context context, cl_device_id device,
445
440
{
446
441
auto mmd_properties_it = mmd_properties.begin ();
447
442
if (mem_id) {
448
- *mmd_properties_it++ = AOCL_MMD_MEM_PROPERTIES_BUFFER_LOCATION;
443
+ int use_offline_only;
444
+ acl_get_offline_device_user_setting (&use_offline_only);
445
+ if (use_offline_only == ACL_CONTEXT_MPSIM) {
446
+ *mmd_properties_it++ = AOCL_MMD_MEM_PROPERTIES_BUFFER_LOCATION;
447
+ }
449
448
*mmd_properties_it++ = *mem_id;
450
449
}
451
450
*mmd_properties_it++ = 0 ;
@@ -458,18 +457,9 @@ clSharedMemAllocINTEL(cl_context context, cl_device_id device,
458
457
UNLOCK_BAIL_INFO (CL_OUT_OF_HOST_MEMORY, context, " Out of host memory" );
459
458
}
460
459
461
- int use_offline_only;
462
- acl_get_offline_device_user_setting (&use_offline_only);
463
- mem_properties_t *properties_ptr;
464
- if (use_offline_only == ACL_CONTEXT_MPSIM) {
465
- properties_ptr = mmd_properties.data ();
466
- } else {
467
- properties_ptr = nullptr ;
468
- }
469
-
470
460
int error;
471
461
void *mem = acl_get_hal ()->shared_alloc (device, size, alignment,
472
- properties_ptr , &error);
462
+ mmd_properties. data () , &error);
473
463
if (mem == NULL ) {
474
464
acl_free (usm_alloc);
475
465
switch (error) {
0 commit comments