| 1166 | } |
| 1167 | |
| 1168 | std::unique_ptr<argument_buffer> host_function::create_argument_buffer_internal(const device_queue& cqueue, |
| 1169 | const function_entry& kern_entry, |
| 1170 | const toolchain::arg_info& arg floor_unused, |
| 1171 | const uint32_t& user_arg_index, |
| 1172 | const uint32_t& ll_arg_index, |
| 1173 | const MEMORY_FLAG& add_mem_flags, |
| 1174 | const bool zero_init) const { |
| 1175 | const auto& dev = cqueue.get_device(); |
| 1176 | const auto& host_entry = (const host_function_entry&)kern_entry; |
| 1177 | |
| 1178 | // check if info exists |
| 1179 | const auto& arg_info = host_entry.info->args[ll_arg_index].argument_buffer_info; |
| 1180 | if (!arg_info) { |
| 1181 | log_error("no argument buffer info for arg at index #$", user_arg_index); |
| 1182 | return {}; |
| 1183 | } |
| 1184 | |
| 1185 | const auto arg_buffer_size = host_entry.info->args[ll_arg_index].size; |
| 1186 | if (arg_buffer_size == 0) { |
| 1187 | log_error("computed argument buffer size is 0"); |
| 1188 | return {}; |
| 1189 | } |
| 1190 | |
| 1191 | // create the argument buffer |
| 1192 | auto buf = dev.context->create_buffer(cqueue, arg_buffer_size, MEMORY_FLAG::READ | MEMORY_FLAG::HOST_WRITE | add_mem_flags); |
| 1193 | buf->set_debug_label(kern_entry.info->name + "_arg_buffer"); |
| 1194 | if (zero_init) { |
| 1195 | buf->zero(cqueue); |
| 1196 | } |
| 1197 | return std::make_unique<host_argument_buffer>(*this, buf, *arg_info); |
| 1198 | } |
| 1199 | |
| 1200 | } // namespace fl |
| 1201 |
nothing calls this directly
no test coverage detected