This repository was archived by the owner on Jan 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Expand file tree Collapse file tree 3 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ runtime::cpu::CPU_CallFrame::CPU_CallFrame(std::shared_ptr<CPU_ExternalFunction>
4949
5050runtime::cpu::CPU_CallFrame::~CPU_CallFrame ()
5151{
52+ cleanup_runtime_context ();
5253 if (!m_external_function->is_direct_execution ())
5354 {
5455 NGRAPH_ASSERT (m_compiled_destroy_ctx_func) << " compiled_destroy_ctx_func cannot be null." ;
Original file line number Diff line number Diff line change @@ -68,13 +68,11 @@ namespace ngraph
6868 for (int i = 0 ; i < num_thread_pools; i++)
6969 {
7070 int num_threads_per_pool;
71- # if defined(EIGEN_OPENMP)
71+
7272 // Eigen threadpool will still be used for reductions
7373 // and other tensor operations that dont use a parallelFor
74- num_threads_per_pool = 1 ;
75- #else
7674 num_threads_per_pool = GetNumCores ();
77- # endif
75+
7876 // User override
7977 char * eigen_tp_count = std::getenv (" NGRAPH_CPU_EIGEN_THREAD_COUNT" );
8078 if (eigen_tp_count != nullptr )
Original file line number Diff line number Diff line change @@ -712,21 +712,16 @@ bool runtime::cpu::pass::CPUMemoryAssignment::run_on_function(shared_ptr<ngraph:
712712 auto input_op = std::static_pointer_cast<op::Op>(input_node);
713713 if (auto input_op_annotations = input_op->get_op_annotations ())
714714 {
715- // when input is cacheable, do not allow destructive oi
716- if (input_op_annotations->is_cacheable ())
717- {
718- NGRAPH_DEBUG << " cpu_memory_assignment: cacheable input, no "
719- " destructive oi" ;
720- continue ;
721- }
722715 // when reusing memory, ops with different cacheabilities are using different memory manager
723716 // and should not share the same buffer.
724- else if (!m_disable_memory_sharing &&
725- op_annotations->is_cacheable ())
717+ if (!m_disable_memory_sharing &&
718+ input_op_annotations->is_cacheable () !=
719+ op_annotations->is_cacheable ())
726720 {
727- NGRAPH_DEBUG << " cpu_memory_assignment: reusing memory with "
728- " non-cacheable input and cacheable output, no "
729- " destructive oi" ;
721+ NGRAPH_DEBUG
722+ << " cpu_memory_assignment: reusing memory with "
723+ " input and output have different cacheabilities, no "
724+ " destructive oi" ;
730725 continue ;
731726 }
732727 }
You can’t perform that action at this time.
0 commit comments