some code cleanup

This commit is contained in:
Evghenii
2014-02-20 11:31:48 +01:00
parent 24e1a98275
commit 5ca952bd9a
3 changed files with 23 additions and 21 deletions

View File

@@ -1,19 +0,0 @@
#!/bin/sh
PTXCC=$ISPC_HOME/ptxtools/ptxcc
PTXGEN=$ISPC_HOME/ptxtools/ptxgen
ARGS=${@:2}
if [ "$NVVM" == "1" ];
then
LLVM32=$HOME/usr/local/llvm/bin-3.2
LLVMDIS=$LLVM32/bin/llvm-dis
$($LLVMDIS $1 -o $1.ll) && $($PTXGEN $1.ll -o $1.ptx) && \
$($PTXCC $1.ptx -o $1.o -Xnvcc="-G") && \
$(nvcc test_static_nvptx.cpp examples/nvcc_helpers.cu examples/ispc_malloc.cpp $1.o -arch=sm_35 -Iexamples/ -D_CUDA_ -lcudadevrt $ARGS);
else
$($PTXCC $1 -o $1.o -Xnvcc="-G") && \
$(nvcc test_static_nvptx.cpp examples/nvcc_helpers.cu examples/ispc_malloc.cpp $1.o -arch=sm_35 -Iexamples/ -D_CUDA_ -lcudadevrt $ARGS);
fi

21
ptxtools/runtest_ptxcc.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
PTXCC=$ISPC_HOME/ptxtools/ptxcc
PTXGEN=$ISPC_HOME/ptxtools/ptxgen
ARGS=${@:2}
TMPDIR=/tmp
fbname=`basename $1`
if [ "$NVVM" == "1" ];
then
LLVM32=$HOME/usr/local/llvm/bin-3.2
LLVMDIS=$LLVM32/bin/llvm-dis
$($LLVMDIS $1 -o $TMPDIR/$fbname.ll) && $($PTXGEN $TMPDIR/$fbname.ll -o $TMPDIR/$fbname.ptx) && \
$($PTXCC $TMPDIR/$fbname.ptx -o $TMPDIR/$fbname.o -Xnvcc="-G") && \
$(nvcc test_static_nvptx.cpp examples/nvcc_helpers.cu examples/ispc_malloc.cpp $TMPDIR/$fbname.o -arch=sm_35 -Iexamples/ -D_CUDA_ -lcudadevrt $ARGS);
else
$($PTXCC $1 -o $TMPDIR/$fbname.o -Xnvcc="-G") && \
$(nvcc test_static_nvptx.cpp examples/nvcc_helpers.cu examples/ispc_malloc.cpp $TMPDIR/$fbname.o -arch=sm_35 -Iexamples/ -D_CUDA_ -lcudadevrt $ARGS);
fi

View File

@@ -258,7 +258,7 @@ def run_test(testname):
if should_fail: if should_fail:
cc_cmd += " -DEXPECT_FAILURE" cc_cmd += " -DEXPECT_FAILURE"
if is_nvptx_target: if is_nvptx_target:
nvptxcc_exe = "ptxtools/alloy_ptxcc.sh" nvptxcc_exe = "ptxtools/runtest_ptxcc.sh"
nvptxcc_exe_rel = add_prefix(nvptxcc_exe) nvptxcc_exe_rel = add_prefix(nvptxcc_exe)
cc_cmd = "%s %s -DTEST_SIG=%d -o %s" % \ cc_cmd = "%s %s -DTEST_SIG=%d -o %s" % \
(nvptxcc_exe_rel, obj_name, match, exe_name) (nvptxcc_exe_rel, obj_name, match, exe_name)
@@ -297,7 +297,7 @@ def run_test(testname):
basename = os.path.basename(filename) basename = os.path.basename(filename)
os.unlink("%s.pdb" % basename) os.unlink("%s.pdb" % basename)
os.unlink("%s.ilk" % basename) os.unlink("%s.ilk" % basename)
# os.unlink(obj_name) os.unlink(obj_name)
except: except:
None None