| 425 | } |
| 426 | |
| 427 | result omp_queue::submit_sscp_kernel_from_code_object( |
| 428 | hcf_object_id hcf_object, std::string_view kernel_name, |
| 429 | const rt::hcf_kernel_info *kernel_info, const rt::range<3> &num_groups, |
| 430 | const rt::range<3> &group_size, unsigned local_mem_size, void **args, |
| 431 | std::size_t *arg_sizes, std::size_t num_args, |
| 432 | const kernel_configuration &initial_config) { |
| 433 | #ifdef HIPSYCL_WITH_SSCP_COMPILER |
| 434 | common::spin_lock_guard lock{_sscp_submission_spin_lock}; |
| 435 | |
| 436 | if (!kernel_info) { |
| 437 | return make_error( |
| 438 | __acpp_here(), |
| 439 | error_info{"omp_queue: Could not obtain hcf kernel info for kernel " + |
| 440 | std::string{kernel_name}}); |
| 441 | } |
| 442 | |
| 443 | |
| 444 | _arg_mapper.construct_mapping(*kernel_info, args, arg_sizes, num_args); |
| 445 | |
| 446 | if (!_arg_mapper.mapping_available()) { |
| 447 | return make_error( |
| 448 | __acpp_here(), |
| 449 | error_info{ |
| 450 | "omp_queue: Could not map C++ arguments to kernel arguments"}); |
| 451 | } |
| 452 | |
| 453 | kernel_adaptivity_engine adaptivity_engine{ |
| 454 | hcf_object, kernel_name, kernel_info, _arg_mapper, num_groups, |
| 455 | group_size, args, arg_sizes, num_args, local_mem_size}; |
| 456 | |
| 457 | _config = initial_config; |
| 458 | |
| 459 | _config.append_base_configuration( |
| 460 | kernel_base_config_parameter::backend_id, backend_id::omp); |
| 461 | _config.append_base_configuration( |
| 462 | kernel_base_config_parameter::compilation_flow, |
| 463 | compilation_flow::sscp); |
| 464 | _config.append_base_configuration( |
| 465 | kernel_base_config_parameter::hcf_object_id, hcf_object); |
| 466 | |
| 467 | for(const auto& flag : kernel_info->get_compilation_flags()) |
| 468 | _config.set_build_flag(flag); |
| 469 | for(const auto& opt : kernel_info->get_compilation_options()) |
| 470 | _config.set_build_option(opt.first, opt.second); |
| 471 | |
| 472 | auto binary_configuration_id = |
| 473 | adaptivity_engine.finalize_binary_configuration(_config); |
| 474 | auto code_object_configuration_id = binary_configuration_id; |
| 475 | |
| 476 | auto get_image_and_kernel_names = |
| 477 | [&](std::vector<std::string> &contained_kernels) -> std::string { |
| 478 | return adaptivity_engine.select_image_and_kernels(&contained_kernels); |
| 479 | }; |
| 480 | |
| 481 | auto jit_compiler = [&](std::string &compiled_image) -> bool { |
| 482 | const common::hcf_container *hcf = rt::hcf_cache::get().get_hcf(hcf_object); |
| 483 | |
| 484 | std::vector<std::string> kernel_names; |
no test coverage detected