| 119 | void *omp_sscp_executable_object::get_module() const { return _module; } |
| 120 | |
| 121 | result omp_sscp_executable_object::build( |
| 122 | const std::string &source, const std::vector<std::string> &kernel_names) { |
| 123 | |
| 124 | if (_module != nullptr) |
| 125 | return make_success(); |
| 126 | |
| 127 | if (auto result = make_shared_library_from_blob(_module, source, _kernel_cache_path); |
| 128 | !result.is_success()) |
| 129 | return result; |
| 130 | |
| 131 | _kernel_names = kernel_names; |
| 132 | // find all kernel symbols |
| 133 | for (const auto &kernel_name : _kernel_names) { |
| 134 | std::string message; |
| 135 | if (auto kernel = (omp_sscp_kernel *)common::get_symbol_from_library( |
| 136 | _module, kernel_name, message)) { |
| 137 | _kernels.emplace(kernel_name, kernel); |
| 138 | } else { |
| 139 | if (!message.empty()) { |
| 140 | HIPSYCL_DEBUG_WARNING << "[omp_sscp_executable_object] " << message << std::endl; |
| 141 | } |
| 142 | return make_error(__acpp_here(), |
| 143 | error_info{"omp_sscp_executable_object: could not load " |
| 144 | "kernel from shared library"}); |
| 145 | } |
| 146 | } |
| 147 | return make_success(); |
| 148 | } |
| 149 | |
| 150 | bool omp_sscp_executable_object::contains( |
| 151 | const std::string &backend_kernel_name) const { |
no test coverage detected