llvm-project/libc/docs/gpu/support.rst
Joseph Huber d04494ccc9 [libc] Rework the file handling for the GPU
The GPU has much tighter requirements for handling IO functions.
Previously we attempted to define the GPU as one of the platform files.
Using a common interface allowed us to easily define these functions
without much extra work. However, it became more clear that this was a
poor fit for the GPU. The file interface uses function pointers, which
prevented inlining and caused bad perfromance and resource usage on the
GPU. Further, using an actual `FILE` type rather than referring to it as
a host stub prevented us from usin files coming from the host on the GPU
device.

After talking with @sivachandra, the approach now is to simply define
GPU specific versions of the functions we intend to support. Also, we
are ignoring `errno` for the time being as it is unlikely we will ever
care about supporting it fully.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D157427
2023-08-09 14:42:20 -05:00

130 lines
2.9 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|
labs |check|
llabs |check|
div |check|
ldiv |check|
lldiv |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
============= ========= ============
puts |check| |check|
fputs |check| |check|
fclose |check|
fopen |check|
============= ========= ============