SWDEV-463865 - symbol renamings to prevent conflicts in static build

Change-Id: Id7fbb638c1088c23df52fee877cd790d637b1ffb


[ROCm/clr commit: b8c2ac4de4]
This commit is contained in:
Ioannis Assiouras
2024-06-04 18:33:00 +01:00
rodzic 1c94521c1c
commit 0e023d1a0a
17 zmienionych plików z 45 dodań i 45 usunięć
@@ -51,5 +51,5 @@ const char* hipApiName(uint32_t id) { return hip_api_name(id); }
extern "C" void hipRegisterTracerCallback(int (*function)(activity_domain_t domain,
uint32_t operation_id, void* data)) {
activity_prof::report_activity.store(function, std::memory_order_relaxed);
amd::activity_prof::report_activity.store(function, std::memory_order_relaxed);
}
+6 -4
Wyświetl plik
@@ -50,9 +50,11 @@ template <hip_api_id_t operation_id> class api_callbacks_spawner_t {
static_assert(operation_id >= HIP_API_ID_FIRST && operation_id <= HIP_API_ID_LAST,
"invalid HIP_API operation id");
if (auto function = activity_prof::report_activity.load(std::memory_order_relaxed); function &&
(enabled_ = function(ACTIVITY_DOMAIN_HIP_API, operation_id, &trace_data_) == 0)) {
activity_prof::correlation_id = trace_data_.api_data.correlation_id;
if (auto function =
amd::activity_prof::report_activity.load(std::memory_order_relaxed);
function && (enabled_ = function(ACTIVITY_DOMAIN_HIP_API, operation_id,
&trace_data_) == 0)) {
amd::activity_prof::correlation_id = trace_data_.api_data.correlation_id;
if (trace_data_.phase_enter != nullptr) {
init_cb_args_data(trace_data_.api_data);
@@ -64,7 +66,7 @@ template <hip_api_id_t operation_id> class api_callbacks_spawner_t {
~api_callbacks_spawner_t() {
if (enabled_) {
if (trace_data_.phase_exit != nullptr) trace_data_.phase_exit(operation_id, &trace_data_);
activity_prof::correlation_id = 0;
amd::activity_prof::correlation_id = 0;
}
}
@@ -25,6 +25,7 @@
#include "devhcmessages.hpp"
#include <vector>
namespace amd {
enum {
DESCRIPTOR_OFFSET_FLAG_BEGIN = 0,
@@ -133,9 +134,9 @@ void MessageHandler::discardMessage(Message* message) {
}
// Defined in devhcprintf.cpp
namespace amd {
void handlePrintf(uint64_t* output, const uint64_t* input, uint64_t len);
} // namespace amd
bool MessageHandler::handlePayload(uint32_t service, uint64_t* payload) {
Message* message = nullptr;
@@ -178,3 +179,4 @@ bool MessageHandler::handlePayload(uint32_t service, uint64_t* payload) {
discardMessage(message);
return true;
}
} // namespace amd
@@ -66,6 +66,8 @@
#include <vector>
namespace amd {
enum ServiceID {
SERVICE_RESERVED = 0,
SERVICE_FUNCTION_CALL = 1,
@@ -92,3 +94,4 @@ class MessageHandler {
~MessageHandler();
bool handlePayload(uint32_t service, uint64_t* payload);
};
}// namespace amd
@@ -42,6 +42,8 @@
#endif
#endif
namespace amd {
PacketHeader* HostcallBuffer::getHeader(uint64_t ptr) const {
return headers_ + (ptr & index_mask_);
}
@@ -459,3 +461,4 @@ void disableHostcalls(void* bfr) {
ClPrint(amd::LOG_INFO, amd::LOG_INIT, "Terminated hostcall listener");
}
}
}// namespace amd
@@ -30,6 +30,9 @@
#include "device/devurilocator.hpp"
#endif
#endif
namespace amd {
/** \file Support for invoking host services from the device.
*
* A hostcall is a fixed-size request generated by a kernel running
@@ -175,3 +178,5 @@ class HostcallBuffer {
static_assert(std::is_standard_layout<HostcallBuffer>::value,
"the hostcall buffer must be useable from other languages");
}// namespace amd
@@ -1155,7 +1155,7 @@ VirtualGPU::~VirtualGPU() {
ClPrint(amd::LOG_INFO, amd::LOG_QUEUE,
"deleting hostcall buffer %p for virtual queue %p",
hostcallBuffer_, this);
disableHostcalls(hostcallBuffer_);
amd::disableHostcalls(hostcallBuffer_);
dev().svmFree(hostcallBuffer_);
}
}
@@ -3775,8 +3775,8 @@ void* VirtualGPU::getOrCreateHostcallBuffer() {
auto wavesPerCu = dev().info().maxThreadsPerCU_ / dev().info().wavefrontWidth_;
auto numPackets = dev().info().maxComputeUnits_ * wavesPerCu;
auto size = getHostcallBufferSize(numPackets);
auto align = getHostcallBufferAlignment();
auto size = amd::getHostcallBufferSize(numPackets);
auto align = amd::getHostcallBufferAlignment();
hostcallBuffer_ = dev().svmAlloc(dev().context(), size, align,
CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_SVM_ATOMICS, nullptr);
@@ -3794,7 +3794,7 @@ void* VirtualGPU::getOrCreateHostcallBuffer() {
align,
this);
if (!enableHostcalls(dev(), hostcallBuffer_, numPackets)) {
if (!amd::enableHostcalls(dev(), hostcallBuffer_, numPackets)) {
ClPrint(amd::LOG_ERROR, amd::LOG_QUEUE,
"Failed to register hostcall buffer %p with listener",
hostcallBuffer_);
@@ -22,6 +22,7 @@
#include "device/rocm/rocvirtual.hpp"
#include <array>
namespace roc {
hsa_status_t PerfCounterCallback(
hsa_ven_amd_aqlprofile_info_type_t info_type,
@@ -37,9 +38,6 @@ hsa_status_t PerfCounterCallback(
return HSA_STATUS_SUCCESS;
}
namespace roc {
/*
Converting from ORCA cmndefs.h to ROCR hsa_ven_amd_aqlprofile.h
Note that some blocks are not defined in cmndefs.h
@@ -274,7 +274,7 @@ Device::~Device() {
if (qInfo.hostcallBuffer_) {
ClPrint(amd::LOG_INFO, amd::LOG_QUEUE, "Deleting hostcall buffer %p for hardware queue %p",
qInfo.hostcallBuffer_, qIter->first->base_address);
disableHostcalls(qInfo.hostcallBuffer_);
amd::disableHostcalls(qInfo.hostcallBuffer_);
context().svmFree(qInfo.hostcallBuffer_);
}
ClPrint(amd::LOG_INFO, amd::LOG_QUEUE, "Deleting hardware queue %p with refCount 0",
@@ -301,7 +301,7 @@ Device::~Device() {
delete[] p2p_agents_list_;
if (coopHostcallBuffer_) {
disableHostcalls(coopHostcallBuffer_);
amd::disableHostcalls(coopHostcallBuffer_);
context().svmFree(coopHostcallBuffer_);
coopHostcallBuffer_ = nullptr;
}
@@ -3248,8 +3248,8 @@ void* Device::getOrCreateHostcallBuffer(hsa_queue_t* queue, bool coop_queue,
auto wavesPerCu = info().maxThreadsPerCU_ / info().wavefrontWidth_;
auto numPackets = info().maxComputeUnits_ * wavesPerCu;
auto size = getHostcallBufferSize(numPackets);
auto align = getHostcallBufferAlignment();
auto size = amd::getHostcallBufferSize(numPackets);
auto align = amd::getHostcallBufferAlignment();
void* buffer = context().svmAlloc(size, align, CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_SVM_ATOMICS);
if (!buffer) {
@@ -3264,7 +3264,7 @@ void* Device::getOrCreateHostcallBuffer(hsa_queue_t* queue, bool coop_queue,
} else {
coopHostcallBuffer_ = buffer;
}
if (!enableHostcalls(*this, buffer, numPackets)) {
if (!amd::enableHostcalls(*this, buffer, numPackets)) {
ClPrint(amd::LOG_ERROR, amd::LOG_QUEUE, "Failed to register hostcall buffer %p with listener",
buffer);
return nullptr;
@@ -192,7 +192,7 @@ bool HsaAmdSignalHandler(hsa_signal_value_t value, void* arg) {
return false;
}
if (activity_prof::IsEnabled(OP_ID_DISPATCH)) {
if (amd::activity_prof::IsEnabled(OP_ID_DISPATCH)) {
amd::Command* head = ts->getParsedCommand();
if (head == nullptr) {
head = ts->command().GetBatchHead();
@@ -871,7 +871,7 @@ bool VirtualGPU::dispatchGenericAqlPacket(
if (std::is_same<decltype(packet), hsa_kernel_dispatch_packet_t*>::value) {
// If profiling is enabled, store the correlation ID in the dispatch packet. The profiler can
// retrieve this correlation ID to attribute waves to specific dispatch locations.
if (activity_prof::IsEnabled(OP_ID_DISPATCH)) {
if (amd::activity_prof::IsEnabled(OP_ID_DISPATCH)) {
auto dispatchPacket = reinterpret_cast<hsa_kernel_dispatch_packet_t*>(packet);
dispatchPacket->reserved2 = timestamp_->command().profilingInfo().correlation_id_;
}
@@ -25,7 +25,7 @@
#include <atomic>
namespace activity_prof {
namespace amd::activity_prof {
decltype(report_activity) report_activity{nullptr};
@@ -122,7 +122,7 @@ void ReportActivity(const amd::Command& command) {
}
}
} // namespace activity_prof
} // namespace amd::activity_prof
#define CASE_STRING(X, C) \
case X: \
@@ -36,7 +36,7 @@ enum OpId { OP_ID_DISPATCH = 0, OP_ID_COPY = 1, OP_ID_BARRIER = 2, OP_ID_NUMBER
#include "prof_protocol.h"
namespace activity_prof {
namespace amd::activity_prof {
extern std::atomic<int (*)(activity_domain_t domain, uint32_t operation_id, void* data)>
report_activity;
@@ -76,6 +76,6 @@ constexpr OpId OperationId(cl_command_type commandType) {
bool IsEnabled(OpId operation_id);
void ReportActivity(const amd::Command& command);
} // namespace activity_prof
} // namespace amd::activity_prof
const char* getOclCommandKindString(cl_command_type kind);
@@ -150,8 +150,8 @@ bool Event::setStatus(int32_t status, uint64_t timeStamp) {
releaseResources();
}
if (profilingInfo().enabled_ && activity_prof::IsEnabled(OP_ID_DISPATCH)) {
activity_prof::ReportActivity(command());
if (profilingInfo().enabled_ && amd::activity_prof::IsEnabled(OP_ID_DISPATCH)) {
amd::activity_prof::ReportActivity(command());
}
// Broadcast all the waiters.
@@ -303,7 +303,7 @@ const Event::EventWaitList Event::nullWaitList(0);
Command::Command(HostQueue& queue, cl_command_type type, const EventWaitList& eventWaitList,
uint32_t commandWaitBits, const Event* waitingEvent)
: Event(queue,
activity_prof::IsEnabled(activity_prof::OperationId(type)) ||
amd::activity_prof::IsEnabled(amd::activity_prof::OperationId(type)) ||
queue.properties().test(CL_QUEUE_PROFILING_ENABLE) ||
Agent::shouldPostEventEvents()),
queue_(&queue),
@@ -102,7 +102,7 @@ class Event : public RuntimeObject {
: enabled_(enabled), marker_ts_(false) {
if (enabled) {
clear();
correlation_id_ = activity_prof::correlation_id;
correlation_id_ = amd::activity_prof::correlation_id;
}
}
@@ -148,7 +148,7 @@ class Event : public RuntimeObject {
void EnableProfiling() {
profilingInfo_.enabled_ = true;
profilingInfo_.clear();
profilingInfo_.correlation_id_ = activity_prof::correlation_id;
profilingInfo_.correlation_id_ = amd::activity_prof::correlation_id;
}
public:
+2 -2
Wyświetl plik
@@ -28,11 +28,11 @@
#include <atomic>
namespace amd {
// Stores the no. of memory allocations
std::atomic<uint32_t> numAllocs = {0};
namespace amd {
bool BufferRect::create(const size_t* bufferOrigin, const size_t* region, size_t bufferRowPitch,
size_t bufferSlicePitch) {
bool valid = false;
-9
Wyświetl plik
@@ -40,15 +40,6 @@ namespace amd {
FILE* outFile = stderr;
// ================================================================================================
//! \cond ignore
extern "C" void breakpoint(void) {
#ifdef _MSC_VER
DebugBreak();
#endif // _MSC_VER
}
//! \endcond
// ================================================================================================
void report_warning(const char* message) { fprintf(outFile, "Warning: %s\n", message); }
-4
Wyświetl plik
@@ -64,10 +64,6 @@ enum LogMask {
//! \brief log file output
extern FILE* outFile;
//! \cond ignore
extern "C" void breakpoint();
//! \endcond
//! \brief Display a warning message.
extern void report_warning(const char* message);