# Is there anything like vmap to vectorize a computation

**URL:** <https://discourse.julialang.org/t/is-there-anything-like-vmap-to-vectorize-a-computation/126288>\
**Category:** GPU\
**Created:** [February 25, 2025, 12:32pm UTC](https://discourse.julialang.org/t/is-there-anything-like-vmap-to-vectorize-a-computation/126288 "2025-02-25T12:32:56Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Leander](https://avatars.discourse-cdn.com/v4/letter/l/bcef8e/32.png) [@Leander](https://discourse.julialang.org/u/Leander)\
**Post date:** [February 25, 2025, 5:53pm UTC](https://discourse.julialang.org/t/is-there-anything-like-vmap-to-vectorize-a-computation/126288/9 "2025-02-25T17:53:31Z")

</div>

according to this:

> [@How to do mapslices() in parallel for 3D arrays](https://discourse.julialang.org/t/how-to-do-mapslices-in-parallel-for-3d-arrays/100484/4):
>
> Update my solutions here. Shorter but not efficient enough solution. This solution aligns each 3D array layer in 2D array, then computes the result of 2D array multiplication and last converts back to 3D array. using CUDA A = CUDA.rand(4, 4, 3) B = CUDA.rand(4, 4) C = reshape(permutedims(A, [1, 3, 2]), size(A, 1) \* size(A, 3), slight_smile \* B C = permutedims(reshape(C, size(A, 1), size(A, 3), :), [1, 3, 2]) Longer but more efficient solution. Use for loop to get each entry of the final 3D array. Thi…

this is not really working afaik

---

_[View the full topic](https://discourse.julialang.org/t/is-there-anything-like-vmap-to-vectorize-a-computation/126288)._
