Skip to content

Conversation

@CodersAcademy006
Copy link

This PR adds kernel-based tests for device-side numeric conversions in Numba-CUDA:

  • int ↔ float

  • float/int → complex

  • bool ↔ numeric

Tests are skipped under cudasim due to divergent semantics, and NumPy is used as the reference oracle. The scope is intentionally limited to safe, well-defined CUDA conversions (no Python object, string, or shape-changing conversions).

This continues the systematic porting of CPU-side tests to CUDA, directly contributing to issue #515.

…ice-side numeric conversions: intfloat, float/intcomplex, boolnumeric. Skips under cudasim. NumPy is used as the reference. Scope is intentionally limited to safe, well-defined CUDA conversions.
@copy-pr-bot
Copy link

copy-pr-bot bot commented Jan 20, 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.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 20, 2026

Greptile Summary

Adds a new test file for device-side numeric conversions in CUDA kernels. The implementation tests int↔float, float/int→complex, and bool↔numeric conversions using NumPy as the reference oracle.

  • Properly includes SPDX license header (addresses previous review comment)
  • Uses @skip_on_cudasim decorator to handle divergent semantics
  • Clean kernel-based test pattern with helper methods _launch_1d and _run_conversion
  • Comprehensive coverage of basic numeric conversion types
  • Tests align well with issue Incomplete Test Coverage in Numba-CUDA #515 goals for porting CPU tests to CUDA

Confidence Score: 5/5

  • Safe to merge - well-structured test file with proper licensing and clear test coverage
  • The PR adds a straightforward test file following established patterns in the codebase. The SPDX header issue from previous review has been addressed. Tests are well-scoped, use appropriate decorators, and follow the repository's testing conventions. No logic issues, security concerns, or anti-patterns detected.
  • No files require special attention

Important Files Changed

Filename Overview
numba_cuda/numba/cuda/tests/test_conversion.py New test file for CUDA numeric conversions (int↔float, float/int→complex, bool↔numeric). Well-structured with SPDX header, uses NumPy as reference oracle, properly skips cudasim.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.

1 participant