clang 23.0.0git
string.h
Go to the documentation of this file.
1//===-- Wrapper for C standard string.h declarations on the GPU -----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
10#define __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
11
12#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) && \
13 !defined(__SPIRV__)
14#error "This file is for GPU offloading compilation only"
15#endif
16
17#include_next <string.h>
18
19#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
20#define __LIBC_ATTRS __attribute__((device))
21#else
22#define __LIBC_ATTRS
23#endif
24
25// TODO: Define these for CUDA / HIP.
26
27#undef __LIBC_ATTRS
28
29#endif // __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__