Skip to content

Commit

Permalink
adding test to call operator from the cudaq kernel
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Pisal <[email protected]>
  • Loading branch information
sacpis committed Jan 3, 2025
1 parent 5180cd2 commit 70127e5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion python/tests/kernel/test_ast_compare.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ============================================================================ #
# Copyright (c) 2022 - 2024 NVIDIA Corporation & Affiliates. #
# Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
Expand All @@ -8,6 +8,7 @@

import os
import pytest
import cudaq


def cmpfop(predicate, left, right):
Expand Down Expand Up @@ -92,6 +93,17 @@ def test_visit_compare(left, right, operation, expected):
assert result == expected


def test_comparison_operators():

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

print(test1)

# CHECK-LABEL: %true = arith.constant true


if __name__ == "__main__":
loc = os.path.abspath(__file__)
pytest.main([loc, "-rP"])

0 comments on commit 70127e5

Please sign in to comment.