File: gemmBatch.patch

package info (click to toggle)
libgpuarray 0.7.6-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,784 kB
  • sloc: ansic: 19,235; python: 4,621; makefile: 213; sh: 9
file content (26 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Fix stack smashing crash in *gemmBatch

Calling ARRAY_INIT more than 3 times without resetting num_ev
runs off the end of evl.

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: https://github.com/Theano/libgpuarray/pull/584

--- libgpuarray-0.7.6.orig/src/gpuarray_blas_opencl_clblas.c
+++ libgpuarray-0.7.6/src/gpuarray_blas_opencl_clblas.c
@@ -132,6 +132,7 @@ static int sgemmBatch(cb_order order, cb
   cl_uint num_ev = 0;
 
   for (i = 0; i < batchCount; i++) {
+    num_ev = 0;
     ARRAY_INIT(A[i]);
     ARRAY_INIT(B[i]);
     ARRAY_INIT(C[i]);
@@ -163,6 +164,7 @@ static int dgemmBatch(cb_order order, cb
   cl_uint num_ev = 0;
 
   for (i = 0; i < batchCount; i++) {
+    num_ev = 0;
     ARRAY_INIT(A[i]);
     ARRAY_INIT(B[i]);
     ARRAY_INIT(C[i]);