From 66004d397ab93996a400bee25e8d571e6af4ebfd Mon Sep 17 00:00:00 2001 From: amemov Date: Mon, 17 Nov 2025 23:05:07 -0800 Subject: [PATCH 1/2] WIP: Created file for GPU implementation --- libc/docs/headers/time.rst | 2 +- libc/src/time/gpu/clock_settime.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 libc/src/time/gpu/clock_settime.cpp diff --git a/libc/docs/headers/time.rst b/libc/docs/headers/time.rst index f07e0d93a4ce6..d1030ca339a61 100644 --- a/libc/docs/headers/time.rst +++ b/libc/docs/headers/time.rst @@ -71,7 +71,7 @@ Implementation Status +---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ | clock_nanosleep | | | | | | | | | | | | | | +---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ -| clock_settime | |check| | |check| | | |check| | | | | | | | | | | +| clock_settime | |check| | |check| | | |check| | | | | | | | | | |check| | +---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ | ctime | |check| | |check| | | |check| | | | | | | | | | | +---------------------+---------+---------+---------+-----------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+ diff --git a/libc/src/time/gpu/clock_settime.cpp b/libc/src/time/gpu/clock_settime.cpp new file mode 100644 index 0000000000000..f54d3cc3aa213 --- /dev/null +++ b/libc/src/time/gpu/clock_settime.cpp @@ -0,0 +1,7 @@ +//===-- Implementation of clock_settime for gpu ----------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// From 0463988a301d7bc5bc2e43b9a9db348d8e8aacd1 Mon Sep 17 00:00:00 2001 From: amemov Date: Mon, 17 Nov 2025 23:23:30 -0800 Subject: [PATCH 2/2] WIP: Renamed top of headers for consistency --- libc/src/time/gpu/clock.cpp | 2 +- libc/src/time/gpu/clock_gettime.cpp | 2 +- libc/src/time/gpu/clock_settime.cpp | 2 +- libc/src/time/gpu/nanosleep.cpp | 2 +- libc/src/time/gpu/timespec_get.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libc/src/time/gpu/clock.cpp b/libc/src/time/gpu/clock.cpp index 8609c5cd6b6b7..4e273866f160f 100644 --- a/libc/src/time/gpu/clock.cpp +++ b/libc/src/time/gpu/clock.cpp @@ -1,4 +1,4 @@ -//===-- GPU implementation of the clock function --------------------------===// +//===---------- GPU implementation of the clock function ------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/libc/src/time/gpu/clock_gettime.cpp b/libc/src/time/gpu/clock_gettime.cpp index 81547ef7f1ca6..8099a569f46db 100644 --- a/libc/src/time/gpu/clock_gettime.cpp +++ b/libc/src/time/gpu/clock_gettime.cpp @@ -1,4 +1,4 @@ -//===---------- GPU implementation of the POSIX clock_gettime function ----===// +//===---------- GPU implementation of the clock_gettime function ----------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/libc/src/time/gpu/clock_settime.cpp b/libc/src/time/gpu/clock_settime.cpp index f54d3cc3aa213..3354cdfeb0cf0 100644 --- a/libc/src/time/gpu/clock_settime.cpp +++ b/libc/src/time/gpu/clock_settime.cpp @@ -1,4 +1,4 @@ -//===-- Implementation of clock_settime for gpu ----------------------------===// +//===---------- GPU implementation of the clock_settime function ----------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/libc/src/time/gpu/nanosleep.cpp b/libc/src/time/gpu/nanosleep.cpp index d22d9d6bd8d79..3cccbc9055514 100644 --- a/libc/src/time/gpu/nanosleep.cpp +++ b/libc/src/time/gpu/nanosleep.cpp @@ -1,4 +1,4 @@ -//===-- GPU implementation of the nanosleep function ----------------------===// +//===---------- GPU implementation of the nanosleep function --------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/libc/src/time/gpu/timespec_get.cpp b/libc/src/time/gpu/timespec_get.cpp index 0dd128444aa8e..7b24c9e5f71e9 100644 --- a/libc/src/time/gpu/timespec_get.cpp +++ b/libc/src/time/gpu/timespec_get.cpp @@ -1,4 +1,4 @@ -//===-- Implementation of timespec_get for gpu ----------------------------===// +//===---------- GPU implementation of the timespec_get function -----------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information.