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
150 lines
4.3 KiB
C++
150 lines
4.3 KiB
C++
// Copyright © Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#include <hipdnn_plugin_sdk/HeuristicsPluginApi.h>
|
|
#include <hipdnn_plugin_sdk/heuristic_api_version.h>
|
|
|
|
/**
|
|
* This plugin intentionally OMITS required symbols to test error handling
|
|
* in HeuristicPlugin::resolveSymbols().
|
|
*
|
|
* Missing symbols:
|
|
* - hipdnnPluginGetName (required)
|
|
* - hipdnnHeuristicPolicyFinalize (required)
|
|
* - hipdnnHeuristicPolicyGetSortedEngineIds (required)
|
|
*
|
|
* This should cause GET_REQUIRED_SYMBOL to throw HipdnnException with a
|
|
* detailed error message about incomplete ABI implementation.
|
|
*/
|
|
|
|
// NOLINTBEGIN(readability-identifier-naming)
|
|
extern "C" {
|
|
|
|
// ========== Module Metadata (Partial) ==========
|
|
|
|
hipdnnPluginStatus_t hipdnnPluginGetApiVersion(const char** version)
|
|
{
|
|
if(version == nullptr)
|
|
{
|
|
return HIPDNN_PLUGIN_STATUS_INVALID_VALUE;
|
|
}
|
|
*version = HIPDNN_HEURISTIC_API_VERSION;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
hipdnnPluginStatus_t hipdnnPluginGetVersion(const char** version)
|
|
{
|
|
if(version == nullptr)
|
|
{
|
|
return HIPDNN_PLUGIN_STATUS_INVALID_VALUE;
|
|
}
|
|
*version = "0.1.0-incomplete";
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
hipdnnPluginStatus_t hipdnnPluginGetType(hipdnnPluginType_t* type)
|
|
{
|
|
if(type == nullptr)
|
|
{
|
|
return HIPDNN_PLUGIN_STATUS_INVALID_VALUE;
|
|
}
|
|
*type = HIPDNN_PLUGIN_TYPE_HEURISTIC;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
hipdnnPluginStatus_t hipdnnPluginSetLoggingCallback(hipdnnCallback_t callback)
|
|
{
|
|
(void)callback;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
void hipdnnPluginGetLastErrorString(const char** error_str)
|
|
{
|
|
if(error_str != nullptr)
|
|
{
|
|
*error_str = "Incomplete plugin - missing required symbols";
|
|
}
|
|
}
|
|
|
|
// ========== Handle Lifecycle (Partial) ==========
|
|
|
|
hipdnnPluginStatus_t hipdnnHeuristicHandleCreate(hipdnnHeuristicHandle_t* out_handle)
|
|
{
|
|
if(out_handle == nullptr)
|
|
{
|
|
return HIPDNN_PLUGIN_STATUS_INVALID_VALUE;
|
|
}
|
|
// NOLINTNEXTLINE(performance-no-int-to-ptr)
|
|
*out_handle = reinterpret_cast<hipdnnHeuristicHandle_t>(0x1234);
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
hipdnnPluginStatus_t hipdnnHeuristicHandleDestroy(hipdnnHeuristicHandle_t handle)
|
|
{
|
|
(void)handle;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
hipdnnPluginStatus_t
|
|
hipdnnHeuristicHandleSetDeviceProperties(hipdnnHeuristicHandle_t handle,
|
|
const hipdnnPluginConstData_t* devicePropsSerialized)
|
|
{
|
|
(void)handle;
|
|
(void)devicePropsSerialized;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
// ========== Policy Descriptor Lifecycle (Partial) ==========
|
|
|
|
hipdnnPluginStatus_t
|
|
hipdnnHeuristicPolicyDescriptorCreate(hipdnnHeuristicHandle_t handle,
|
|
int64_t policy_id,
|
|
hipdnnHeuristicPolicyDescriptor_t* out_descriptor)
|
|
{
|
|
(void)handle;
|
|
(void)policy_id;
|
|
if(out_descriptor == nullptr)
|
|
{
|
|
return HIPDNN_PLUGIN_STATUS_INVALID_VALUE;
|
|
}
|
|
// NOLINTNEXTLINE(performance-no-int-to-ptr)
|
|
*out_descriptor = reinterpret_cast<hipdnnHeuristicPolicyDescriptor_t>(0x5678);
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
hipdnnPluginStatus_t
|
|
hipdnnHeuristicPolicyDescriptorDestroy(hipdnnHeuristicPolicyDescriptor_t descriptor)
|
|
{
|
|
(void)descriptor;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
// ========== Policy Inputs (Partial) ==========
|
|
|
|
hipdnnPluginStatus_t hipdnnHeuristicPolicySetEngineIds(hipdnnHeuristicPolicyDescriptor_t descriptor,
|
|
const int64_t* engine_ids,
|
|
size_t engine_id_count)
|
|
{
|
|
(void)descriptor;
|
|
(void)engine_ids;
|
|
(void)engine_id_count;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
hipdnnPluginStatus_t
|
|
hipdnnHeuristicPolicySetSerializedGraph(hipdnnHeuristicPolicyDescriptor_t descriptor,
|
|
const hipdnnPluginConstData_t* serialized_graph)
|
|
{
|
|
(void)descriptor;
|
|
(void)serialized_graph;
|
|
return HIPDNN_PLUGIN_STATUS_SUCCESS;
|
|
}
|
|
|
|
// ========== MISSING REQUIRED SYMBOLS ==========
|
|
// hipdnnPluginGetName - NOT IMPLEMENTED
|
|
// hipdnnHeuristicPolicyFinalize - NOT IMPLEMENTED
|
|
// hipdnnHeuristicPolicyGetSortedEngineIds - NOT IMPLEMENTED
|
|
|
|
} // extern "C"
|
|
// NOLINTEND(readability-identifier-naming)
|