Skip to content

Commit 7f97cd7

Browse files
committed
Check if loaded_bin is null for hostch
1 parent d4a09d8 commit 7f97cd7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/acl_hostch.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ void acl_read_program_hostpipe(void *user_data, acl_device_op_t *op) {
816816
// The host_pipe_info stored in the dev_prog->program_hostpipe_map
817817
// Contains the static information of the pipe, like protocol
818818

819+
assert(event->command_queue->device->loaded_bin != NULL &&
820+
"No loaded binary for read hostpipe");
819821
acl_device_program_info_t *dev_prog =
820822
event->command_queue->device->loaded_bin->get_dev_prog();
821823
auto host_pipe_info = dev_prog->program_hostpipe_map.at(
@@ -966,6 +968,8 @@ void acl_write_program_hostpipe(void *user_data, acl_device_op_t *op) {
966968
// The host_pipe_info stored in the dev_prog->program_hostpipe_map
967969
// Contains the static information of the pipe, like protocol
968970

971+
assert(event->command_queue->device->loaded_bin != NULL &&
972+
"No loaded binary for write hostpipe");
969973
acl_device_program_info_t *dev_prog =
970974
event->command_queue->device->loaded_bin->get_dev_prog();
971975
auto host_pipe_info = dev_prog->program_hostpipe_map.at(
@@ -1198,6 +1202,8 @@ CL_API_ENTRY cl_int CL_API_CALL clEnqueueReadHostPipeINTEL(
11981202
ERR_RET(CL_INVALID_VALUE, context, "Invalid Pipe Symbol");
11991203
}
12001204

1205+
assert(device->loaded_bin != NULL &&
1206+
"No loaded binary for enqueue hostpipe read");
12011207
acl_device_program_info_t *dev_prog = device->loaded_bin->get_dev_prog();
12021208

12031209
auto search = dev_prog->program_hostpipe_map.find(std::string(pipe_symbol));
@@ -1271,6 +1277,8 @@ CL_API_ENTRY cl_int CL_API_CALL clEnqueueWriteHostPipeINTEL(
12711277
ERR_RET(CL_INVALID_VALUE, context, "Invalid Pipe Symbol");
12721278
}
12731279

1280+
assert(device->loaded_bin != NULL &&
1281+
"No loaded binary for enqueue hostpipe write");
12741282
acl_device_program_info_t *dev_prog = device->loaded_bin->get_dev_prog();
12751283

12761284
auto search = dev_prog->program_hostpipe_map.find(std::string(pipe_symbol));

0 commit comments

Comments
 (0)