[hip-kernel-provider] Pass -std=c++17 to hiprtc compile options#7765
Open
adickin-amd wants to merge 1 commit into
Open
[hip-kernel-provider] Pass -std=c++17 to hiprtc compile options#7765adickin-amd wants to merge 1 commit into
adickin-amd wants to merge 1 commit into
Conversation
The fused BN+activation kernel (BatchNormFwdTrainSpatial.cpp) uses
direct-list-init of a scoped enum (ActivationMode{HIP_PLUGIN_NRN_OP_ID}),
which is C++17 only (P0138R2). Without -std=c++17 in the hiprtc compile
options, JIT compilation fails with HIPRTC_ERROR_COMPILATION and every
IntegrationGpuBatchnormFwdTrainingActiv* test in RELU_FWD mode aborts.
Fix the integration suite by adding -std=c++17 to the base options
assembled in HipKernelCompileOptions.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CMiservaAMD
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: [hip-kernel-provider] Pass -std=c++17 to hiprtc compile options
Summary
The fused BN+activation kernel (
BatchNormFwdTrainSpatial.cpp) uses direct-list-init of a scoped enum (ActivationMode{HIP_PLUGIN_NRN_OP_ID}), a C++17-only construct (P0138R2). Without-std=c++17in the hiprtc compile options, JIT compilation fails withHIPRTC_ERROR_COMPILATIONand everyIntegrationGpuBatchnormFwdTrainingActiv*test inRELU_FWDmode aborts. This PR adds the flag to the base options assembled inHipKernelCompileOptions.Risk Assessment
Low risk. Single additive compile flag in the runtime hiprtc invocation path; no public API, build, or schema change. The codebase already requires C++17 elsewhere, and the only observable effect is that previously-rejected kernels now compile.
Testing Summary
origin/developworktree before applying the fix to confirm the bug is pre-existing.hip-kernel-providerintegration suite after the fix to verify the 432 previously-failing tests now pass with no regressions elsewhere.Testing Checklist
origin/develop(no fix) -hip_kernel_provider_integration_tests.exe --gtest_filter="Smoke/IntegrationGpuBatchnormFwdTrainingActivNchwFp32.FullTraining/0"- ASICs: gfx1151 (Windows) - Status: Failed as expected (HIPRTC_ERROR_COMPILATION)*BatchnormFwdTrainingActiv*tests -hip_kernel_provider_integration_tests.exe --gtest_filter="*BatchnormFwdTrainingActiv*"- ASICs: gfx1151 (Windows) - Status: Passed (300/300)hip-kernel-provider-integration-check-cmake --build build --target hip-kernel-provider-integration-check- ASICs: gfx1151 (Windows) - Status: Passed (0 failures, ~436s)git commit- Status: PassedTechnical Changes
-std=c++17to the base hiprtc compile options inHipKernelCompileOptions, so JIT-compiled kernels that useif constexpr, scoped-enum brace-init, and other C++17 features compile cleanly instead of being silently rejected by the hiprtc default.