We had three `utils::` namespaces, all with different "meaning" (host, device, hsa_utils). We should, when we can, keep "include/Shared" accessible from host and device, thus RefCountTy has been moved to a separate header. `hsa_utils` was introduced to make `utils::` less overloaded. And common functionality was de-duplicated, e.g., `utils::advance` and `utils::advanceVoidPtr` -> `utils:advancePtr`. Type punning now checks for the size of the result to make sure it matches the source type. No functional change was intended.
25 lines
700 B
C
25 lines
700 B
C
//===--------- LibC.h - Simple implementation of libc functions --- C++ -*-===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef OMPTARGET_LIBC_H
|
|
#define OMPTARGET_LIBC_H
|
|
|
|
#include "DeviceTypes.h"
|
|
|
|
extern "C" {
|
|
|
|
int memcmp(const void *lhs, const void *rhs, size_t count);
|
|
void memset(void *dst, int C, size_t count);
|
|
int printf(const char *format, ...);
|
|
}
|
|
|
|
#endif
|