# How to make this piece of code faster? optimising it or using multiple threads?

**URL:** https://discourse.julialang.org/t/how-to-make-this-piece-of-code-faster-optimising-it-or-using-multiple-threads/30590
**Category:** New to Julia
**Created:** [November 1, 2019, 3:17pm UTC](https://discourse.julialang.org/t/how-to-make-this-piece-of-code-faster-optimising-it-or-using-multiple-threads/30590 "2019-11-01T15:17:44Z")
**Posts on this page:** 1
**Showing post:** 72

<div class="post-metadata">

### Author: ![ennvvy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ennvvy/32/7816_2.png) [@ennvvy](https://discourse.julialang.org/u/ennvvy)
#### Post date: [November 29, 2019, 5:39am UTC](https://discourse.julialang.org/t/how-to-make-this-piece-of-code-faster-optimising-it-or-using-multiple-threads/30590/72 "2019-11-29T05:39:35Z")

</div>

I tried having the inner for-loop (`for h in upagents`) on the GPU. But, I couldn’t find alternatives to a few commands that are in there. I posted about it here - [Rewriting function on CPU for execution on GPU](https://discourse.julialang.org/t/rewriting-function-on-cpu-for-execution-on-gpu/31608)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-make-this-piece-of-code-faster-optimising-it-or-using-multiple-threads/30590)._
