Closed Robadob closed 1 year ago
Within an invocation of a kernel, all agents participating will be in the same state.
So presumably the use-case here is where the same agent function is reused, and somethign different needs to occur?
Agent state strings are only known at runtime, so dont' think we could make it a template value / constexpr if (for non-RTC). RTC we could embed it within the kernel source, and hope the optimiser realises it can optimize out the branching, but would need to ensure the kernel is recompiled per agent fn launch, not just per agent fn source? (I'm not sure if this is the case or not). Would presumably still cost some registers though (or "local" memory)).
During execution, there would be no divergent branching atleast, so the string comparison(s) would be the only epxensive bit. So makeing state names that have different early characters would be a gross way to minimize the run time cost...
Seems sensible. Also add for agent name. Docs need to make sure that performance of this is mentioned for non RTC.
Discussed in https://github.com/FLAMEGPU/FLAMEGPU2/discussions/1107
Need to decide a suitable API, but otherwise should be a simple PR.
Can we make the agent state comparison compile time? aka free?