Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Norm doesn't work with more than 2^32/2 elements

Aperta
#3,571 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@christophe-murphy ci sta già lavorando.

Dal 16/7/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug

If one-dimensional array has more than 2^32/2 elements, norm doesn't work. For OpenCL, computing the norm leads to a crash while CPU just gives 0. Haven't been able to try CUDA backend. CPU backend though seems to give wrong results even for the working one.

Description

  • Norm fails when computed with more than 2 147 483 648 elements
  • CPU and OpenCL backends at least
  • Official AF installer on Windows 10

Reproducible Code and/or Steps

#include <arrayfire.h>

using namespace af;

int main(int argc, char* argv[]) {
    // Works
    array vec1 = constant(1.f, 2107483648);
    const double norm1 = af::norm(vec1);
    printf("%f\n", norm1);
    // Doesn't work
    array vec2 = constant(1.f, 4294867296);
    const double norm2 = af::norm(vec2);
    printf("%f\n", norm2);

    return 0;
}

System Information

ArrayFire v3.9.0 (OpenCL, 64-bit Windows, build b59a1ae53)
     [0] AMD: gfx1036, 24568 MB
     -1- AMD: gfx1100, 20464 MB
     -2- INTEL: AMD Ryzen 5 7600X 6-Core Processor             , 64662 MB
     -3- INTEL: AMD Ryzen 5 7600X 6-Core Processor             , 64662 MB

Checklist

  • Using the latest available ArrayFire release
  • GPU drivers are up to date
Lingua principale
C++
Stelle
4.9k
Fork
555
Merge medio
1h 24m
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di arrayfire/arrayfire

Tutte le issue di arrayfire/arrayfire

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.