Skip to content

Commit f4bc596

Browse files
committed
Only pass buffer location property if in simulation environemnt
1 parent ec25a48 commit f4bc596

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/acl_hal_mmd.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,10 +2767,19 @@ void *acl_hal_mmd_host_alloc(const std::vector<cl_device_id> devices,
27672767
handles[i] = device_info[physical_device_id].handle;
27682768
}
27692769

2770-
result = dispatch->aocl_mmd_host_alloc(
2771-
handles, devices.size(), size, alignment,
2772-
(aocl_mmd_mem_properties_t *)properties, error);
2773-
acl_delete_arr(handles);
2770+
int use_offline_only;
2771+
acl_get_offline_device_user_setting(&use_offline_only);
2772+
2773+
if (use_offline_only == ACL_CONTEXT_MPSIM) {
2774+
result = dispatch->aocl_mmd_host_alloc(
2775+
handles, devices.size(), size, alignment,
2776+
(aocl_mmd_mem_properties_t *)properties, error);
2777+
acl_delete_arr(handles);
2778+
} else {
2779+
result = dispatch->aocl_mmd_host_alloc(handles, devices.size(), size,
2780+
alignment, nullptr, error);
2781+
acl_delete_arr(handles);
2782+
}
27742783

27752784
if (error) {
27762785
switch (*error) {

0 commit comments

Comments
 (0)