# Kernel for building histogram on GPU

**URL:** <https://discourse.julialang.org/t/kernel-for-building-histogram-on-gpu/34191>\
**Category:** GPU\
**Created:** [February 4, 2020, 11:52pm UTC](https://discourse.julialang.org/t/kernel-for-building-histogram-on-gpu/34191 "2020-02-04T23:52:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [February 5, 2020, 7:06am UTC](https://discourse.julialang.org/t/kernel-for-building-histogram-on-gpu/34191/3 "2020-02-05T07:06:55Z")

</div>

Doing global atomic additions from every thread, like that kernel does, is going to be very expensive (read: slow). The link above suggests doing so in shared memory first, which indeed is going to improve performance by a lot.

---

_[View the full topic](https://discourse.julialang.org/t/kernel-for-building-histogram-on-gpu/34191)._
