[Openmp-commits] [openmp] 6c8248e - [libomptarget] Rename AMDGPUSignalTy member Signal to HSASignal.
Ye Luo via Openmp-commits
openmp-commits at lists.llvm.org
Mon Sep 11 20:43:54 PDT 2023
Author: Ye Luo
Date: 2023-09-11T22:42:34-05:00
New Revision: 6c8248e38bc7f3320301e96dc88edcdd402d9341
URL: https://github.com/llvm/llvm-project/commit/6c8248e38bc7f3320301e96dc88edcdd402d9341
DIFF: https://github.com/llvm/llvm-project/commit/6c8248e38bc7f3320301e96dc88edcdd402d9341.diff
LOG: [libomptarget] Rename AMDGPUSignalTy member Signal to HSASignal.
Added:
Modified:
openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
index 41c03c47ff53313..7b4ea794fe7f0d2 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -506,19 +506,19 @@ struct AMDGPUKernelTy : public GenericKernelTy {
/// between asynchronous operations: kernel launches and memory transfers.
struct AMDGPUSignalTy {
/// Create an empty signal.
- AMDGPUSignalTy() : Signal({0}), UseCount() {}
- AMDGPUSignalTy(AMDGPUDeviceTy &Device) : Signal({0}), UseCount() {}
+ AMDGPUSignalTy() : HSASignal({0}), UseCount() {}
+ AMDGPUSignalTy(AMDGPUDeviceTy &Device) : HSASignal({0}), UseCount() {}
/// Initialize the signal with an initial value.
Error init(uint32_t InitialValue = 1) {
hsa_status_t Status =
- hsa_amd_signal_create(InitialValue, 0, nullptr, 0, &Signal);
+ hsa_amd_signal_create(InitialValue, 0, nullptr, 0, &HSASignal);
return Plugin::check(Status, "Error in hsa_signal_create: %s");
}
/// Deinitialize the signal.
Error deinit() {
- hsa_status_t Status = hsa_signal_destroy(Signal);
+ hsa_status_t Status = hsa_signal_destroy(HSASignal);
return Plugin::check(Status, "Error in hsa_signal_destroy: %s");
}
@@ -527,7 +527,7 @@ struct AMDGPUSignalTy {
GenericDeviceTy *Device = nullptr) const {
if (ActiveTimeout && !RPCServer) {
hsa_signal_value_t Got = 1;
- Got = hsa_signal_wait_scacquire(Signal, HSA_SIGNAL_CONDITION_EQ, 0,
+ Got = hsa_signal_wait_scacquire(HSASignal, HSA_SIGNAL_CONDITION_EQ, 0,
ActiveTimeout, HSA_WAIT_STATE_ACTIVE);
if (Got == 0)
return Plugin::success();
@@ -536,7 +536,7 @@ struct AMDGPUSignalTy {
// If there is an RPC device attached to this stream we run it as a server.
uint64_t Timeout = RPCServer ? 8192 : UINT64_MAX;
auto WaitState = RPCServer ? HSA_WAIT_STATE_ACTIVE : HSA_WAIT_STATE_BLOCKED;
- while (hsa_signal_wait_scacquire(Signal, HSA_SIGNAL_CONDITION_EQ, 0,
+ while (hsa_signal_wait_scacquire(HSASignal, HSA_SIGNAL_CONDITION_EQ, 0,
Timeout, WaitState) != 0) {
if (RPCServer && Device)
if (auto Err = RPCServer->runServer(*Device))
@@ -546,18 +546,20 @@ struct AMDGPUSignalTy {
}
/// Load the value on the signal.
- hsa_signal_value_t load() const { return hsa_signal_load_scacquire(Signal); }
+ hsa_signal_value_t load() const {
+ return hsa_signal_load_scacquire(HSASignal);
+ }
/// Signal decrementing by one.
void signal() {
assert(load() > 0 && "Invalid signal value");
- hsa_signal_subtract_screlease(Signal, 1);
+ hsa_signal_subtract_screlease(HSASignal, 1);
}
/// Reset the signal value before reusing the signal. Do not call this
/// function if the signal is being currently used by any watcher, such as a
/// plugin thread or the HSA runtime.
- void reset() { hsa_signal_store_screlease(Signal, 1); }
+ void reset() { hsa_signal_store_screlease(HSASignal, 1); }
/// Increase the number of concurrent uses.
void increaseUseCount() { UseCount.increase(); }
@@ -565,11 +567,11 @@ struct AMDGPUSignalTy {
/// Decrease the number of concurrent uses and return whether was the last.
bool decreaseUseCount() { return UseCount.decrease(); }
- hsa_signal_t get() const { return Signal; }
+ hsa_signal_t get() const { return HSASignal; }
private:
/// The underlying HSA signal.
- hsa_signal_t Signal;
+ hsa_signal_t HSASignal;
/// Reference counter for tracking the concurrent use count. This is mainly
/// used for knowing how many streams are using the signal.
More information about the Openmp-commits
mailing list