From 946d2c17c8387cd824e674f6d33a3dfe5fe6cbeb Mon Sep 17 00:00:00 2001 From: Evghenii Date: Wed, 19 Feb 2014 11:57:21 +0100 Subject: [PATCH] use time for seed value --- examples_ptx/ptxcc/ptxcc.cpp | 5 +++++ nvptxcc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples_ptx/ptxcc/ptxcc.cpp b/examples_ptx/ptxcc/ptxcc.cpp index 574f27f5..d1c7e500 100644 --- a/examples_ptx/ptxcc/ptxcc.cpp +++ b/examples_ptx/ptxcc/ptxcc.cpp @@ -4,8 +4,10 @@ #include #include #include +#include #include "PTXParser.h" + /* * The C++ code below is based on the following bash-script: #!/bin/sh @@ -42,6 +44,9 @@ static char lRandomAlNum() static std::string lRandomString(const size_t length) { + timeval t1; + gettimeofday(&t1, NULL); + srand(t1.tv_usec * t1.tv_sec); std::string str(length,0); std::generate_n( str.begin(), length, lRandomAlNum); return str; diff --git a/nvptxcc b/nvptxcc index fb0cb444..81d622e9 100755 --- a/nvptxcc +++ b/nvptxcc @@ -9,10 +9,10 @@ then LLVMDIS=$LLVM32/bin/llvm-dis PTXGEN=$ISPC_HOME/examples_ptx/ptxgen/ptxgen $($LLVMDIS $1 -o $1.ll) && $($PTXGEN $1.ll > $1.ptx) && \ - $($PTXCC $1.ptx -o $1.o -G) && \ + $($PTXCC $1.ptx -o $1.o -Xnvcc="-G") && \ $(nvcc test_static_nvptx.cpp examples_ptx/nvcc_helpers.cu examples_ptx/ispc_malloc.cpp $1.o -arch=sm_35 -Iexamples_ptx/ -D_CUDA_ -lcudadevrt $ARGS); else - $($PTXCC $1 -o $1.o -G) && \ + $($PTXCC $1 -o $1.o -Xnvcc="-G") && \ $(nvcc test_static_nvptx.cpp examples_ptx/nvcc_helpers.cu examples_ptx/ispc_malloc.cpp $1.o -arch=sm_35 -Iexamples_ptx/ -D_CUDA_ -lcudadevrt $ARGS); fi