summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-04-16 19:39:54 -0500
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-04-19 15:57:42 -0500
commit13edbafa3bbd85877ce0dd673171e688e88d5b53 (patch)
tree8da47e2489ac39a7111d58847a9ee087e94e7d83
parent1a695c7904ebf71ba53742c320977900f65cd4f4 (diff)
Strengthen arb_shader_image_load_store-shader-mem-barrier test
By transposing the loop and the writer/reader branching, the effective level of parallelism in the test is increased for a typical wave-based architecture. Increasing the window size on top of that helps to reliably expose different implementation errors for AMD GCN. Cc: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
-rw-r--r--tests/spec/arb_shader_image_load_store/shader-mem-barrier.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c b/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c
index 5fdd86b9a..ddf5da61f 100644
--- a/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c
+++ b/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c
@@ -48,7 +48,7 @@
#define W 256
/** Window height. */
-#define H 16
+#define H 64
/** Total number of pixels in the image. */
#define N (W * H)
@@ -142,15 +142,15 @@ run_test(const struct image_test_info *test,
" int x = (idx.x % K) + (idx.x / (2 * K)) * (2 * K);\n"
" int i, n = 1000;\n"
"\n"
- " if (check) {\n"
- " /*\n"
- " * Consumer: Monitor the evolution of a pair of\n"
- " * image locations until the test runs to\n"
- " * completion or an inconsistency is observed.\n"
- " */\n"
- " for (i = 0; i < n; ++i) {\n"
- " uint u, v;\n"
+ " for (i = 0; i < n; ++i) {\n"
+ " uint u, v;\n"
"\n"
+ " if (check) {\n"
+ " /*\n"
+ " * Consumer: Monitor the evolution of a pair of\n"
+ " * image locations until the test runs to\n"
+ " * completion or an inconsistency is observed.\n"
+ " */\n"
" v = imageLoad(img, ivec2(x, idx.y)).x;\n"
" MEMORY_BARRIER();\n"
" u = imageLoad(img, ivec2(x + K, idx.y)).x;\n"
@@ -158,14 +158,12 @@ run_test(const struct image_test_info *test,
" if (u < v)\n"
" /* Fail. */\n"
" return GRID_T(v << 16 | u, 0, 0, 1);\n"
- " }\n"
- " } else {\n"
- " /*\n"
- " * Producer: Update the same pair of image locations\n"
- " * sequentially with increasing values ordering the\n"
- " * stores with a barrier.\n"
- " */\n"
- " for (i = 0; i < n; ++i) {\n"
+ " } else {\n"
+ " /*\n"
+ " * Producer: Update the same pair of image locations\n"
+ " * sequentially with increasing values ordering the\n"
+ " * stores with a barrier.\n"
+ " */\n"
" imageStore(img, ivec2(x + K, idx.y), DATA_T(i));\n"
" MEMORY_BARRIER();\n"
" imageStore(img, ivec2(x, idx.y), DATA_T(i));\n"