summaryrefslogtreecommitdiff
path: root/libc/src/__support/OSUtil/gpu/io.cpp
blob: 995a97389184d5148c76a4ce90da46007f464789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//===-------------- GPU implementation of IO utils --------------*- 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
//
//===----------------------------------------------------------------------===//

#include "io.h"

#include "src/__support/CPP/string_view.h"
#include "src/__support/RPC/rpc_client.h"
#include "src/string/memory_utils/memcpy_implementations.h"

namespace __llvm_libc {

void write_to_stderr(cpp::string_view msg) {
  rpc::Client::Port port = rpc::client.open<rpc::PRINT_TO_STDERR>();
  port.send_n(msg.data(), msg.size());
  port.close();
}

} // namespace __llvm_libc