Files
TheRock/rocm-libraries/projects/hipdnn/tests/frontend/main.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

52 lines
2.1 KiB
C++

/*
Copyright © Advanced Micro Devices, Inc., or its affiliates.
SPDX-License-Identifier: MIT
*/
#include <array>
#include <gtest/gtest.h>
#include <hipdnn_backend.h>
#include <hipdnn_data_sdk/utilities/PlatformUtils.hpp>
#include <hipdnn_frontend.hpp>
#include <hipdnn_test_sdk/utilities/HipErrorHandler.hpp>
#include <hipdnn_test_sdk/utilities/LogRecorder.hpp>
#include <test_plugins/TestPluginConstants.hpp>
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
// Initialize test log recording infrastructure to always forward logs to hipdnnLoggingCallback_ext().
// NOTE: The frontend logger must be initialized with recordingCallback to ensure the logs
// are recorded and forwarded to the hipdnnLoggingCallback_ext() function.
auto recordingCallback = hipdnn_test_sdk::utilities::initializeChainedTestLogRecordingShared(
hipdnnLoggingCallback_ext);
// Initialize frontend logging with test recording callback returned above.
// This must be called to override the default callback that would otherwise
// be used by HIPDNN_FE_LOG_* macros with lazy-initialization.
hipdnn_frontend::initializeFrontendLogging(recordingCallback);
// Register HipErrorHandler to check and clear HIP errors after each test
testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners();
listeners.Append(new hipdnn_test_sdk::utilities::HipErrorHandler);
// Wire the engine-agnostic test_good_heuristic_plugin in globally so engine
// selection succeeds without depending on any production heuristic plugin.
// Must run before any handle is created.
const std::array<const char*, 1> heuristicPaths
= {hipdnn_tests::plugin_constants::testGoodHeuristicPluginPath().c_str()};
if(hipdnnSetHeuristicPluginPaths_ext(
heuristicPaths.size(), heuristicPaths.data(), HIPDNN_PLUGIN_LOADING_ABSOLUTE)
!= HIPDNN_STATUS_SUCCESS)
{
return 1;
}
hipdnn_data_sdk::utilities::setEnv(
"HIPDNN_HEUR_POLICY_ORDER", hipdnn_tests::plugin_constants::testGoodHeuristicPolicyName());
auto result = RUN_ALL_TESTS();
return result;
}