MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ExecutePrimitive

Function ExecutePrimitive

tensorflow/core/util/mkl_util.h:609–627  ·  view source on GitHub ↗

TODO merge with the execute_primitives.

Source from the content-addressed store, hash-verified

607
608// TODO merge with the execute_primitives.
609inline 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}
628template <typename T>
629inline Status ConvertMklToTF(OpKernelContext* context,
630 const Tensor& input_mkl_tensor,

Callers 4

ComputeMethod · 0.85
PrepareAndExecuteNetMethod · 0.85
ConvertMklToTFFunction · 0.85
CreateAndExecuteReorderFunction · 0.85

Calls 7

MklDnnThreadPoolClass · 0.85
CreateStreamFunction · 0.85
sizeMethod · 0.45
resetMethod · 0.45
executeMethod · 0.45
atMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected