The GPU has the ability to sleep for very short periods of time. We can
map this to the existing nanosleep utility. This patch maps the
nanosleep utility to the existing hardware instructions as best as
possible.
Depends on D159118
Paths
| Differential D159225
[libc] Implement the 'nanosleep' function on the GPU ClosedPublic Authored by jhuber6 on Aug 30 2023, 2:00 PM.
Details Summary The GPU has the ability to sleep for very short periods of time. We can Depends on D159118
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 30 2023, 2:00 PM This revision is now accepted and ready to land.Aug 30 2023, 2:24 PM Comment Actions We should probably create llvm intrinsics for the ad hoc ptx assembly remaining. I don't think there's any inline asm for intrinsics in amdgpu, though there may still be some as control flow hacks Comment Actions
Definitely, probably a good job to round them all up and implement them since they're pretty simple. Which actually reminds me that I forgot to check for sm_70 in this so thanks for that. Comment Actions Add default and change the unit test. The test requires C++20 but doesn't seem to actually use it so I removed it such that we can run it here. Closed by commit rGca10bc4f4148: [libc] Implement the 'nanosleep' function on the GPU (authored by jhuber6). · Explain WhyAug 30 2023, 4:35 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 554826 libc/config/gpu/api.td
libc/config/gpu/entrypoints.txt
libc/src/time/CMakeLists.txt
libc/src/time/gpu/CMakeLists.txt
libc/src/time/gpu/nanosleep.cpp
libc/src/time/gpu/time_utils.h
libc/src/time/gpu/time_utils.cpp
libc/src/time/linux/CMakeLists.txt
libc/src/time/linux/nanosleep.cpp
|