-
Hi all I'm currently trying to translate the C++ sugarscape model from https://github.com/FLAMEGPU/FLAMEGPU2/blob/master/examples/cpp/sugarscape/src/main.cu to a Python model. But I am struggling with the following error:
I think is about the scope of the variable AGENT_STATUS_MOVEMENT_UNRESOLVED and AGENT_STATUS_UNOCCUPIED which are defined outside of the agent function. I see in the IDE that the variable has the correct value. Is the handling of the variables in FLAMEGPU for C++ different to Python or do I missing something else? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
This comment has been hidden.
This comment has been hidden.
-
I've now had a better look at this and done some testing.
Given, the lack of a clear solution I will need to discuss this with the wider FLAMEGPU team to see how we believe this should be addressed. I've created the new issue #1144 to track this. We will hopefully discuss it on Friday and may have an update to resolve it next week if we can agree on a plan. Current workarounds (with the latest codegen from |
Beta Was this translation helpful? Give feedback.
We've now discussed this internally.
The plan is to allow "constants" to be marked with a decorator e.g.
@pyflamegpu.constant
which will pull them in via codegen as aconstexpr
or similar.This is noted in #1144, we don't currently have an eta for making this change.