# \#reduction

**URL:** https://discourse.julialang.org/tag/reduction/1129.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Reducing over Point objects](https://discourse.julialang.org/t/reducing-over-point-objects/133540)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 9\
**Last updated:** [November 22, 2025, 10:27am UTC](https://discourse.julialang.org/t/reducing-over-point-objects/133540 "2025-11-22T10:27:25Z")

</div>

Julia has many statistics-computing functions, typically a “reduce” kind of function, that can take either a simple vector, or go over an array and compute the output over row, columns, etc according to the dims paramete…

---

## [Reduce allocations in 'reduce + eachcol' call to multiply several columns elementwise](https://discourse.julialang.org/t/reduce-allocations-in-reduce-eachcol-call-to-multiply-several-columns-elementwise/118234)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 6\
**Last updated:** [August 16, 2024, 2:05pm UTC](https://discourse.julialang.org/t/reduce-allocations-in-reduce-eachcol-call-to-multiply-several-columns-elementwise/118234 "2024-08-16T14:05:26Z")

</div>

Hi, I find that using reduce + eachcol in the following allocates more than I would like. The point is to element-wise multiply some columns of X. I’m getting n allocations where n is the number of rows when using reduce …

---

## [Why can't iteration figure out that all elements are identical in this case, and short-circuit the evaluation?](https://discourse.julialang.org/t/why-cant-iteration-figure-out-that-all-elements-are-identical-in-this-case-and-short-circuit-the-evaluation/92454)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 6\
**Last updated:** [January 3, 2023, 6:06pm UTC](https://discourse.julialang.org/t/why-cant-iteration-figure-out-that-all-elements-are-identical-in-this-case-and-short-circuit-the-evaluation/92454 "2023-01-03T18:06:15Z")

</div>

julia\> struct ConstVector \<: AbstractVector{Int} x :: Int len :: Int end julia\> Base.size(c::ConstVector) = (c.len,) julia\> @inline function Base.getindex(c::ConstVector, i::Int) …

---

## [Custom CUDA kernel for nontrivial sum calculations](https://discourse.julialang.org/t/custom-cuda-kernel-for-nontrivial-sum-calculations/87466)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 2\
**Last updated:** [September 20, 2022, 11:11am UTC](https://discourse.julialang.org/t/custom-cuda-kernel-for-nontrivial-sum-calculations/87466 "2022-09-20T11:11:49Z")

</div>

Suppose I want to calculate the following sum: C\_{nm}=\\sum\_i A\_{ni}B\_{im} (in reality, something more complicated). The corresponding code could be function cpu\_add!(C, A, B) @. C = 0 for i in axes(A,1) …

---

## [Error with 3-args dot based on FoldsCUDA](https://discourse.julialang.org/t/error-with-3-args-dot-based-on-foldscuda/86686)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 1\
**Last updated:** [September 4, 2022, 7:45am UTC](https://discourse.julialang.org/t/error-with-3-args-dot-based-on-foldscuda/86686 "2022-09-04T07:45:20Z")

</div>

Hi, I am trying to run a 3 args dot on GPU ( in fact CUDA). I am trying FoldsCUDA for simpler development of reductions but I dont understand why it errors on GPU but ot o CPU. Can someone give me a hint please? Thanks…
