Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉
#3,571 2 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

@christophe-murphy 已經在處理了。

開始於 2024年7月16日。

評估

這個 Issue 還沒有評估資料。

描述

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
主要語言
C++
星號
4.9k
分支
555
平均合併
1 小時 24 分鐘
30 天內合併 PR
1

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

arrayfire/arrayfire 的其他 Issue

查看 arrayfire/arrayfire 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。