Skip to content

Conversation

@CodersAcademy006
Copy link

This PR adds kernel-based tests for device-side complex64 operations: addition, multiplication, and absolute value.

  • Skips under cudasim due to divergent semantics

  • Uses NumPy as the reference oracle

  • Scope is intentionally limited to safe, well-defined CUDA operations (no division, power, or mixed-type ops)

This PR is intentionally narrow and reviewer-friendly, following the same discipline as previous CUDA test PRs.
#515

…ests for device-side complex64 addition, multiplication, and absolute value. Skips under cudasim. NumPy is used as the reference. Scope is intentionally limited to safe, well-defined CUDA operations.
@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 three kernel-based tests for device-side complex64 operations: addition, multiplication, and absolute value. The tests use NumPy as the reference oracle and skip execution under cudasim due to divergent semantics.

Key changes:

  • Added skip_on_cudasim import to support decorator usage
  • Implemented three CUDA kernels: complex_add_kernel, complex_mul_kernel, and complex_abs_kernel
  • Added TestCudaComplexBasicOps test class with three test methods that validate kernel behavior against NumPy
  • All code properly structured with SPDX header, imports, and kernel definitions in correct order

The implementation is clean, follows existing test patterns in the codebase, and addresses issue #515 by expanding CUDA test coverage for complex number operations.

Confidence Score: 5/5

  • Safe to merge - well-structured test addition with no runtime risks
  • All previous syntax and structural issues have been resolved. The code has proper imports, correct file structure with SPDX header at top, kernels and test class at the end, no duplicates, and follows existing test patterns in the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
numba_cuda/numba/cuda/tests/cudapy/test_complex.py Added three new tests for basic complex64 operations (addition, multiplication, absolute value) with proper CUDA kernel implementations - no issues found

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, 2 comments

Edit Code Review Agent Settings | Greptile

CodersAcademy006 and others added 2 commits January 21, 2026 11:10
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
….py\n\n- Merged device-side complex64 operation tests (add, multiply, abs) into cudapy/test_complex.py as TestCudaComplexBasicOps for organizational consistency\n- Removed standalone test_complex.py file
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.

Additional Comments (1)

  1. numba_cuda/numba/cuda/tests/cudapy/test_complex.py, line 62-66 (link)

    syntax: duplicate numpy import - already imported on line 2 as np

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

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

Edit Code Review Agent Settings | Greptile

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

Edit Code Review Agent Settings | Greptile

CodersAcademy006 and others added 2 commits January 21, 2026 12:13
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
… duplicate numpy import and comment marker\n\n- Ensures no NameError at import time and code style is clean
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, 3 comments

Edit Code Review Agent Settings | Greptile

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

Additional Comments (1)

  1. numba_cuda/numba/cuda/tests/cudapy/test_complex.py, line 102-141 (link)

    style: duplicate imports - these imports are redundant since they're already present in lines 5-44 (after fixing the decorator on line 4)

1 file reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

…nd all imports come first\n- Removed duplicate imports\n- Kernels and TestCudaComplexBasicOps class now at end of file\n- Resolves NameError issues
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