From 4581f10207b9c1206d0920dda9e8ef3ec3480b42 Mon Sep 17 00:00:00 2001 From: Evghenii Date: Mon, 20 Jan 2014 13:46:49 +0100 Subject: [PATCH] some changes --- run_tests.py | 4 ++-- tests/cfor-gs-improve-multidim-struct-1.ispc | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/run_tests.py b/run_tests.py index 566b1531..231406da 100755 --- a/run_tests.py +++ b/run_tests.py @@ -271,8 +271,8 @@ def run_test(testname): print "Grepping: %s" % grep_cmd sp = subprocess.Popen(grep_cmd, shell=True) sp.communicate() - ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --emit-asm --target=%s" % \ - (filename4ptx, obj_name, options.arch, options.target) + ispc_cmd = ispc_exe_rel + " --woff %s -o %s --emit-asm --target=%s" % \ + (filename4ptx, obj_name, options.target) # compile the ispc code, make the executable, and run it... (compile_error, run_error) = run_cmds([ispc_cmd, cc_cmd], diff --git a/tests/cfor-gs-improve-multidim-struct-1.ispc b/tests/cfor-gs-improve-multidim-struct-1.ispc index d599ceb9..ad4053dc 100644 --- a/tests/cfor-gs-improve-multidim-struct-1.ispc +++ b/tests/cfor-gs-improve-multidim-struct-1.ispc @@ -4,19 +4,27 @@ export uniform int width() { return programCount; } struct Foo { - uniform float udx[25][25]; + uniform float udx[32][32]; }; export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) { float a = aFOO[programIndex]; +#ifndef __NVPTX__ uniform Foo f[5]; +#else __NVPTX__ /* too much shared memory allocated, nvcc fails to link */ + uniform Foo * uniform f = uniform new uniform Foo[5]; +#define _UNMALLOC +#endif cfor (uniform int i = 0; i < 5; ++i) - cfor (uniform int j = 0; j < 25; ++j) - cfor (uniform int k = 0; k < 25; ++k) + cfor (uniform int j = 0; j < 32; ++j) + cfor (uniform int k = 0; k < 32; ++k) f[i].udx[j][k] = 1000*i+100*j+k; int x = 1; RET[programIndex] = f[x+1].udx[b-4][programIndex]; +#ifdef _UNMALLOC + delete f; +#endif } export void result(uniform float RET[]) { RET[programIndex] = 2100 +programIndex; }