The GPU port of the LLVM C library needs to export a few extensions to the interface such that users can interface with it. This patch adds the necessary logic to define a GPU extension. Currently, this only exports a `rpc_reset_client` function. This allows us to use the server in D147054 to set up the RPC interface outside of `libc`. Depends on https://reviews.llvm.org/D147054 Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D152283
26 lines
901 B
C++
26 lines
901 B
C++
//===---------- GPU implementation of the external RPC functionion --------===//
|
|
//
|
|
// 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 "src/gpu/rpc_reset.h"
|
|
|
|
#include "src/__support/GPU/utils.h"
|
|
#include "src/__support/RPC/rpc_client.h"
|
|
#include "src/__support/common.h"
|
|
|
|
namespace __llvm_libc {
|
|
|
|
// This is the external interface to initialize the RPC client with the
|
|
// shared buffer.
|
|
LLVM_LIBC_FUNCTION(void, rpc_reset,
|
|
(unsigned int num_ports, void *rpc_shared_buffer)) {
|
|
__llvm_libc::rpc::client.reset(num_ports, __llvm_libc::gpu::get_lane_size(),
|
|
rpc_shared_buffer);
|
|
}
|
|
|
|
} // namespace __llvm_libc
|