Skip to content

Enhance build flags for Debug and RelWithDebInfo configurations #1671

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: main
Choose a base branch
from

Conversation

chunhuanMeng
Copy link
Contributor

@chunhuanMeng chunhuanMeng commented May 15, 2025

Updates the build configuration in cmake/BuildFlags.cmake for different build types. The changes focus on improving debugging capabilities and adding specific flags for Debug and RelWithDebInfo build types.

Debugging and Optimization Flags:

  • Added a condition in CMakeLists.txt to automatically enable BUILD_SEPARATE_OPS when the build type is Debug or RelWithDebInfo.
  • Consolidated SYCL_HOST_FLAGS for the Debug build type to include -g, -fno-omit-frame-pointer, and -O0, and added a new configuration for the RelWithDebInfo build type with -g and -O2.
  • Updated SYCL_KERNEL_OPTIONS to add -g -O0 -Rno-debug-disables-optimization for Debug builds and -gline-tables-only -O2 for RelWithDebInfo builds.

@Copilot Copilot AI review requested due to automatic review settings May 15, 2025 06:56
Copy link
Contributor

@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.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • cmake/BuildFlags.cmake: Language not supported

@chunhuanMeng chunhuanMeng requested a review from Copilot May 15, 2025 06:56
Copy link
Contributor

@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.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • cmake/BuildFlags.cmake: Language not supported


if(CMAKE_BUILD_TYPE MATCHES Debug)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -g)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -Rno-debug-disables-optimization)
Copy link
Contributor

Choose a reason for hiding this comment

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

why we use -Rno-debug-disables-optimization on kernel option but -O0 in host option? we should keep them the same. https://github.com/intel/torch-xpu-ops/blob/main/cmake/BuildFlags.cmake#L47

@chunhuanMeng chunhuanMeng changed the title Enhance Debug Build Configuration with Conditional Compiler Options Enhance build flags for Debug and RelWithDebInfo configurations May 16, 2025
@chunhuanMeng chunhuanMeng requested a review from jianyizh May 16, 2025 06:56
@jianyizh jianyizh requested a review from Copilot May 16, 2025 08:13
Copy link
Contributor

@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.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • cmake/BuildFlags.cmake: Language not supported

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

Successfully merging this pull request may close these issues.

2 participants