| 51 | } |
| 52 | |
| 53 | HipStaticKernelLaunchCommand::HipStaticKernelLaunchCommand( |
| 54 | const void *host_func, void **params, void **extra, bool copy_param) |
| 55 | : HipKernelCommand(params, extra, copy_param), host_func_(host_func) |
| 56 | { |
| 57 | if (!copy_param) return; |
| 58 | uint32_t all_params_size, num_parameters; |
| 59 | KernelParamManager::Instance()->GetStaticKernelParams(host_func_, &num_parameters, &all_params_size); |
| 60 | param_cnt_ = num_parameters; |
| 61 | if (param_cnt_ == 0) return; |
| 62 | param_copied_ = true; |
| 63 | kernel_params_ = (void **)malloc(param_cnt_ * sizeof(void *)); // free in destructor |
| 64 | param_data_ = (char *)malloc(all_params_size); // free in destructor |
| 65 | XDEBG("HipStaticKernelLaunchCommand(%p): param_cnt_ = %lu", this, param_cnt_); |
| 66 | for (size_t i = 0; i < param_cnt_; ++i) { |
| 67 | size_t offset, size; |
| 68 | KernelParamManager::Instance()->GetStaticKernelParamInfo(host_func_, i, &offset, &size); |
| 69 | kernel_params_[i] = (void*)¶m_data_[offset]; |
| 70 | memcpy(kernel_params_[i], original_kernel_params_[i], size); |
| 71 | XDEBG("HipStaticKernelLaunchCommand(%p): param %zu, offset = %zu, size = %zu", this, i, offset, size); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | HipDynamicKernelLaunchCommand::HipDynamicKernelLaunchCommand( |
| 76 | hipFunction_t function, void **kernel_params, void **extra_params, bool copy_param) |
nothing calls this directly
no test coverage detected