TODO merge with the execute_primitives.
| 607 | |
| 608 | // TODO merge with the execute_primitives. |
| 609 | inline void ExecutePrimitive(const std::vector<primitive>& net, |
| 610 | const std::vector<MemoryArgsMap>* net_args, |
| 611 | const engine& cpu_engine, |
| 612 | OpKernelContext* context = nullptr) { |
| 613 | DCHECK(net_args); |
| 614 | DCHECK_EQ(net.size(), net_args->size()); |
| 615 | std::unique_ptr<stream> cpu_stream; |
| 616 | MklDnnThreadPool eigen_tp; |
| 617 | if (context != nullptr) { |
| 618 | eigen_tp = MklDnnThreadPool(context); |
| 619 | cpu_stream.reset(CreateStream(&eigen_tp, cpu_engine)); |
| 620 | } else { |
| 621 | cpu_stream.reset(CreateStream(nullptr, cpu_engine)); |
| 622 | } |
| 623 | for (size_t i = 0; i < net.size(); ++i) { |
| 624 | net.at(i).execute(*cpu_stream, net_args->at(i)); |
| 625 | } |
| 626 | cpu_stream->wait(); |
| 627 | } |
| 628 | template <typename T> |
| 629 | inline Status ConvertMklToTF(OpKernelContext* context, |
| 630 | const Tensor& input_mkl_tensor, |
no test coverage detected