| 567 | } |
| 568 | |
| 569 | result hip_queue::submit_sscp_kernel_from_code_object( |
| 570 | hcf_object_id hcf_object, std::string_view kernel_name, |
| 571 | const rt::hcf_kernel_info *kernel_info, const rt::range<3> &num_groups, |
| 572 | const rt::range<3> &group_size, unsigned local_mem_size, void **args, |
| 573 | std::size_t *arg_sizes, std::size_t num_args, |
| 574 | const kernel_configuration &initial_config) { |
| 575 | #ifdef HIPSYCL_WITH_SSCP_COMPILER |
| 576 | this->activate_device(); |
| 577 | |
| 578 | int device = _dev.get_id(); |
| 579 | |
| 580 | hip_hardware_context *ctx = static_cast<hip_hardware_context *>( |
| 581 | this->_backend->get_hardware_manager()->get_device(device)); |
| 582 | |
| 583 | std::string target_arch_name = ctx->get_device_arch(); |
| 584 | |
| 585 | if(!kernel_info) { |
| 586 | return make_error( |
| 587 | __acpp_here(), |
| 588 | error_info{"hip_queue: Could not obtain hcf kernel info for kernel " + |
| 589 | std::string{kernel_name}}); |
| 590 | } |
| 591 | |
| 592 | |
| 593 | _arg_mapper.construct_mapping(*kernel_info, args, arg_sizes, num_args); |
| 594 | |
| 595 | if(!_arg_mapper.mapping_available()) { |
| 596 | return make_error( |
| 597 | __acpp_here(), |
| 598 | error_info{ |
| 599 | "hip_queue: Could not map C++ arguments to kernel arguments"}); |
| 600 | } |
| 601 | |
| 602 | kernel_adaptivity_engine adaptivity_engine{ |
| 603 | hcf_object, kernel_name, kernel_info, _arg_mapper, num_groups, |
| 604 | group_size, args, arg_sizes, num_args, local_mem_size}; |
| 605 | |
| 606 | _config = initial_config; |
| 607 | _config.append_base_configuration( |
| 608 | kernel_base_config_parameter::backend_id, backend_id::hip); |
| 609 | _config.append_base_configuration( |
| 610 | kernel_base_config_parameter::compilation_flow, |
| 611 | compilation_flow::sscp); |
| 612 | _config.append_base_configuration( |
| 613 | kernel_base_config_parameter::hcf_object_id, hcf_object); |
| 614 | |
| 615 | for(const auto& flag : kernel_info->get_compilation_flags()) |
| 616 | _config.set_build_flag(flag); |
| 617 | for(const auto& opt : kernel_info->get_compilation_options()) |
| 618 | _config.set_build_option(opt.first, opt.second); |
| 619 | |
| 620 | _config.set_build_option(kernel_build_option::amdgpu_target_device, |
| 621 | target_arch_name); |
| 622 | _config.set_build_option(kernel_build_option::desired_subgroup_size, |
| 623 | ctx->get_wavefront_size()); |
| 624 | |
| 625 | auto binary_configuration_id = adaptivity_engine.finalize_binary_configuration(_config); |
| 626 | auto code_object_configuration_id = binary_configuration_id; |
no test coverage detected