CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "top.hpp"
|
|
|
|
namespace amd {
|
|
class Device;
|
|
};
|
|
|
|
namespace amd::device {
|
|
|
|
// Light abstraction over HSA/PAL signals
|
|
class Signal {
|
|
public:
|
|
enum class Condition : uint32_t {
|
|
Eq = 0,
|
|
Ne = 1,
|
|
Lt = 2,
|
|
Gte = 3,
|
|
};
|
|
|
|
enum class WaitState : uint32_t {
|
|
Blocked = 0,
|
|
Active = 1,
|
|
};
|
|
|
|
protected:
|
|
WaitState ws_;
|
|
|
|
public:
|
|
virtual ~Signal() {}
|
|
|
|
virtual bool Init(const amd::Device& dev, uint64_t init, WaitState ws) { return false; }
|
|
|
|
// Blocks the current thread untill the condition c is satisfied
|
|
// or amount of time specified by timeout passes
|
|
virtual uint64_t Wait(uint64_t value, Condition c, uint64_t timeout) { return -1; }
|
|
|
|
// Atomically sets the current value of the signal
|
|
virtual void Reset(uint64_t value) {}
|
|
|
|
// Atomically loads the current value of the signal
|
|
virtual uint64_t Load() { return 0; }
|
|
|
|
// Exports the signal as an IPC handle into the provided buffer
|
|
virtual bool IpcExport(void* handle, size_t handle_size) { return false; }
|
|
|
|
// Initializes this signal from an IPC handle (alternative to Init for imported signals)
|
|
virtual bool IpcImport(const void* handle, size_t handle_size) { return false; }
|
|
|
|
// Return the handle to the underlying amd_signal_t object
|
|
virtual void* getHandle() { return nullptr; }
|
|
};
|
|
|
|
}; // namespace amd::device
|