Skip to content

Commit

Permalink
Amend codegen integration test to use constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Nov 8, 2023
1 parent c48849d commit d1e06f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/python/codegen/test_codegen_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
from pyflamegpu import *
import pyflamegpu.codegen
from random import randint
import typing


AGENT_COUNT = 100
STEPS = 5

TEN: pyflamegpu.constant = 10
TWO: typing.Final = 2

@pyflamegpu.device_function
def add_2(a : int) -> int:
"""
Pure python agent device function that can be called from a @pyflamegpu.agent_function
Function adds two to an int variable
"""
return a + 2
return a + TWO

@pyflamegpu.agent_function
def add_func(message_in: pyflamegpu.MessageNone, message_out: pyflamegpu.MessageNone):
Expand All @@ -26,7 +29,7 @@ def add_func(message_in: pyflamegpu.MessageNone, message_out: pyflamegpu.Message
@pyflamegpu.agent_function_condition
def cond_func() -> bool:
i = pyflamegpu.getVariableInt("i")
return i < 10
return i < TEN

class GPUTest(TestCase):
"""
Expand Down

0 comments on commit d1e06f0

Please sign in to comment.