Skip to content

Commit

Permalink
Fix compile time and runtime errors of EdgeTPURuntime (#8133)
Browse files Browse the repository at this point in the history
* Fixed the destruction order tflite::Interpreter and EdgeTPUContext

* Fixed include omission

* Formatted
  • Loading branch information
akmaru authored Jun 11, 2021
1 parent c29301e commit 657af3a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/runtime/contrib/edgetpu/edgetpu_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <string>

#include "../tflite/tflite_runtime.h"
#include "edgetpu.h"

namespace tvm {
namespace runtime {
Expand All @@ -43,6 +44,14 @@ namespace runtime {
*/
class EdgeTPURuntime : public TFLiteRuntime {
public:
/*!
* \brief Destructor of EdgeTPURuntime.
*
* NOTE: tflite::Interpreter member should be destruct before the EdgeTpuContext member
* destruction. If the order is reverse, occurs SEGV in the destructor of tflite::Interpreter.
*/
~EdgeTPURuntime() { interpreter_.reset(); }

/*!
* \return The type key of the executor.
*/
Expand Down

0 comments on commit 657af3a

Please sign in to comment.