[ROCm][Windows] Fix ROCm/HIP version header (#148560)

On Windows, ROCm libraries do not have a `<rocm-core/rocm_version.h>` header, which causes the compilation to fail. This PR resolves this problem by utilising `<hip/hip_version.h>`  from HIP SDK.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/148560
Approved by: https://github.com/jeffdaily
This commit is contained in:
Michal Gallus 2025-03-10 11:28:13 +00:00 committed by PyTorch MergeBot
parent 00199acdb8
commit 74da76f67c

View File

@ -31,7 +31,11 @@
// for validators
#ifdef USE_ROCM
#ifdef _WIN32
#include <hip/hip_version.h>
#else
#include <rocm-core/rocm_version.h>
#endif
#define ROCBLAS_BETA_FEATURES_API
#include <rocblas/rocblas.h>
#include <hipblaslt/hipblaslt.h>
@ -218,7 +222,11 @@ TuningResultsValidator::TuningResultsValidator() {
#ifdef USE_ROCM
// rocm
{
#ifdef _WIN32
std::string rocm_version = HIP_VERSION_BUILD_NAME;
#else
std::string rocm_version = ROCM_BUILD_INFO;
#endif
RegisterValidator(
"ROCM_VERSION",
[rocm_version]() { return rocm_version; },