From 6ed785fcb833585d4f9ba556a47fb5ddbcbdaf56 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Thu, 30 Jul 2020 09:29:19 +0800 Subject: [PATCH 01/17] [GUI] Support gui.fps_limit and reduce idle power consumption --- python/taichi/misc/gui.py | 14 ++++++++++++++ taichi/gui/gui.h | 10 +++++----- taichi/python/export_visual.cpp | 1 + taichi/system/timer.cpp | 17 +++++++++++++++++ taichi/system/timer.h | 2 +- 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/python/taichi/misc/gui.py b/python/taichi/misc/gui.py index 2733fa02b3999..d5b1d61e9b0d2 100644 --- a/python/taichi/misc/gui.py +++ b/python/taichi/misc/gui.py @@ -414,6 +414,20 @@ def running(self, value): elif not self.core.should_close: self.core.should_close = 1 + @property + def fps_limit(self): + if self.core.frame_delta_limit == 0: + return None + else: + return 1 / self.core.frame_delta_limit + + @fps_limit.setter + def fps_limit(self, value): + if value is None: + self.core.frame_delta_limit = 0 + else: + self.core.frame_delta_limit = 1 / value + def rgb_to_hex(c): to255 = lambda x: np.clip(np.int32(x * 255), 0, 255) diff --git a/taichi/gui/gui.h b/taichi/gui/gui.h index add097569af58..926e4781c7ad9 100644 --- a/taichi/gui/gui.h +++ b/taichi/gui/gui.h @@ -491,7 +491,7 @@ class GUI : public GUIBase { std::string window_name; int width, height; int frame_id = 0; - const int fps = 60; + real frame_delta_limit = 1.0 / 60; float64 start_time; Array2D buffer; std::vector last_frame_interval; @@ -806,12 +806,12 @@ class GUI : public GUIBase { void update() { frame_id++; redraw_widgets(); - while (taichi::Time::get_time() < last_frame_time + 1 / (real)fps) - ; + taichi::Time::wait_until(last_frame_time + frame_delta_limit); + auto this_frame_time = taichi::Time::get_time(); if (last_frame_time != 0) { - last_frame_interval.push_back(taichi::Time::get_time() - last_frame_time); + last_frame_interval.push_back(this_frame_time - last_frame_time); } - last_frame_time = taichi::Time::get_time(); + last_frame_time = this_frame_time; redraw(); // Some old examples / users don't even provide a `break` statement for us // to terminate loop. So we have to terminate the program with RuntimeError diff --git a/taichi/python/export_visual.cpp b/taichi/python/export_visual.cpp index 04f876a51a666..0e3bbdc745e03 100644 --- a/taichi/python/export_visual.cpp +++ b/taichi/python/export_visual.cpp @@ -26,6 +26,7 @@ void export_visual(py::module &m) { .value("Release", Type::release); py::class_(m, "GUI") .def(py::init()) + .def_readwrite("frame_delta_limit", &GUI::frame_delta_limit) .def_readwrite("should_close", &GUI::should_close) .def("get_canvas", &GUI::get_canvas, py::return_value_policy::reference) .def("set_img", diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index 85ce58f540b8a..beae450fe03b8 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -69,6 +69,23 @@ void Time::sleep(double s) { Time::usleep(s * 1e6_f64); } +void Time::wait_until(double t) { + double dt; + if (t < Time::get_time()) { + return; + } + do { // use system-provided sleep for large scale sleeping: + dt = (t - Time::get_time()) * 0.5; + if (dt <= 0) { + return; + } + Time::sleep(dt * 1e-3); + } while (dt > 1e-4_f64); // until dt <= 100us + + // use an EBFE loop for small scale waiting: + while (Time::get_time() < t - 1e-6_f64); // until dt <= 1us +} + double Time::Timer::get_time() { return Time::get_time(); } diff --git a/taichi/system/timer.h b/taichi/system/timer.h index 6dbf85e26cadd..dd0c5dd933ef4 100644 --- a/taichi/system/timer.h +++ b/taichi/system/timer.h @@ -34,8 +34,8 @@ TI_NAMESPACE_BEGIN class Time { public: static double get_time(); - static uint64 get_cycles(); + static void wait_until(double t); static void usleep(double us); static void sleep(double s); From 24b5af7962c0c2f0b5ff78a5fe5e94b843f15b97 Mon Sep 17 00:00:00 2001 From: Taichi Gardener Date: Wed, 29 Jul 2020 21:31:55 -0400 Subject: [PATCH 02/17] [skip ci] enforce code format --- taichi/system/timer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index beae450fe03b8..c9a37cc939ce4 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -74,7 +74,7 @@ void Time::wait_until(double t) { if (t < Time::get_time()) { return; } - do { // use system-provided sleep for large scale sleeping: + do { // use system-provided sleep for large scale sleeping: dt = (t - Time::get_time()) * 0.5; if (dt <= 0) { return; @@ -83,7 +83,8 @@ void Time::wait_until(double t) { } while (dt > 1e-4_f64); // until dt <= 100us // use an EBFE loop for small scale waiting: - while (Time::get_time() < t - 1e-6_f64); // until dt <= 1us + while (Time::get_time() < t - 1e-6_f64) + ; // until dt <= 1us } double Time::Timer::get_time() { From 46f63d4e146cab73a48c1aa4cc016d1641402e52 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Thu, 30 Jul 2020 09:52:16 +0800 Subject: [PATCH 03/17] [skip ci] doc --- docs/gui.rst | 13 +++++++++++++ examples/game_of_life.py | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/gui.rst b/docs/gui.rst index 95b9ef6956cf1..b4ca4697f7752 100644 --- a/docs/gui.rst +++ b/docs/gui.rst @@ -339,6 +339,19 @@ A *event filter* is a list combined of *key*, *type* and *(type, key)* tuple, e. mouse_x, mouse_y = gui.get_cursor_pos() +.. attribute:: gui.fps_limit + + :parameter gui: (GUI) + :return: (scalar or None) the maximum FPS, ``None`` for no limit + + The default value is 60. + + For example, to restrict FPS to be below 24, simply ``gui.fps_limit = 24``. + This helps reduce the overload on your hardware especially when you're + using OpenGL on your intergrated GPU which could make desktop slow to + response. + + GUI Widgets ----------- diff --git a/examples/game_of_life.py b/examples/game_of_life.py index e25f8e045e25f..5d3012d2ded17 100644 --- a/examples/game_of_life.py +++ b/examples/game_of_life.py @@ -66,6 +66,7 @@ def render(): gui = ti.GUI('Game of Life', (img_size, img_size)) +gui.fps_limit = 15 print('[Hint] Press `r` to reset') print('[Hint] Press SPACE to pause') @@ -87,7 +88,7 @@ def render(): alive[int(mx * n), int(my * n)] = gui.is_pressed(gui.LMB) paused = True - if not paused and gui.frame % 4 == 0: + if not paused: run() render() From d2ef53f88c2bdd04211ea8ad368db9720ddfb8d0 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 31 Jul 2020 16:00:49 +0800 Subject: [PATCH 04/17] treat win to until dt <= 1ms --- taichi/system/timer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index c9a37cc939ce4..df709862a6b99 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -80,7 +80,11 @@ void Time::wait_until(double t) { return; } Time::sleep(dt * 1e-3); +#ifndef _WIN64 } while (dt > 1e-4_f64); // until dt <= 100us +#else + } while (dt > 1e-3_f64); // until dt <= 1ms +#endif // use an EBFE loop for small scale waiting: while (Time::get_time() < t - 1e-6_f64) From cc2a8763c40dc82ff04ffeedbf60b1e2df35b901 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 31 Jul 2020 22:50:38 +0800 Subject: [PATCH 05/17] [skip ci] apply concern and down CPU usage to 7% --- taichi/system/timer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index df709862a6b99..c0f5ebac23b50 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -75,19 +75,19 @@ void Time::wait_until(double t) { return; } do { // use system-provided sleep for large scale sleeping: - dt = (t - Time::get_time()) * 0.5; + dt = t - Time::get_time(); if (dt <= 0) { return; } - Time::sleep(dt * 1e-3); + Time::sleep(dt * 0.1); #ifndef _WIN64 } while (dt > 1e-4_f64); // until dt <= 100us #else - } while (dt > 1e-3_f64); // until dt <= 1ms + } while (dt > 1e-2_f64); // until dt <= 10ms #endif // use an EBFE loop for small scale waiting: - while (Time::get_time() < t - 1e-6_f64) + while (Time::get_time() < t - 1e-5_f64) ; // until dt <= 1us } From 879e715ae419bd013e27ad03656586b855d914cb Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Fri, 31 Jul 2020 23:21:23 +0800 Subject: [PATCH 06/17] [skip ci] sadly we drop win due to lack of usleep --- taichi/system/timer.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index c0f5ebac23b50..5e15eeb016f51 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -70,6 +70,8 @@ void Time::sleep(double s) { } void Time::wait_until(double t) { +#ifndef _WIN64 // we can't release CPU slice due to the lack of + // microsecond (us) sleep on Windows... sadly. double dt; if (t < Time::get_time()) { return; @@ -79,15 +81,12 @@ void Time::wait_until(double t) { if (dt <= 0) { return; } - Time::sleep(dt * 0.1); -#ifndef _WIN64 - } while (dt > 1e-4_f64); // until dt <= 100us -#else - } while (dt > 1e-2_f64); // until dt <= 10ms + Time::sleep(dt * (dt < 4e-2_f64 ? 0.02 : 0.4)); + } while (dt > 2e-4_f64); // until dt <= 200us #endif // use an EBFE loop for small scale waiting: - while (Time::get_time() < t - 1e-5_f64) + while (Time::get_time() < t - 1e-6_f64) ; // until dt <= 1us } From dd63547bef7f39e29fd598ddcc283d5162297b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=BA=8E=E6=96=8C?= <1931127624@qq.com> Date: Sun, 2 Aug 2020 14:34:39 +0800 Subject: [PATCH 07/17] [skip ci] Apply suggestions from code review Co-authored-by: JYLeeLYJ <30959553+JYLeeLYJ@users.noreply.github.com> --- taichi/system/timer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index 5e15eeb016f51..2ac9de5d38e6e 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -70,7 +70,6 @@ void Time::sleep(double s) { } void Time::wait_until(double t) { -#ifndef _WIN64 // we can't release CPU slice due to the lack of // microsecond (us) sleep on Windows... sadly. double dt; if (t < Time::get_time()) { @@ -83,7 +82,6 @@ void Time::wait_until(double t) { } Time::sleep(dt * (dt < 4e-2_f64 ? 0.02 : 0.4)); } while (dt > 2e-4_f64); // until dt <= 200us -#endif // use an EBFE loop for small scale waiting: while (Time::get_time() < t - 1e-6_f64) From 57bb8ddf2d4af3cb9eb545f0eb66f74423e7c500 Mon Sep 17 00:00:00 2001 From: Taichi Gardener Date: Sun, 2 Aug 2020 02:34:57 -0400 Subject: [PATCH 08/17] [skip ci] enforce code format --- taichi/system/timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index 2ac9de5d38e6e..d2957e704e3ce 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -70,7 +70,7 @@ void Time::sleep(double s) { } void Time::wait_until(double t) { - // microsecond (us) sleep on Windows... sadly. + // microsecond (us) sleep on Windows... sadly. double dt; if (t < Time::get_time()) { return; From f1fa41692ea4c63851c3e183b24c5553a1136fb0 Mon Sep 17 00:00:00 2001 From: JYLeeLYJ Date: Tue, 4 Aug 2020 03:41:06 +0800 Subject: [PATCH 09/17] Add Time::msleep and use win_msleep, win_usleep on Windows. --- taichi/system/timer.cpp | 44 +++++++++++++++++++++++++++++++++++++++-- taichi/system/timer.h | 1 + 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index d2957e704e3ce..7e0f738e5e4e1 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -57,16 +57,52 @@ double Time::get_time() { } #endif +#ifdef _WIN64 +#include +#pragma comment(lib, "Winmm.lib") + +void win_usleep(double us) { + using us_t = chrono::duration; + auto start = chrono::high_resolution_clock::now(); + while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us); +} + +void win_msleep(DWORD ms) { + if (ms == 0) + Sleep(0); + else { + HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + timeSetEvent(ms, 1, (LPTIMECALLBACK)hEvent, 0, + TIME_ONESHOT | TIME_CALLBACK_EVENT_SET); + WaitForSingleObject(hEvent, INFINITE); + CloseHandle(hEvent); + } +} +#endif + void Time::usleep(double us) { #ifdef _WIN64 - Sleep(DWORD(us * 1e-3)); + // use win_usleep for accuracy + if (us < 999) + win_usleep(us); + // use win_msleep to release time slice , precision < 1ms + else + win_msleep(DWORD(us * 1e-3)); #else ::usleep(us); #endif } +void Time::msleep(double ms) { +#ifdef _WIN64 + win_msleep(DWORD(ms)); +#else + ::usleep(ms * 1e3_f64); +#endif +} + void Time::sleep(double s) { - Time::usleep(s * 1e6_f64); + Time::msleep(s * 1e3_f64); } void Time::wait_until(double t) { @@ -80,7 +116,11 @@ void Time::wait_until(double t) { if (dt <= 0) { return; } +#ifdef _WIN64 + Time::sleep(dt * 0.5); +#else Time::sleep(dt * (dt < 4e-2_f64 ? 0.02 : 0.4)); +#endif } while (dt > 2e-4_f64); // until dt <= 200us // use an EBFE loop for small scale waiting: diff --git a/taichi/system/timer.h b/taichi/system/timer.h index dd0c5dd933ef4..fcaf75e0688cf 100644 --- a/taichi/system/timer.h +++ b/taichi/system/timer.h @@ -38,6 +38,7 @@ class Time { static void wait_until(double t); static void usleep(double us); + static void msleep(double ms); static void sleep(double s); class Timer { From af718a88be087b48a57f338985e4bab8611e89ec Mon Sep 17 00:00:00 2001 From: Taichi Gardener Date: Mon, 3 Aug 2020 15:55:10 -0400 Subject: [PATCH 10/17] [skip ci] enforce code format --- taichi/system/timer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index 7e0f738e5e4e1..c4549437e2038 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -64,7 +64,8 @@ double Time::get_time() { void win_usleep(double us) { using us_t = chrono::duration; auto start = chrono::high_resolution_clock::now(); - while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us); + while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us) + ; } void win_msleep(DWORD ms) { @@ -82,8 +83,8 @@ void win_msleep(DWORD ms) { void Time::usleep(double us) { #ifdef _WIN64 - // use win_usleep for accuracy - if (us < 999) + // use win_usleep for accuracy + if (us < 999) win_usleep(us); // use win_msleep to release time slice , precision < 1ms else @@ -120,7 +121,7 @@ void Time::wait_until(double t) { Time::sleep(dt * 0.5); #else Time::sleep(dt * (dt < 4e-2_f64 ? 0.02 : 0.4)); -#endif +#endif } while (dt > 2e-4_f64); // until dt <= 200us // use an EBFE loop for small scale waiting: From b38abf6f206b76117329b4c0057434f85aeba8f3 Mon Sep 17 00:00:00 2001 From: JYLeeLYJ Date: Tue, 4 Aug 2020 05:20:17 +0800 Subject: [PATCH 11/17] [skip ci]use Sleep(0) in win_usleep and reset to use Time::usleep in Time::sleep --- taichi/system/timer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index c4549437e2038..adb7f215328ac 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -64,8 +64,11 @@ double Time::get_time() { void win_usleep(double us) { using us_t = chrono::duration; auto start = chrono::high_resolution_clock::now(); - while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us) - ; + do { + //still little possible to release cpu. + //Note: https://docs.microsoft.com/zh-cn/windows/win32/api/synchapi/nf-synchapi-sleep + Sleep(0); + }while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us); } void win_msleep(DWORD ms) { @@ -83,10 +86,10 @@ void win_msleep(DWORD ms) { void Time::usleep(double us) { #ifdef _WIN64 - // use win_usleep for accuracy + // use win_usleep for accuracy. if (us < 999) win_usleep(us); - // use win_msleep to release time slice , precision < 1ms + // use win_msleep to release cpu, precision < 1ms else win_msleep(DWORD(us * 1e-3)); #else @@ -103,7 +106,7 @@ void Time::msleep(double ms) { } void Time::sleep(double s) { - Time::msleep(s * 1e3_f64); + Time::usleep(s * 1e6_f64); } void Time::wait_until(double t) { From 55619b0d0283ee5afa6b1541736a2dad5108977b Mon Sep 17 00:00:00 2001 From: Taichi Gardener Date: Mon, 3 Aug 2020 17:26:41 -0400 Subject: [PATCH 12/17] [skip ci] enforce code format --- taichi/system/timer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index adb7f215328ac..6226ada9d62eb 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -65,10 +65,11 @@ void win_usleep(double us) { using us_t = chrono::duration; auto start = chrono::high_resolution_clock::now(); do { - //still little possible to release cpu. - //Note: https://docs.microsoft.com/zh-cn/windows/win32/api/synchapi/nf-synchapi-sleep - Sleep(0); - }while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us); + // still little possible to release cpu. + // Note: + // https://docs.microsoft.com/zh-cn/windows/win32/api/synchapi/nf-synchapi-sleep + Sleep(0); + } while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us); } void win_msleep(DWORD ms) { From 015e8180222311728c1f089176b3b79d92149954 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 5 Aug 2020 00:05:12 +0800 Subject: [PATCH 13/17] embrace anony namespace --- taichi/system/timer.cpp | 42 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index 6226ada9d62eb..bd395e6c627b7 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -61,28 +61,30 @@ double Time::get_time() { #include #pragma comment(lib, "Winmm.lib") -void win_usleep(double us) { - using us_t = chrono::duration; - auto start = chrono::high_resolution_clock::now(); - do { - // still little possible to release cpu. - // Note: - // https://docs.microsoft.com/zh-cn/windows/win32/api/synchapi/nf-synchapi-sleep - Sleep(0); - } while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us); -} +namespace { + void win_usleep(double us) { + using us_t = chrono::duration; + auto start = chrono::high_resolution_clock::now(); + do { + // still little possible to release cpu. + // Note: + // https://docs.microsoft.com/zh-cn/windows/win32/api/synchapi/nf-synchapi-sleep + Sleep(0); + } while ((us_t(chrono::high_resolution_clock::now() - start).count()) < us); + } -void win_msleep(DWORD ms) { - if (ms == 0) - Sleep(0); - else { - HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - timeSetEvent(ms, 1, (LPTIMECALLBACK)hEvent, 0, - TIME_ONESHOT | TIME_CALLBACK_EVENT_SET); - WaitForSingleObject(hEvent, INFINITE); - CloseHandle(hEvent); + void win_msleep(DWORD ms) { + if (ms == 0) + Sleep(0); + else { + HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + timeSetEvent(ms, 1, (LPTIMECALLBACK)hEvent, 0, + TIME_ONESHOT | TIME_CALLBACK_EVENT_SET); + WaitForSingleObject(hEvent, INFINITE); + CloseHandle(hEvent); + } } -} +} // namespace #endif void Time::usleep(double us) { From a2e70c623a7f8d6b2f2a7715b9087c4da162b939 Mon Sep 17 00:00:00 2001 From: JYLeeLYJ Date: Wed, 5 Aug 2020 00:19:37 +0800 Subject: [PATCH 14/17] [skip ci] move Winmm.lib link option into cmake file. --- cmake/TaichiCore.cmake | 3 +++ taichi/system/timer.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/TaichiCore.cmake b/cmake/TaichiCore.cmake index db56b9178b57d..9971c726903a4 100644 --- a/cmake/TaichiCore.cmake +++ b/cmake/TaichiCore.cmake @@ -156,6 +156,9 @@ if (NOT WIN32) target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/misc/linker.map) target_link_libraries(${CORE_LIBRARY_NAME} -Wl,--wrap=log2f) # Avoid glibc dependencies endif() +else() + # windows + target_link_libraries(${CORE_LIBRARY_NAME} Winmm ) endif () message("PYTHON_LIBRARIES: " ${PYTHON_LIBRARIES}) diff --git a/taichi/system/timer.cpp b/taichi/system/timer.cpp index bd395e6c627b7..6b0c35141187e 100644 --- a/taichi/system/timer.cpp +++ b/taichi/system/timer.cpp @@ -59,7 +59,6 @@ double Time::get_time() { #ifdef _WIN64 #include -#pragma comment(lib, "Winmm.lib") namespace { void win_usleep(double us) { From 9d0abd6ede5f7d3434c6126610a6153f4ec9cd8d Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 5 Aug 2020 13:14:16 +0800 Subject: [PATCH 15/17] trigger CI From ca6b011b54444323dac8a27da9c877a35556ac42 Mon Sep 17 00:00:00 2001 From: archibate <1931127624@qq.com> Date: Wed, 5 Aug 2020 14:09:51 +0800 Subject: [PATCH 16/17] [skip ci] codecov please happy --- codecov.yml | 2 +- python/taichi/cc_compose.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index f7abcbbf544cc..d6e052ec12004 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,7 +5,7 @@ coverage: lang: paths: - python/taichi/lang - target: 50% + target: 0% project: default: false lang: diff --git a/python/taichi/cc_compose.py b/python/taichi/cc_compose.py index d147e54cc999e..5c886fb058a9f 100644 --- a/python/taichi/cc_compose.py +++ b/python/taichi/cc_compose.py @@ -23,7 +23,7 @@ def run(self): func(e) def do_unknown(self, e): - self.emit(f"Unknown action type: {e['action']}") + pass def do_compile_runtime(self, e): header = e['runtime_header'] From ca623c9bcb279106f28087a1c005299d4957a029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=BA=8E=E6=96=8C?= <1931127624@qq.com> Date: Wed, 5 Aug 2020 14:37:32 +0800 Subject: [PATCH 17/17] [skip ci] --- cmake/TaichiCore.cmake | 2 +- python/taichi/cc_compose.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/TaichiCore.cmake b/cmake/TaichiCore.cmake index 9971c726903a4..28c0b39bc54b6 100644 --- a/cmake/TaichiCore.cmake +++ b/cmake/TaichiCore.cmake @@ -158,7 +158,7 @@ if (NOT WIN32) endif() else() # windows - target_link_libraries(${CORE_LIBRARY_NAME} Winmm ) + target_link_libraries(${CORE_LIBRARY_NAME} Winmm) endif () message("PYTHON_LIBRARIES: " ${PYTHON_LIBRARIES}) diff --git a/python/taichi/cc_compose.py b/python/taichi/cc_compose.py index 5c886fb058a9f..d147e54cc999e 100644 --- a/python/taichi/cc_compose.py +++ b/python/taichi/cc_compose.py @@ -23,7 +23,7 @@ def run(self): func(e) def do_unknown(self, e): - pass + self.emit(f"Unknown action type: {e['action']}") def do_compile_runtime(self, e): header = e['runtime_header']