Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for float comparison in ASTBridge #2489

Merged
merged 7 commits into from
Jan 6, 2025

Conversation

sacpis
Copy link
Collaborator

@sacpis sacpis commented Dec 31, 2024

Fixes #2453

Test result

@cudaq.kernel
def test_kernel():
    a = 0.5 < 1.0

module attributes {quake.mangled_name_map = {__nvqpp__mlirgen__test_kernel = "__nvqpp__mlirgen__test_kernel_PyKernelEntryPointRewrite"}} {
  func.func @__nvqpp__mlirgen__test_kernel() attributes {"cudaq-entrypoint"} {
    %true = arith.constant true
    %0 = cc.alloca i1
    cc.store %true, %0 : !cc.ptr<i1>
    return
  }
}
root@0a258c0dfa5e:/workspaces/cuda-quantum# pytest python/tests/kernel/test_ast_compare.py 
============================================================== test session starts ==============================================================
platform linux -- Python 3.10.12, pytest-8.2.0, pluggy-1.5.0
rootdir: /workspaces/cuda-quantum
configfile: pyproject.toml
plugins: anyio-4.6.2.post1
collected 20 items                                                                                                                              

python/tests/kernel/test_ast_compare.py ....................                                                                              [100%]

============================================================== 20 passed in 0.02s ===============================================================
100% tests passed, 0 tests failed out of 810

Label Time Summary:
gpu_required    = 241.29 sec*proc (381 tests)

Total Test time (real) = 1375.54 sec

@sacpis sacpis changed the title Support for float comparison Support for float comparison in ASTBridge Dec 31, 2024
github-actions bot pushed a commit that referenced this pull request Dec 31, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@sacpis sacpis force-pushed the support_for_float_comparison branch from 55624f4 to 682556c Compare December 31, 2024 17:17
@sacpis sacpis marked this pull request as ready for review December 31, 2024 18:04
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Dec 31, 2024
@schweitzpgi schweitzpgi added the python bridge Involves the python bridge to quake label Jan 2, 2025
@sacpis sacpis enabled auto-merge (squash) January 2, 2025 19:51
@sacpis sacpis force-pushed the support_for_float_comparison branch from c117669 to 044b8b7 Compare January 2, 2025 20:13
Copy link

github-actions bot commented Jan 2, 2025

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Jan 2, 2025
github-actions bot pushed a commit that referenced this pull request Jan 3, 2025
Copy link

github-actions bot commented Jan 3, 2025

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

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

LGTM. @khalatepradnya ought to double check and approve the Python changes.

Thanks for the fixes, Sachin.

@sacpis sacpis disabled auto-merge January 3, 2025 23:44
@sacpis sacpis force-pushed the support_for_float_comparison branch from 47032cc to 70127e5 Compare January 3, 2025 23:47
github-actions bot pushed a commit that referenced this pull request Jan 4, 2025
Copy link

github-actions bot commented Jan 4, 2025

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link

github-actions bot commented Jan 4, 2025

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Jan 4, 2025
@schweitzpgi schweitzpgi merged commit 0ed9251 into NVIDIA:main Jan 6, 2025
213 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python bridge Involves the python bridge to quake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Float comparison operator throws throws error in cudaq.kernel
3 participants