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
2.4 KiB
C++
60 lines
2.4 KiB
C++
// Copyright © Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// (RFC 0012 §7.1 Phase-1 exit criterion): a hand-written
|
|
// v9-only translation unit that includes ONLY the cuDNN-compatibility shim
|
|
// umbrella header compiles and links, using the FE-namespace enums, the error
|
|
// types, and the §4.7 C-API types it needs. This is the source-compatibility
|
|
// proof for the enum/error/macro surface delivered by this story; the graph
|
|
// and attribute wrappers arrive in Phase 2. Gated behind
|
|
// HIPDNN_ENABLE_CUDNN_COMPATIBILITY in the frontend tests CMakeLists.
|
|
#include <hipdnn_compatibility/cudnn/cudnn_frontend.h>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
// Mirror the consumer hipification step (RFC 0012 §4.2 workflow 1): alias the
|
|
// namespace so in-code `cudnn_frontend::` symbols resolve to the shim.
|
|
namespace cudnn_frontend = hipdnn_frontend::compatibility::cudnn_frontend;
|
|
|
|
// FE-namespace enums resolve through the shim aliases and are the *same* enum
|
|
// as the hipDNN type (aliased, not re-declared).
|
|
static_assert(std::is_same_v<cudnn_frontend::DataType_t, hipdnn_frontend::DataType_t>,
|
|
"cudnn_frontend::DataType_t must alias the hipDNN enum");
|
|
|
|
namespace
|
|
{
|
|
constexpr cudnn_frontend::DataType_t K_IO_TYPE = cudnn_frontend::DataType_t::HALF;
|
|
constexpr cudnn_frontend::DataType_t K_COMPUTE_TYPE = cudnn_frontend::DataType_t::FLOAT;
|
|
constexpr cudnn_frontend::HeurMode_t K_HEUR_MODE = cudnn_frontend::HeurMode_t::A;
|
|
|
|
// error_t / error_code_t resolve through the shim aliases.
|
|
cudnn_frontend::error_t makeOk()
|
|
{
|
|
return {};
|
|
}
|
|
|
|
// §4.7 C-API types come from the stub <cudnn.h> pulled in by the umbrella.
|
|
cudnnStatus_t statusFor(cudnnHandle_t /*handle*/)
|
|
{
|
|
return CUDNN_STATUS_SUCCESS;
|
|
}
|
|
|
|
TEST(TestCudnnShimV9Tu, V9OnlyTranslationUnitCompilesAndLinks)
|
|
{
|
|
// The graph sub-namespace resolves even though it is empty at this phase
|
|
// (this using-directive would fail to compile if the namespace did not
|
|
// exist; Phase 2 will populate it with the Graph/attribute wrappers).
|
|
using namespace cudnn_frontend::graph;
|
|
|
|
EXPECT_TRUE(makeOk().is_good());
|
|
EXPECT_EQ(K_IO_TYPE, cudnn_frontend::DataType_t::HALF);
|
|
EXPECT_EQ(K_COMPUTE_TYPE, cudnn_frontend::DataType_t::FLOAT);
|
|
EXPECT_EQ(K_HEUR_MODE, cudnn_frontend::HeurMode_t::A);
|
|
EXPECT_EQ(statusFor(nullptr), CUDNN_STATUS_SUCCESS);
|
|
EXPECT_EQ(CUDNN_FRONTEND_VERSION, 12400);
|
|
|
|
SUCCEED() << "v9-only TU compiled and linked against the shim umbrella.";
|
|
}
|
|
|
|
} // namespace
|