# What is a good way to get the n largest elements of a CuArray?

**URL:** https://discourse.julialang.org/t/what-is-a-good-way-to-get-the-n-largest-elements-of-a-cuarray/51324
**Category:** GPU
**Created:** [December 5, 2020, 10:25pm UTC](https://discourse.julialang.org/t/what-is-a-good-way-to-get-the-n-largest-elements-of-a-cuarray/51324 "2020-12-05T22:25:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pjentsch0](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pjentsch0/32/15148_2.png) [@pjentsch0](https://discourse.julialang.org/u/pjentsch0)
#### Post date: [December 5, 2020, 10:25pm UTC](https://discourse.julialang.org/t/what-is-a-good-way-to-get-the-n-largest-elements-of-a-cuarray/51324/1 "2020-12-05T22:25:02Z")

</div>

I noticed that `partialsort!` is not yet defined for`CuArray`, I don’t need the `n` largest in any particular order, either.

Thank you!

---

<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: [December 7, 2020, 7:26am UTC](https://discourse.julialang.org/t/what-is-a-good-way-to-get-the-n-largest-elements-of-a-cuarray/51324/2 "2020-12-07T07:26:11Z")

</div>

Sorting is not implemented in CUDA.jl. See [https://github.com/JuliaGPU/CUDA.jl/pull/431](https://github.com/JuliaGPU/CUDA.jl/pull/431) for a WIP PR.
