[nativert] port semaphore to c10 util (#153504)

Summary:
nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md

To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed.

This diff adds a simple semaphore interface into c10 until c++20 where we get counting_semaphore

gonna need a oss build export to take a look at this...

Test Plan: CI

Differential Revision: D73882656

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153504
Approved by: https://github.com/zhxchen17
This commit is contained in:
dolpm
2025-05-28 19:17:25 +00:00
committed by PyTorch MergeBot
parent 24980d2641
commit 66f53889d5
11 changed files with 138 additions and 0 deletions

View File

@ -75,6 +75,15 @@ cxx_library(
visibility = ["PUBLIC"],
)
cxx_library(
name = "moodycamel",
raw_headers = glob([
"concurrentqueue/**/*.h",
]),
reexport_all_header_dependencies = True,
visibility = ["PUBLIC"],
)
cxx_library(
name = "pocketfft_header",
header_namespace = "",