Skip to content

Conversation

mmason-nvidia
Copy link
Contributor

Description

Fix command line arguments checking related to optimization, debugging, and lineinfo.
Fix ProgramOptions.repr() to return a string instead of a list.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

…g, and lineinfo.

Fix ProgramOptions.__repr__() to return a string instead of a list.
Copy link
Contributor

copy-pr-bot bot commented Aug 22, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@mmason-nvidia
Copy link
Contributor Author

/ok to test

Copy link
Contributor

copy-pr-bot bot commented Aug 22, 2025

/ok to test

@mmason-nvidia, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

Copy link
Contributor

@mdboom mdboom left a comment

Choose a reason for hiding this comment

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

LGTM, but should we do this for all of the boolean attributes for completeness?

(I'm new to the project, so I'm mostly suggesting this for the next reviewer to decide whether that makes sense).

@@ -244,8 +244,8 @@ def __post_init__(self):
self._formatted_options.append("--device-debug")
if self.lineinfo is not None and self.lineinfo:
self._formatted_options.append("--generate-line-info")
if self.device_code_optimize is not None:
self._formatted_options.append(f"--dopt={'on' if self.device_code_optimize else 'off'}")
if self.device_code_optimize is not None and self.device_code_optimize:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self.device_code_optimize is not None and self.device_code_optimize:
if self.device_code_optimize is True:

self.formatted_options.append("-g")
if self.lineinfo is not None:
if self.lineinfo is not None and self.lineinfo:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self.lineinfo is not None and self.lineinfo:
if self.lineinfo is True:

self.formatted_options.append("-lto")
if self.ptx is not None:
self.formatted_options.append("-ptx")
if self.optimization_level is not None:
self.formatted_options.append(f"-O{self.optimization_level}")
if self.debug is not None:
if self.debug is not None and self.debug:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self.debug is not None and self.debug:
if self.debug is True:

@@ -205,15 +205,15 @@ def _init_nvjitlink(self):
self.formatted_options.append("-time")
if self.verbose is not None:
self.formatted_options.append("-verbose")
if self.link_time_optimization is not None:
if self.link_time_optimization is not None and self.link_time_optimization:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self.link_time_optimization is not None and self.link_time_optimization:
if self.link_time_optimization is True:

@leofang
Copy link
Member

leofang commented Aug 22, 2025

should we do this for all of the boolean attributes for completeness?

Probably a good idea!

@leofang leofang added enhancement Any code-related improvements P1 Medium priority - Should do cuda.core Everything related to the cuda.core module labels Aug 22, 2025
@leofang leofang added this to the cuda.core beta 7 milestone Aug 22, 2025
Copy link
Member

@leofang leofang left a comment

Choose a reason for hiding this comment

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

As discussed offline, ignore my comments. I'll ask the copilot to do a global sweep later.

@github-project-automation github-project-automation bot moved this from Todo to In Review in CCCL Aug 22, 2025
@mmason-nvidia
Copy link
Contributor Author

/ok to test 9f1282f

Copy link

@leofang leofang merged commit db8daa6 into NVIDIA:main Aug 22, 2025
51 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda.core Everything related to the cuda.core module enhancement Any code-related improvements P1 Medium priority - Should do
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants