提交 5cc043f0 编写于 作者: M Megvii Engine Team

fix(imperative): sync command queue at exit

GitOrigin-RevId: c0d6aad27535b5a42d22124fc8c4662b02707a7c
上级 9dc55386
......@@ -10,6 +10,7 @@ import os
import sys
import platform
import ctypes
import atexit
if sys.platform == "win32":
lib_path = os.path.join(os.path.dirname(__file__), "core/lib")
......@@ -71,6 +72,7 @@ if sys.platform == "win32":
kernel32.SetErrorMode(old_error_mode)
from .core._imperative_rt.utils import _set_fork_exec_path_for_timed_func
from .core._imperative_rt.imperative import sync
from .device import *
from .logger import enable_debug_log, get_logger, set_log_file, set_log_level
from .serialization import load, save
......@@ -83,4 +85,7 @@ _set_fork_exec_path_for_timed_func(
os.path.join(os.path.dirname(__file__), "utils", "_timed_func_fork_exec_entry.py"),
)
atexit.register(sync)
del sync
del _set_fork_exec_path_for_timed_func
import os
import sys
import pytest
from megengine.core._imperative_rt.imperative import sync
sys.path.append(os.path.join(os.path.dirname(__file__), "helpers"))
def pytest_runtest_teardown():
sync()
......@@ -175,7 +175,9 @@ void ChannelImpl::free(TensorInfo* ptr) {
m_pool.free(ptr);
}
ChannelImpl::~ChannelImpl() {}
ChannelImpl::~ChannelImpl() {
close();
}
void ChannelImpl::produce_tensor(TensorInfo* dest, TensorPtr ptr) {
MGB_LOCK_GUARD(m_mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册