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
72 lines
2.2 KiB
C++
72 lines
2.2 KiB
C++
// Copyright © Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// Fake plugin that implements both standard and override-aware execute entries.
|
|
|
|
#include "TestPluginCommon.hpp"
|
|
#include "TestPluginEngineIdMap.hpp"
|
|
|
|
#include <hipdnn_plugin_sdk/PluginVersionConstants.hpp>
|
|
|
|
// NOLINTNEXTLINE
|
|
thread_local char
|
|
hipdnn_plugin_sdk::PluginLastErrorManager::s_lastError[HIPDNN_PLUGIN_ERROR_STRING_MAX_LENGTH]
|
|
= "";
|
|
|
|
// Define thread-local LastCallRecord storage and the suffixed C-API
|
|
// observation entry points for tests. Must come before the plugin class so
|
|
// the override of `lastCallRecord()` can name the suffixed accessor.
|
|
DEFINE_TEST_PLUGIN_LAST_CALL_STORAGE(OverrideImplementing)
|
|
|
|
class OverrideImplementingPlugin : public TestPluginBase
|
|
{
|
|
public:
|
|
const char* getPluginName() const override
|
|
{
|
|
return "test_OverrideImplementingPlugin";
|
|
}
|
|
const char* getPluginVersion() const override
|
|
{
|
|
return "1.0.0";
|
|
}
|
|
|
|
/// Reports the minimum plugin SDK version for override execution.
|
|
const char* getPluginApiVersion() const override
|
|
{
|
|
return hipdnn_plugin_sdk::K_OVERRIDE_EXECUTE_MIN_API_VERSION.data();
|
|
}
|
|
|
|
int64_t getEngineId() const override
|
|
{
|
|
return hipdnn_tests::plugin_constants::engineId<OverrideImplementingPlugin>();
|
|
}
|
|
uint32_t getNumEngines() const override
|
|
{
|
|
return 1;
|
|
}
|
|
uint32_t getNumApplicableEngines() const override
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
/// Routes the base-class observation hooks to this plugin's suffixed
|
|
/// thread-local storage so tests can inspect dispatch via
|
|
/// `getLastCallRecord_OverrideImplementing()`.
|
|
TestPluginLastCallRecord& lastCallRecord() const override
|
|
{
|
|
return testPluginLastCallRecord_OverrideImplementing();
|
|
}
|
|
};
|
|
|
|
// Initialize plugin instance on load
|
|
__attribute__((constructor)) static void initializePlugin()
|
|
{
|
|
TestPluginBase::setInstance(std::make_unique<OverrideImplementingPlugin>());
|
|
}
|
|
|
|
// Register all standard plugin API functions PLUS the optional override
|
|
// execute entry. Presence of the override symbol is exactly what makes
|
|
// this plugin "override-implementing" from the host's perspective.
|
|
REGISTER_TEST_PLUGIN_API()
|
|
REGISTER_TEST_PLUGIN_OVERRIDE_API()
|