Skip to content

refactor(examples): standardize example file structure#1770

Merged
cpcloud merged 2 commits intoNVIDIA:mainfrom
cpcloud:issue-1674
Mar 17, 2026
Merged

refactor(examples): standardize example file structure#1770
cpcloud merged 2 commits intoNVIDIA:mainfrom
cpcloud:issue-1674

Conversation

@cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Mar 16, 2026

Summary

  • normalize the file-level description banners across the 25 runnable examples in cuda_core/examples and cuda_bindings/examples
  • standardize direct execution structure by using main() and if __name__ == "__main__" consistently, including moving the remaining cuda_core module-level execution into main()
  • preserve the pytest-driven cuda_bindings example layout while adding the missing direct-execution guard for conjugateGradientMultiBlockCG_test.py

Follow Ups

  • decide whether the normalized top-of-file description blocks should become module docstrings instead of comment banners
  • handle the remaining example-polish follow-up items separately, including naming conventions, cleanup patterns, import/dependency policy, error/output consistency, and documentation coverage

Closes #1674

Made with Cursor

@github-actions

This comment has been minimized.

@rwgk
Copy link
Collaborator

rwgk commented Mar 16, 2026

Drive-by action: I just triggered a rerun of a failed Windows build (infrastructure flake). Hope that's helpful.

@cpcloud
Copy link
Contributor Author

cpcloud commented Mar 16, 2026

Yup, thanks!

@cpcloud cpcloud requested review from rparolin and rwgk March 16, 2026 20:17
Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

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

I looked at the changes pretty carefully: apart from the loss of the very useful comment block in cuda_core/examples/gl_interop_plasma.py it looks great to me.

Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

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

Approving so you can merge this in your morning; please see #1770 (comment)

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Mar 17, 2026

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.

cpcloud added 2 commits March 17, 2026 06:35
Normalize example description headers and entry points so the core and bindings examples follow the same executable layout ahead of the broader examples polish work.

Made-with: Cursor
Keep the normalized file banner while restoring the detailed GraphicsResource walkthrough that makes the OpenGL interop example easier to follow.

Made-with: Cursor
@cpcloud cpcloud enabled auto-merge (squash) March 17, 2026 10:36
@cpcloud cpcloud merged commit 37d6f01 into NVIDIA:main Mar 17, 2026
86 checks passed
@github-actions
Copy link

Doc Preview CI
Preview removed because the pull request was closed or merged.

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.

Examples: Standardize file structure conventions

2 participants