| 235 | } |
| 236 | |
| 237 | unique_ptr<argument_buffer> cuda_kernel::create_argument_buffer_internal(const compute_queue& cqueue, |
| 238 | const kernel_entry& kern_entry, |
| 239 | const llvm_toolchain::arg_info& arg floor_unused, |
| 240 | const uint32_t& user_arg_index, |
| 241 | const uint32_t& ll_arg_index, |
| 242 | const COMPUTE_MEMORY_FLAG& add_mem_flags) const { |
| 243 | const auto& dev = cqueue.get_device(); |
| 244 | const auto& cuda_entry = (const cuda_kernel_entry&)kern_entry; |
| 245 | |
| 246 | // check if info exists |
| 247 | const auto& arg_info = cuda_entry.info->args[ll_arg_index].argument_buffer_info; |
| 248 | if (!arg_info) { |
| 249 | log_error("no argument buffer info for arg at index #$", user_arg_index); |
| 250 | return {}; |
| 251 | } |
| 252 | |
| 253 | const auto arg_buffer_size = cuda_entry.info->args[ll_arg_index].size; |
| 254 | if (arg_buffer_size == 0) { |
| 255 | log_error("computed argument buffer size is 0"); |
| 256 | return {}; |
| 257 | } |
| 258 | |
| 259 | // create the argument buffer |
| 260 | auto buf = dev.context->create_buffer(cqueue, arg_buffer_size, COMPUTE_MEMORY_FLAG::READ | COMPUTE_MEMORY_FLAG::HOST_WRITE | add_mem_flags); |
| 261 | buf->set_debug_label(kern_entry.info->name + "_arg_buffer"); |
| 262 | return make_unique<cuda_argument_buffer>(*this, buf, *arg_info); |
| 263 | } |
| 264 | |
| 265 | #endif |
nothing calls this directly
no test coverage detected