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 +#include +#define posix_memalign(p, a, s) (((*(p)) = _aligned_malloc((s), (a))), *(p) ?0 :errno) +#endif + template 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 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;