FLAMEGPU / FLAMEGPU2

FLAME GPU 2 is a GPU accelerated agent based modelling framework for CUDA C++ and Python
https://flamegpu.com
MIT License
106 stars 21 forks source link

Optionally disable CURAND from being initialised. #562

Open ptheywood opened 3 years ago

ptheywood commented 3 years ago

Most models will probably want to make use of device RNG. Some will not (where agent initialisation is the only source of variance in the model, so host RNG).

In this case, curand doesnt' need to exist or be initialised.

Initialisation costs a number of miliseconds for a population of ~ 100k agents on a 1070, and it being availble in kernel may have an impact on registers (if the compiler doesn't ignore it if it is not used).

Low priority as most models probably want device RNG? and for any simulation with large message lists or many itearations one time cost will be averaged away.

This will also be more impactful where agent birth exists, as total population growh leads to more curand initialisation.

Robadob commented 3 years ago

Not a fan of this, we'd want to block RNG from being called on device.

ptheywood commented 3 years ago

It could go behind seatbelts with a device exception much like birth / death when not enabled, and the method can be set to always return 0.f or 1.f otherwise that should hopefulyl make people notice.

Otherwise it would have to become a template parameter somewhere.

It's a bit grim but when RNG is not required it could add up to a measurable amount of time, especially when there is device birth.

Robadob commented 3 years ago

I suppose.