fix debug mode

This commit is contained in:
Dun Liang 2020-04-20 19:14:51 +08:00
parent f16a1c8bdf
commit 671d3a83cb
4 changed files with 15 additions and 4 deletions

4
.gitignore vendored
View File

@ -18,4 +18,6 @@ build/
*.md
!*.src.md
!README.md
!README.cn.md
!README.cn.md
python/jittor.egg-info
dist/

View File

@ -7,6 +7,7 @@
#include "common.h"
#include "misc/nano_string.h"
#include "misc/nano_vector.h"
#include "pybind/py_var_tracer.h"
namespace jittor {
@ -105,8 +106,15 @@ struct Node {
list<output_t> _outputs;
#ifdef NODE_MEMCHECK
Node();
virtual ~Node();
inline Node() {
lived_nodes[(void*)this] = lived_nodes.size()+1;
registe_node_trace(this);
}
inline virtual ~Node() {
lived_nodes.erase((void*)this);
unregiste_node_trace(this);
}
#else
inline Node() {};
inline virtual ~Node() {};

View File

@ -8,6 +8,7 @@
#include "pybind/py_var_tracer.h"
#include "misc/str_utils.h"
#include "op.h"
#include "var.h"
namespace py = pybind11;
using namespace pybind11::literals;

View File

@ -4,7 +4,7 @@
// file 'LICENSE.txt', which is part of this source code package.
// ***************************************************************
#pragma once
#include "var.h"
#include "common.h"
namespace jittor {