Am 12.05.2017 um 10:16 schrieb Janne Blomqvist:
On Fri, May 12, 2017 at 1:14 AM, Thomas Koenig wrote:
Hello world,
the memory allocation for the buffer in the library matmul
routines still has one problem: The value of 0xdeadbeef meant
as poison could end up in the calculation of the size of the
buffer for the blocked matmul.
The attached patch fixes that. Verified with regression-test,
also by running a few select test cases under valgrind.
No test case because nothing appeared to fail.
OK for trunk?
Patch missing?
Well, yes.
Here it is.
Regards
Thomas
Index: generated/matmul_c10.c
===
--- generated/matmul_c10.c (Revision 247839)
+++ generated/matmul_c10.c (Arbeitskopie)
@@ -222,9 +222,9 @@ matmul_c10_avx (gfc_array_c10 * const restrict ret
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -774,9 +774,9 @@ matmul_c10_avx2 (gfc_array_c10 * const restrict re
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -1326,9 +1326,9 @@ matmul_c10_avx512f (gfc_array_c10 * const restrict
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -1874,9 +1874,9 @@ matmul_c10_vanilla (gfc_array_c10 * const restrict
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -2480,9 +2480,9 @@ matmul_c10 (gfc_array_c10 * const restrict retarra
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
Index: generated/matmul_c16.c
===
--- generated/matmul_c16.c (Revision 247839)
+++ generated/matmul_c16.c (Arbeitskopie)
@@ -222,9 +222,9 @@ matmul_c16_avx (gfc_array_c16 * const restrict ret
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -774,9 +774,9 @@ matmul_c16_avx2 (gfc_array_c16 * const restrict re
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -1326,9 +1326,9 @@ matmul_c16_avx512f (gfc_array_c16 * const restrict
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -1874,9 +1874,9 @@ matmul_c16_vanilla (gfc_array_c16 * const restrict
bxstride = GFC_DESCRIPTOR_STRIDE(b,0);
/* bystride should never be used for 1-dimensional b.
- in case it is we want it to cause a segfault, rather than
- an incorrect result. */
- bystride = 0xDEADBEEF;
+ The value is only used for calculation of the
+ memory by the buffer. */
+ bystride = 256;
ycount = 1;
}
else
@@ -2480,9 +