Skip to content

[SYCLomatic] Emit the verified component version. #2855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: SYCLomatic
Choose a base branch
from

Conversation

ShengchenJ
Copy link
Contributor

No description provided.

@ShengchenJ ShengchenJ requested a review from a team as a code owner May 26, 2025 08:47
@ShengchenJ ShengchenJ marked this pull request as draft May 26, 2025 08:48
Signed-off-by: Chen, Sheng S <[email protected]>
@ShengchenJ ShengchenJ requested a review from Copilot May 28, 2025 07:55
Copilot

This comment was marked as outdated.

Signed-off-by: Chen, Sheng S <[email protected]>
Signed-off-by: Shengchenj <[email protected]>
Signed-off-by: Shengchenj <[email protected]>
Signed-off-by: Shengchenj <[email protected]>
Signed-off-by: Shengchenj <[email protected]>
@ShengchenJ ShengchenJ requested a review from Copilot June 5, 2025 02:55
Copilot

This comment was marked as outdated.

Signed-off-by: Shengchenj <[email protected]>
Signed-off-by: Shengchenj <[email protected]>
@ShengchenJ ShengchenJ requested a review from Copilot June 5, 2025 05:37
@ShengchenJ ShengchenJ added the enhancement New feature or request label Jun 5, 2025
@ShengchenJ ShengchenJ marked this pull request as ready for review June 5, 2025 05:39
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the ability for SYCLomatic to parse a supported-components YAML file, verify which components were used in migrations, and emit compatibility version information via a new --supported-components flag.

  • Introduce a YAML schema stub (component_version.yaml) to list supported components and their versions
  • Implement parsing, status tracking, and display logic in a new ComponentVersion module
  • Wire up a --supported-components command-line option and invoke the display routine in the DPCT driver

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
clang/tools/dpct/extensions/supported_components/component_version.yaml Added stub schema for supported-components configuration
clang/tools/dpct/extensions/CMakeLists.txt Included and installed the new YAML schema file
clang/lib/DPCT/FileGenerator/GenFiles.cpp Added GenVerifiedCmpVer to collect and record used components
clang/lib/DPCT/DPCT.cpp Loaded the YAML at startup and hooked up --supported-components
clang/lib/DPCT/ComponentVersion/ComponentVersion.h Declared types and APIs for parsing and displaying component info
clang/lib/DPCT/ComponentVersion/ComponentVersion.cpp Implemented YAML traits, parsing, and display routines
clang/lib/DPCT/CMakeLists.txt Added ComponentVersion.cpp to the DPCT library targets
clang/lib/DPCT/AnalysisInfo.h Added storage and accessors for compatible component status
clang/lib/DPCT/AnalysisInfo.cpp Defined static members for component status and flag
clang/include/clang/DPCT/DPCTOptions.inc Added the supported-components command-line option
Comments suppressed due to low confidence (4)

clang/lib/DPCT/AnalysisInfo.h:1617

  • [nitpick] The flag name CompatibleComps is ambiguous. Consider renaming it to something more descriptive like PrintSupportedComponents or ShowSupportedComponents to clarify its purpose.
static bool CompatibleComps;

clang/tools/dpct/extensions/supported_components/component_version.yaml:6

  • [nitpick] The comment Time Stamp of component is vague. Specify the expected format (e.g., a numeric version string like 1.2.3) to help contributors understand how to populate SupportedVersion.
#   SupportedVersion: Time Stamp of component

clang/lib/DPCT/ComponentVersion/ComponentVersion.h:46

  • The new function parseSupportComponentStatus and the display routines lack dedicated unit or integration tests. Consider adding tests that load a sample component_version.yaml and verify the parsed output and display formatting.
void parseSupportComponentStatus(

clang/lib/DPCT/DPCT.cpp:993

  • The identifier CompatibleComps is not declared in this scope. You likely intended to reference the static member DpctGlobalInfo::CompatibleComps or capture the parsed option into a local variable before use.
if (CompatibleComps) {

auto CompStatusList = dpct::DpctGlobalInfo::getCompatibleCompsStatus();
auto CompsInfo = dpct::DpctGlobalInfo::getSupportedComponentInfo();
for (auto CompStatus : CompStatusList) {
for (auto Repl : MainSrcFilesRepls) {
Copy link
Preview

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop copies each Replacement by value. Change to for (const auto &Repl : MainSrcFilesRepls) to avoid unnecessary copies.

Suggested change
for (auto Repl : MainSrcFilesRepls) {
for (const auto &Repl : MainSrcFilesRepls) {

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant