Skip to content

Fix Cython compilation warnings in cuda.core#1834

Merged
Andy-Jost merged 1 commit intoNVIDIA:mainfrom
Andy-Jost:fix-cython-warnings
Mar 31, 2026
Merged

Fix Cython compilation warnings in cuda.core#1834
Andy-Jost merged 1 commit intoNVIDIA:mainfrom
Andy-Jost:fix-cython-warnings

Conversation

@Andy-Jost
Copy link
Copy Markdown
Contributor

@Andy-Jost Andy-Jost commented Mar 30, 2026

Summary

Eliminates all 8 Cython-level compilation warnings emitted during the cuda.core build.

Changes

  • _device.pyxcimport Buffer, MemoryResource from _buffer.pxd to resolve "Unknown type declaration" warnings (no circular dependency)
  • _graph_builder.pyx — quote "Graph" in two return annotations (plain Python class, cannot be cimported)
  • _linker.pyx — quote "LinkerOptions" in __init__ annotation (dataclass defined in same file)
  • _memory_pool.pyx, _graph_memory_resource.pyx — quote "DevicePointerT" in deallocate annotation (Python type alias, cannot be cimported)
  • _resource_handles.pyx — remove duplicate MRDeallocCallback ctypedef (already declared in .pxd)

Test Plan

  • Clean build with zero Cython warnings
  • CI

Made with Cursor

- cimport Buffer and MemoryResource into _device.pyx to resolve
  unknown type annotations
- Quote forward-reference annotations (Graph, LinkerOptions,
  DevicePointerT) that Cython cannot resolve at compile time
- Remove duplicate MRDeallocCallback ctypedef from _resource_handles.pyx
  (already declared in .pxd)

Made-with: Cursor
@Andy-Jost Andy-Jost added this to the cuda.core v0.7.0 milestone Mar 30, 2026
@Andy-Jost Andy-Jost added P1 Medium priority - Should do cuda.core Everything related to the cuda.core module labels Mar 30, 2026
@Andy-Jost Andy-Jost self-assigned this Mar 30, 2026
@Andy-Jost Andy-Jost requested review from leofang, mdboom, rparolin and rwgk and removed request for leofang March 30, 2026 18:36
Copy link
Copy Markdown
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

@github-actions

This comment has been minimized.

@Andy-Jost Andy-Jost merged commit 1086f40 into NVIDIA:main Mar 31, 2026
350 of 355 checks passed
@Andy-Jost Andy-Jost deleted the fix-cython-warnings branch March 31, 2026 00:02
@github-actions
Copy link
Copy Markdown

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

cuda.core Everything related to the cuda.core module P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants