[PATCH] D22701: [test-suite] Bitcode simd tests: align memory to 128.
Alina Sbirlea via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 26 11:07:56 PDT 2016
asbirlea updated this revision to Diff 65560.
asbirlea added a comment.
Add comment.
https://reviews.llvm.org/D22701
Files:
Bitcode/simd_ops/simd_ops.cpp
Index: Bitcode/simd_ops/simd_ops.cpp
===================================================================
--- Bitcode/simd_ops/simd_ops.cpp
+++ Bitcode/simd_ops/simd_ops.cpp
@@ -1,5 +1,11 @@
#include "filter_test_op.h"
+#ifdef _MSC_VER
+#include <errno.h>
+#include <malloc.h>
+#define posix_memalign(p, a, s) (((*(p)) = _aligned_malloc((s), (a))), *(p) ?0 :errno)
+#endif
+
template<typename T>
T rand_value() {
return (T)(rand() * 0.125) - 100;
@@ -10,9 +16,13 @@
printf("%s\n", msg);
}
+// Allocate aligned memory, per recent requirement by the
+// Halide tests updated upstream.
template<typename T>
buffer_t make_buffer(int w, int h) {
- T *mem = new T[w*h];
+ T *mem;
+ int err = posix_memalign((void **)&mem, 128, w*h*sizeof(T));
+
buffer_t buf = {0};
buf.host = (uint8_t *)mem;
buf.extent[0] = w;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22701.65560.patch
Type: text/x-patch
Size: 848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160726/26604f9b/attachment.bin>
More information about the llvm-commits
mailing list