Files
clang-p2996/libc/docs/gpu/support.rst
Joseph Huber a1be5d69df [libc] Implement more input functions on the GPU (#66288)
Summary:
This patch implements the `fgets`, `getc`, `fgetc`, and `getchar`
functions on the GPU. Their implementations are straightforward enough.
One thing worth noting is that the implementation of `fgets` will be
extremely slow due to the high latency to read a single char. A faster
solution would be to make a new RPC call to call `fgets` (due to the
special rule that newline or null breaks the stream). But this is left
out because performance isn't the primary concern here.
2023-09-14 15:39:29 -05:00

166 lines
3.8 KiB
ReStructuredText

.. _libc_gpu_support:
===================
Supported Functions
===================
.. include:: ../check.rst
.. contents:: Table of Contents
:depth: 4
:local:
The following functions and headers are supported at least partially on the
device. Some functions are implemented fully on the GPU, while others require a
`remote procedure call <libc_gpu_rpc>`_.
ctype.h
-------
============= ========= ============
Function Name Available RPC Required
============= ========= ============
isalnum |check|
isalpha |check|
isascii |check|
isblank |check|
iscntrl |check|
isdigit |check|
isgraph |check|
islower |check|
isprint |check|
ispunct |check|
isspace |check|
isupper |check|
isxdigit |check|
toascii |check|
tolower |check|
toupper |check|
============= ========= ============
string.h
--------
============= ========= ============
Function Name Available RPC Required
============= ========= ============
bcmp |check|
bzero |check|
memccpy |check|
memchr
memcmp |check|
memcpy |check|
memmove |check|
mempcpy |check|
memrchr |check|
memset |check|
stpcpy |check|
stpncpy |check|
strcat |check|
strchr
strcmp |check|
strcpy |check|
strcspn |check|
strlcat |check|
strlcpy |check|
strlen |check|
strncat |check|
strncmp |check|
strncpy |check|
strnlen |check|
strpbrk
strrchr
strspn |check|
strstr
strtok |check|
strtok_r |check|
strdup
strndup
============= ========= ============
stdlib.h
--------
============= ========= ============
Function Name Available RPC Required
============= ========= ============
abs |check|
atoi |check|
atof |check|
atol |check|
atoll |check|
exit |check| |check|
abort |check| |check|
labs |check|
llabs |check|
div |check|
ldiv |check|
lldiv |check|
bsearch |check|
qsort |check|
qsort_r |check|
strtod |check|
strtof |check|
strtol |check|
strtold |check|
strtoll |check|
strtoul |check|
strtoull |check|
============= ========= ============
inttypes.h
----------
============= ========= ============
Function Name Available RPC Required
============= ========= ============
imaxabs |check|
imaxdiv |check|
strtoimax |check|
strtoumax |check|
============= ========= ============
stdio.h
-------
============= ========= ============
Function Name Available RPC Required
============= ========= ============
feof |check| |check|
ferror |check| |check|
clearerr |check| |check|
fgetc |check| |check|
fgets |check| |check|
getc |check| |check|
getchar |check| |check|
puts |check| |check|
fputs |check| |check|
fputc |check| |check|
fwrite |check| |check|
putc |check| |check|
putchar |check| |check|
fclose |check| |check|
fopen |check| |check|
fread |check| |check|
============= ========= ============
time.h
------
============= ========= ============
Function Name Available RPC Required
============= ========= ============
clock |check|
nanosleep |check|
============= ========= ============
assert.h
--------
============= ========= ============
Function Name Available RPC Required
============= ========= ============
assert |check| |check|
__assert_fail |check| |check|
============= ========= ============