mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
caffeのスレッド終了関数の呼び出しに対応
This commit is contained in:
parent
1656647163
commit
4bee251c81
@ -522,8 +522,14 @@ void Waifu2x::quit_liblary()
|
|||||||
{
|
{
|
||||||
g_ConvCcuDNNAlgorithm.Save();
|
g_ConvCcuDNNAlgorithm.Save();
|
||||||
g_DeconvCcuDNNAlgorithm.Save();
|
g_DeconvCcuDNNAlgorithm.Save();
|
||||||
|
|
||||||
|
caffe::GlobalFinalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Waifu2x::quit_thread_liblary()
|
||||||
|
{
|
||||||
|
caffe::ThreadFinalize();
|
||||||
|
}
|
||||||
|
|
||||||
Waifu2x::Waifu2x() : mIsInited(false), mNoiseLevel(0), mIsCuda(false), mOutputBlock(nullptr), mOutputBlockSize(0), mGPUNo(0)
|
Waifu2x::Waifu2x() : mIsInited(false), mNoiseLevel(0), mIsCuda(false), mOutputBlock(nullptr), mOutputBlockSize(0), mGPUNo(0)
|
||||||
{}
|
{}
|
||||||
|
@ -125,6 +125,7 @@ public:
|
|||||||
|
|
||||||
static void init_liblary(int argc, char** argv);
|
static void init_liblary(int argc, char** argv);
|
||||||
static void quit_liblary();
|
static void quit_liblary();
|
||||||
|
static void quit_thread_liblary();
|
||||||
|
|
||||||
// mode: noise or scale or noise_scale or auto_scale
|
// mode: noise or scale or noise_scale or auto_scale
|
||||||
// process: cpu or gpu or cudnn
|
// process: cpu or gpu or cudnn
|
||||||
|
@ -85,3 +85,9 @@ void Waifu2xDestory(void *waifu2xObj)
|
|||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__declspec(dllexport)
|
||||||
|
void Waifu2xGlobalDestroy()
|
||||||
|
{
|
||||||
|
Waifu2x::quit_liblary();
|
||||||
|
}
|
||||||
|
@ -804,6 +804,8 @@ void DialogEvent::ProcessWaifu2x()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Waifu2x::quit_thread_liblary();
|
||||||
|
|
||||||
const auto ProcessEndTime = std::chrono::system_clock::now();
|
const auto ProcessEndTime = std::chrono::system_clock::now();
|
||||||
|
|
||||||
cuDNNCheckTime = cuDNNCheckEndTime - cuDNNCheckStartTime;
|
cuDNNCheckTime = cuDNNCheckEndTime - cuDNNCheckStartTime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user