# Using brian2cuda and cpp\_stardalone for a brian2 script with loop of runs

**URL:** <https://brian.discourse.group/t/using-brian2cuda-and-cpp-stardalone-for-a-brian2-script-with-loop-of-runs/731>\
**Category:** Support\
**Tags:** brian2cuda\
**Created:** [30 June 2022 22:06 UTC](https://brian.discourse.group/t/using-brian2cuda-and-cpp-stardalone-for-a-brian2-script-with-loop-of-runs/731 "2022-06-30T22:06:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![DavidKing2020](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Post date:** [1 July 2022 14:39 UTC](https://brian.discourse.group/t/using-brian2cuda-and-cpp-stardalone-for-a-brian2-script-with-loop-of-runs/731/3 "2022-07-01T14:39:44Z")

</div>

When going through a loop of samples, I need to rerun a sample with different condition, e.g. stimulus rate, until the condition is satisfied before moving to the next sample. This is what we discussed in this thread:

[Re-run the model in a previous time segment during a long run](https://brian.discourse.group/t/re-run-the-model-in-a-previous-time-segment-during-a-long-run/296)

I used runtime mode since then. Now trying to use brian2cuda, I might have to make changes directly in the cuda source. Further inputs would be appreciated.

---

_[View the full topic](https://brian.discourse.group/t/using-brian2cuda-and-cpp-stardalone-for-a-brian2-script-with-loop-of-runs/731)._
