| 74 | } |
| 75 | |
| 76 | ral::execution::task_result kernel::process(std::vector<std::unique_ptr<ral::frame::BlazingTable>> inputs, |
| 77 | std::shared_ptr<ral::cache::CacheMachine> output, |
| 78 | cudaStream_t stream, |
| 79 | const std::map<std::string, std::string>& args){ |
| 80 | |
| 81 | if(inputs.size()==0){ |
| 82 | return {ral::execution::task_status::SUCCESS, std::string(), std::vector< std::unique_ptr<ral::frame::BlazingTable> > ()}; |
| 83 | } |
| 84 | |
| 85 | size_t bytes = 0; |
| 86 | size_t rows = 0; |
| 87 | for(auto & input : inputs){ |
| 88 | bytes += input->sizeInBytes(); |
| 89 | rows += input->num_rows(); |
| 90 | } |
| 91 | auto result = do_process(std::move(inputs), output, stream, args); |
| 92 | if(result.status == ral::execution::SUCCESS){ |
| 93 | // increment these AFTER its been processed successfully |
| 94 | total_input_bytes_processed += bytes; |
| 95 | total_input_rows_processed += rows; |
| 96 | } else { |
| 97 | auto logger = spdlog::get("batch_logger"); |
| 98 | if (logger) { |
| 99 | logger->error("|||{info}|||||", |
| 100 | "info"_a="ERROR in kernel::process trying to do do_process. Kernel name is: " + this->kernel_name() + " Kernel id is: " + std::to_string(this->kernel_id)); |
| 101 | } |
| 102 | } |
| 103 | return std::move(result); |
| 104 | } |
| 105 | |
| 106 | void kernel::add_task(size_t task_id){ |
| 107 | std::lock_guard<std::mutex> lock(kernel_mutex); |
nothing calls this directly
no test coverage detected