From 93a64be21eb3746de0b96a2f2a365f59cd8f1bbc Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Fri, 16 Jul 2010 11:59:09 -0800 Subject: - template runs/passes with CUDA 3.1, but requires that CUDA 2.3 is installed for math intrinsics used in instructions.cc (since CUDA 3.1 does not seem to define __uint2float). - currently cuda-math.h has hardcoded paths to my own install of CUDA 2.3 (need to determine whether we can build simulator with CUDA 2.3 and run CUDA 3.1 / compute_2x PTX, or need to make current setup more portable) - modified ptxinfo.l to print out meaningful error message if error occurs on first line - modified ptxinfo.l,y to understand "for 'compute_NN'" syntax - updated template to 3.1 SDK version - updated cuda_runtime_api.cc to select highest compute capability version when multiple versions are present. - updated template/BlackScholes Makefiles to generate a "DLL build" instead of static linked build (still confusing... requires one to copy config files... probably need to modify config scripts) [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6837] --- src/cuda-sim/cuda-sim.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/cuda-sim/cuda-sim.cc') diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc index d691a64..4480221 100644 --- a/src/cuda-sim/cuda-sim.cc +++ b/src/cuda-sim/cuda-sim.cc @@ -1617,6 +1617,7 @@ static FILE *open_ptxinfo (const char* ptx_filename) struct ptx_info_t { char *str; + char *fname; ptx_info_t *next; }; @@ -1624,11 +1625,12 @@ ptx_info_t *g_ptx_source_array = NULL; unsigned g_used_embedded_ptx_files; extern double g_ptx_version; -void gpgpu_ptx_sim_add_ptxstring( const char *ptx_string ) +void gpgpu_ptx_sim_add_ptxstring( const char *ptx_string, const char *sourcefname ) { ptx_info_t *t = new ptx_info_t; t->next = NULL; t->str = strdup(ptx_string); + t->fname = strdup(sourcefname); // put ptx source into a fifo if (g_ptx_source_array == NULL) { @@ -1732,7 +1734,13 @@ void gpgpu_ptx_sim_load_ptx_from_string( const char *p, unsigned source_num ) char tempfile_ptxinfo[1024]; snprintf(tempfile_ptxinfo,1024,"%sinfo",fname); char commandline[1024]; - snprintf(commandline,1024,"ptxas -v %s --output-file /dev/null 2> %s", fname2, tempfile_ptxinfo); + char extra_flags[1024]; + extra_flags[0]=0; +#if CUDART_VERSION >= 3000 + snprintf(extra_flags,1024,"--gpu-name=sm_20"); +#endif + snprintf(commandline,1024,"ptxas %s -v %s --output-file /dev/null 2> %s", + extra_flags, fname2, tempfile_ptxinfo); printf("GPGPU-Sim PTX: generating ptxinfo using \"%s\"\n", commandline); result = system(commandline); if( result != 0 ) { -- cgit v1.3