Skip to content

Commit de1926d

Browse files
derekxukeyprocedure
authored andcommitted
Fix timespec_get not compatiable for AOSP OS Android N14
Differential Revision: D73136434 Pull Request resolved: pytorch#10240
1 parent 206cf78 commit de1926d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extension/llm/runner/util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ ET_EXPERIMENTAL void inline safe_printf(const char* piece) {
6868
ET_EXPERIMENTAL long inline time_in_ms() {
6969
// return time in milliseconds, for benchmarking the model speed
7070
struct timespec time;
71-
// The `timespec_get` function is only available on Android API levels
72-
// 29 or later.
73-
#if defined(__ANDROID_API__) && __ANDROID_API__ < 29
71+
// The `timespec_get` function is for windows time access. Some AOSP OS does
72+
// not have timespec_get support.
73+
#if defined(__ANDROID_API__)
7474
clock_gettime(CLOCK_REALTIME, &time);
7575
#else
7676
timespec_get(&time, TIME_UTC);

0 commit comments

Comments
 (0)