Files
TheRock/rocm-libraries/projects/hipdnn/tests/test_plugins/TestVersionLiarPlugin.cpp
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

69 lines
2.0 KiB
C++

// Copyright © Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Fake plugin that reports the override API version but omits the override symbol.
#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(VersionLiar)
class VersionLiarPlugin : public TestPluginBase
{
public:
const char* getPluginName() const override
{
return "test_VersionLiarPlugin";
}
const char* getPluginVersion() const override
{
return "1.0.0";
}
/// Reports the override-capable API version without exporting the override symbol.
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<VersionLiarPlugin>();
}
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_VersionLiar()`.
TestPluginLastCallRecord& lastCallRecord() const override
{
return testPluginLastCallRecord_VersionLiar();
}
};
// Initialize plugin instance on load
__attribute__((constructor)) static void initializePlugin()
{
TestPluginBase::setInstance(std::make_unique<VersionLiarPlugin>());
}
// Register only the standard plugin API functions.
REGISTER_TEST_PLUGIN_API()