JuliaGPU/CUDA.jl

Summing a vector is faster than summing a multidimensional array

Open

#2.764 aberto em 28 de abr. de 2025

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Julia (274 forks)batch import
cuda arraygood first issueperformance

Métricas do repositório

Stars
 (1.408 stars)
Métricas de merge de PR
 (Mesclagem média 5d 5h) (16 fundiu PRs em 30d)

Description

I am not sure if this is an expected behavior, but it seems that sum(vec(A)) could be much faster than sum(A) when A is a multi-dimensional array. Please see https://discourse.julialang.org/t/summing-a-vector-is-faster-than-summing-a-multi-dimensional-array-of-the-same-length-using-cuda/116711 for an MWE. Although this post is from about a year ago, I can reproduce matching results with CUDA v5.7.3.

Guia do colaborador