diff --git a/ptxtestcc.sh b/ptxtestcc.sh index fee3d856..ad621b22 100755 --- a/ptxtestcc.sh +++ b/ptxtestcc.sh @@ -2,9 +2,9 @@ LLC=$HOME/usr/local/llvm/bin-trunk/bin/llc ISPC=ispc PTXCC=ptxcc -$(cat $1 |grep -v 'width'|$ISPC --target=nvptx --emit-llvm -o -|$LLC -march=nvptx64 -mcpu=sm_35 -o $1.ptx) -$($PTXCC $1.ptx -Xptxas=-v -o $1.ptx.o) -nvcc -o test_nvptx test_static_nvptx.cpp examples_ptx/nvcc_helpers.cu $1.ptx.o -arch=sm_35 -Iexamples_ptx/ -D_CUDA_ -lcudadevrt -DTEST_SIG=$2 +$(cat $1 |grep -v 'width'|$ISPC --target=nvptx --emit-llvm -o -|$LLC -march=nvptx64 -mcpu=sm_35 -o $1.ptx) && \ +$($PTXCC $1.ptx -Xptxas=-v -o $1.ptx.o) && \ +nvcc -o test_nvptx test_static_nvptx.cpp examples_ptx/nvcc_helpers.cu examples_ptx/ispc_malloc.cpp $1.ptx.o -arch=sm_35 -Iexamples_ptx/ -D_CUDA_ -lcudadevrt -DTEST_SIG=$2 diff --git a/test_static_nvptx.cpp b/test_static_nvptx.cpp index fb23413f..057d1616 100644 --- a/test_static_nvptx.cpp +++ b/test_static_nvptx.cpp @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) { #error "Unknown or unset TEST_SIG value" #endif - float expected_result[64]; + float *expected_result = new float[64]; memset(expected_result, 0, 64*sizeof(float)); result(expected_result);