diff options
| author | Tor Aamodt <[email protected]> | 2010-07-16 11:59:09 -0800 |
|---|---|---|
| committer | Tor Aamodt <[email protected]> | 2010-07-16 11:59:09 -0800 |
| commit | 93a64be21eb3746de0b96a2f2a365f59cd8f1bbc (patch) | |
| tree | 15a83e210cebc1a90a6afc55d8ce6576689c3494 /src/cuda-sim/ptxinfo.l | |
| parent | 043791634414119a1708390b442ae201fe0d930c (diff) | |
- 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]
Diffstat (limited to 'src/cuda-sim/ptxinfo.l')
| -rw-r--r-- | src/cuda-sim/ptxinfo.l | 12 |
1 files changed, 9 insertions, 3 deletions
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 <string.h> -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++ ) { |
