File: 992673_gemv_workaround.patch

package info (click to toggle)
libgpuarray 0.7.6-13
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,176 kB
  • sloc: ansic: 19,235; python: 4,591; makefile: 208; javascript: 71; sh: 15
file content (24 lines) | stat: -rw-r--r-- 808 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: 0*NaN is not 0

clblas gemv skips the +beta*Y if beta is 0, but clblast gemv doesn't.
This matters if Y initially contains NaNs, which is likely if it is
uninitialized.

(My reading of the spec is that this is a bug in clblast, but I'm
not certain of that.)

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/992673
Forwarded: no

--- a/pygpu/blas.pyx
+++ b/pygpu/blas.pyx
@@ -100,7 +100,7 @@ def gemv(double alpha, GpuArray A, GpuAr
     if Y is None:
         if beta != 0.0:
             raise ValueError("Y not provided and beta != 0")
-        Y = pygpu_empty(1, &Yshp, A.ga.typecode, GA_ANY_ORDER, A.context, None)
+        Y = pygpu_zeros(1, &Yshp, A.ga.typecode, GA_ANY_ORDER, A.context, None)
         overwrite_y = True
 
     if not overwrite_y: