mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 05:32:47 +00:00
使用したプロセッサーを表示するようにした
This commit is contained in:
parent
4a11a7bb63
commit
a26b34c208
@ -649,7 +649,7 @@ eWaifu2xError waifu2x(int argc, char** argv, const std::vector<InputOutputPathPa
|
||||
if (time_func)
|
||||
time_func(std::chrono::duration_cast<std::chrono::milliseconds>(InitTime).count()
|
||||
, std::chrono::duration_cast<std::chrono::milliseconds>(cuDNNCheckTime).count()
|
||||
, std::chrono::duration_cast<std::chrono::milliseconds>(ProcessTime).count());
|
||||
, std::chrono::duration_cast<std::chrono::milliseconds>(ProcessTime).count(), process_fix);
|
||||
|
||||
return eWaifu2xError_OK;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ typedef std::pair<std::string, std::string> InputOutputPathPair;
|
||||
typedef std::pair<InputOutputPathPair, eWaifu2xError> PathAndErrorPair;
|
||||
typedef std::function<bool()> waifu2xCancelFunc;
|
||||
typedef std::function<void(const int ProgressFileMax, const int ProgressFileNow)> waifu2xProgressFunc;
|
||||
typedef std::function<void(const uint64_t InitTime, const uint64_t cuDNNCheckTime, const uint64_t ProcessTime)> waifu2xTimeFunc;
|
||||
typedef std::function<void(const uint64_t InitTime, const uint64_t cuDNNCheckTime, const uint64_t ProcessTime, const std::string &Process)> waifu2xTimeFunc;
|
||||
|
||||
bool can_use_cuDNN();
|
||||
|
||||
|
@ -88,6 +88,7 @@ private:
|
||||
uint64_t InitTime;
|
||||
uint64_t cuDNNCheckTime;
|
||||
uint64_t ProcessTime;
|
||||
std::string Process;
|
||||
};
|
||||
|
||||
private:
|
||||
@ -272,12 +273,13 @@ private:
|
||||
SendMessage(GetDlgItem(dh, IDC_PROGRESS), PBM_SETPOS, ProgressFileNow, 0);
|
||||
};
|
||||
|
||||
const auto TimeFunc = [this](const uint64_t InitTime, const uint64_t cuDNNCheckTime, const uint64_t ProcessTime)
|
||||
const auto TimeFunc = [this](const uint64_t InitTime, const uint64_t cuDNNCheckTime, const uint64_t ProcessTime, const std::string &Process)
|
||||
{
|
||||
stWaifu2xTime t;
|
||||
t.InitTime = InitTime;
|
||||
t.cuDNNCheckTime = cuDNNCheckTime;
|
||||
t.ProcessTime = ProcessTime;
|
||||
t.Process = Process;
|
||||
|
||||
SendMessage(dh, WM_TIME_WAIFU2X, (WPARAM)&t, 0);
|
||||
};
|
||||
@ -372,6 +374,18 @@ public:
|
||||
char msg[1024*2];
|
||||
char *ptr = msg;
|
||||
|
||||
{
|
||||
std::string p(tp->Process);
|
||||
if (p == "cpu")
|
||||
p = "CPU";
|
||||
else if (p == "gpu")
|
||||
p = "GPU";
|
||||
else if (p == "cudnn")
|
||||
p = "cuDNN";
|
||||
|
||||
ptr += sprintf(ptr, "使用プロセッサーモード: %s\r\n", p.c_str());
|
||||
}
|
||||
|
||||
{
|
||||
uint64_t t = tp->ProcessTime;
|
||||
const int msec = t % 1000; t /= 1000;
|
||||
@ -390,6 +404,7 @@ public:
|
||||
ptr += sprintf(ptr, "<EFBFBD>‰Šú‰»ŽžŠÔ: %02d:%02d:%02d.%d\r\n", hour, min, sec, msec);
|
||||
}
|
||||
|
||||
if (tp->Process == "gpu" || tp->Process == "cudnn")
|
||||
{
|
||||
uint64_t t = tp->cuDNNCheckTime;
|
||||
const int msec = t % 1000; t /= 1000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user