From d3aed53240751bc3aae961b6f89b443f602fff64 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 27 Feb 2015 09:02:12 +0100 Subject: [PATCH] testsuite: Put a limit to the memcpy test Some systems have massive L3 cache that can exceed 64MB, which would result in attempting to read/write about our allocated memory. If we can deal with 64MB... there's a good chance we can handle above. --- testsuite/memcpy_speed.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/testsuite/memcpy_speed.c b/testsuite/memcpy_speed.c index 75df851..a1a69f1 100644 --- a/testsuite/memcpy_speed.c +++ b/testsuite/memcpy_speed.c @@ -12,6 +12,8 @@ #define ALIGN(ptr,n) ((void *)((orc_intptr)(ptr + n) & (~(orc_intptr)(n-1)))) +/* Limit amount of memory to check. Some systems can do above 64MB */ +#define MAX_SIZE_TO_CHECK 1024*1024*64+1024 int hot_src = TRUE; int hot_dest = TRUE; @@ -56,8 +58,8 @@ main(int argc, char *argv[]) unalign = 0; } - s = malloc(1024*1024*64+1024); - d = malloc(1024*1024*64+1024); + s = malloc(MAX_SIZE_TO_CHECK); + d = malloc(MAX_SIZE_TO_CHECK); src = ORC_PTR_OFFSET(ALIGN(s,128),unalign); dest = ALIGN(d,128); @@ -104,6 +106,11 @@ main(int argc, char *argv[]) double x = i*0.1 + 6.0; int size = pow(2.0, x); + if (size > MAX_SIZE_TO_CHECK) { + printf ("Stopping test, exceeding maximum size to check (%d, could do above %d)\n", + MAX_SIZE_TO_CHECK, size); + break; + } if (flush_cache) { touch (src, (1<<18)); } -- 2.7.4