[PATCH] D159118: [libc] Implement the 'clock()' function on the GPU

2023-08-30 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG30307a7bb795: [libc] Implement the 'clock()' function on the GPU (authored by jhuber6). Changed prior to commit: https://reviews.llvm.org/D159118?vs=554797&id=554831#toc Repository: rG LLVM Github Mo

[PATCH] D159118: [libc] Implement the 'clock()' function on the GPU

2023-08-30 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 554797. jhuber6 added a comment. Move the header portion into a common utility header. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159118/new/ https://reviews.llvm.org/D159118 Files: clang/lib/Headers/llvm

[PATCH] D159118: [libc] Implement the 'clock()' function on the GPU

2023-08-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 554434. jhuber6 added a comment. Address nits and add static check for size of `clock_t` type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159118/new/ https://reviews.llvm.org/D159118 Files: clang/lib/Head

[PATCH] D159118: [libc] Implement the 'clock()' function on the GPU

2023-08-29 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. I think something needs to notice when clock_t is a different thing on the host and on the GPU for the offloading languages and complain, probably fatally. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159118/new/

[PATCH] D159118: [libc] Implement the 'clock()' function on the GPU

2023-08-29 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: libc/src/time/gpu/clock.cpp:61-62 +return clock_t(ticks / (GPU_CLOCKS_PER_SEC / CLOCKS_PER_SEC)); + else +return clock_t(ticks * (CLOCKS_PER_SEC / GPU_CLOCKS_PER_SEC)); +} Repository: rG LLVM Github Monor

[PATCH] D159118: [libc] Implement the 'clock()' function on the GPU

2023-08-29 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 created this revision. jhuber6 added reviewers: arsenm, tra, JonChesterfield, jdoerfert, sivachandra, lntue, michaelrj. Herald added subscribers: libc-commits, tpr. Herald added projects: libc-project, All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, w