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/ptxinfo.l | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/cuda-sim/ptxinfo.l') diff --git a/src/cuda-sim/ptxinfo.l b/src/cuda-sim/ptxinfo.l index 3a2ab52..bec382b 100644 --- a/src/cuda-sim/ptxinfo.l +++ b/src/cuda-sim/ptxinfo.l @@ -67,9 +67,13 @@ #include "ptxinfo.tab.h" #include -char ptxinfo_linebuf[1024]; +#define LINEBUF_SIZE 1024 +char ptxinfo_linebuf[LINEBUF_SIZE]; unsigned ptxinfo_col = 0; -#define TC ptxinfo_col+=strlen(ptxinfo_text); +#define TC if( (ptxinfo_lineno == 1) && ((ptxinfo_col + strlen(ptxinfo_text)) < LINEBUF_SIZE) ) { \ + strncpy(ptxinfo_linebuf+ptxinfo_col,ptxinfo_text,strlen(ptxinfo_text)); \ + } \ + ptxinfo_col+=strlen(ptxinfo_text); %} %% @@ -85,6 +89,7 @@ unsigned ptxinfo_col = 0; "smem" TC; return SMEM; "cmem" TC; return CMEM; "line" TC; return LINE; +"for" TC; return FOR; [_A-Za-z$%][_0-9A-Za-z$]* TC; ptxinfo_lval.string_value = strdup(yytext); return IDENTIFIER; [-]{0,1}[0-9]+ TC; ptxinfo_lval.int_value = atoi(yytext); return INT_OPERAND; @@ -112,8 +117,9 @@ int ptxinfo_error( const char *s ) int i; g_ptxinfo_error_detected = 1; fflush(stdout); + printf("GPGPU-Sim: ERROR while parsing output of ptxas (used to capture resource usage information)\n"); if( s != NULL ) - printf("ptxas -v %s (%s:%u) Syntax error:\n\n", g_filename, g_ptxinfo_filename, ptxinfo_lineno ); + printf("GPGPU-Sim: %s (%s:%u) Syntax error:\n\n", g_filename, g_ptxinfo_filename, ptxinfo_lineno ); printf(" %s\n", ptxinfo_linebuf ); printf(" "); for( i=0; i < ptxinfo_col-1; i++ ) { -- cgit v1.3