summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Rogers <[email protected]>2013-04-23 20:33:07 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:47 -0700
commit461575e7388064dbc06eed3e17b094655f046b6c (patch)
tree58b93b9fd53143d3033f3c599b14ad821af22e19 /src
parentcd7a97f045cb9bf33fcb9b8bb7b9d1e3ff5caca2 (diff)
Removing a slew of code still compiled with gcc and the need for a bunch of external C linkage
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15912]
Diffstat (limited to 'src')
-rw-r--r--src/cuda-sim/Makefile17
-rw-r--r--src/cuda-sim/cuda-sim.cc12
-rw-r--r--src/cuda-sim/ptx_loader.cc10
-rw-r--r--src/cuda-sim/ptx_parser.cc4
-rw-r--r--src/cuda-sim/ptx_parser.h4
-rw-r--r--src/option_parser.h8
6 files changed, 18 insertions, 37 deletions
diff --git a/src/cuda-sim/Makefile b/src/cuda-sim/Makefile
index 9e37fe7..8d33e19 100644
--- a/src/cuda-sim/Makefile
+++ b/src/cuda-sim/Makefile
@@ -33,7 +33,6 @@ DEBUG?=0
TRACE?=0
CPP = g++ $(SNOW)
-CC = gcc $(SNOW)
ifeq ($(INTEL),1)
CPP = icpc
CC = icc
@@ -80,16 +79,16 @@ libgpgpu_ptx_sim.a: $(OBJS)
ar rcs $(OUTPUT_DIR)/libgpgpu_ptx_sim.a $(OUTPUT_DIR)/ptx.tab.o $(OUTPUT_DIR)/lex.ptx_.o $(OUTPUT_DIR)/ptxinfo.tab.o $(OUTPUT_DIR)/lex.ptxinfo_.o $(OBJS)
$(OUTPUT_DIR)/ptx.tab.o: ptx.tab.c
- $(CC) -c $(OPT) -DYYDEBUG ptx.tab.c -o $(OUTPUT_DIR)/ptx.tab.o
+ $(CPP) -c $(OPT) -DYYDEBUG ptx.tab.c -o $(OUTPUT_DIR)/ptx.tab.o
$(OUTPUT_DIR)/lex.ptx_.o: lex.ptx_.c
- $(CC) -c $(OPT) lex.ptx_.c -o $(OUTPUT_DIR)/lex.ptx_.o
+ $(CPP) -c $(OPT) lex.ptx_.c -o $(OUTPUT_DIR)/lex.ptx_.o
$(OUTPUT_DIR)/ptxinfo.tab.o: ptxinfo.tab.c
- $(CC) -c $(OPT) -DYYDEBUG ptxinfo.tab.c -o $(OUTPUT_DIR)/ptxinfo.tab.o
+ $(CPP) -c $(OPT) -DYYDEBUG ptxinfo.tab.c -o $(OUTPUT_DIR)/ptxinfo.tab.o
$(OUTPUT_DIR)/lex.ptxinfo_.o: lex.ptxinfo_.c
- $(CC) -c $(OPT) lex.ptxinfo_.c -o $(OUTPUT_DIR)/lex.ptxinfo_.o
+ $(CPP) -c $(OPT) lex.ptxinfo_.c -o $(OUTPUT_DIR)/lex.ptxinfo_.o
ptx.tab.c: ptx.y
bison --name-prefix=ptx_ -v -d ptx.y
@@ -112,7 +111,7 @@ clean:
rm -f Makefile.makedepend Makefile.makedepend.bak
$(OUTPUT_DIR)/%.o: %.c
- $(CC) -c $(OPT) $< -o $(OUTPUT_DIR)/$*.o
+ $(CPP) -c $(OPT) $< -o $(OUTPUT_DIR)/$*.o
$(OUTPUT_DIR)/%.o: %.cc
$(CPP) -c $(CXX_OPT) $< -o $(OUTPUT_DIR)/$*.o
@@ -123,13 +122,7 @@ instructions.h: instructions.cc
@echo "#include \"ptx_ir.h\"" >> $*.h
@echo "#ifndef instructions_h_included" >> $*.h
@echo "#define instructions_h_included" >> $*.h
- @echo "#ifdef __cplusplus" >> $*.h
- @echo "extern \"C\" {" >> $*.h
- @echo "#endif" >> $*.h
@cat $< | grep "_impl(" | sed 's/{.*//' | sed 's/$$/;/' >> $*.h
- @echo "#ifdef __cplusplus" >> $*.h
- @echo "}" >> $*.h
- @echo "#endif" >> $*.h
@echo "#endif" >> $*.h
@chmod -w $*.h
@echo "created instructions.h"
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index cba5262..5c66c7a 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -1623,7 +1623,7 @@ void gpgpu_ptx_sim_memcpy_symbol(const char *hostVar, const void *src, size_t co
int g_ptx_sim_mode; // if non-zero run functional simulation only (i.e., no notion of a clock cycle)
-extern "C" int ptx_debug;
+extern int ptx_debug;
bool g_cuda_launch_blocking = false;
@@ -1853,28 +1853,28 @@ struct gpgpu_ptx_sim_kernel_info get_ptxinfo_kinfo()
return g_ptxinfo_kinfo;
}
-extern "C" void ptxinfo_function(const char *fname )
+void ptxinfo_function(const char *fname )
{
clear_ptxinfo();
g_ptxinfo_kname = strdup(fname);
}
-extern "C" void ptxinfo_regs( unsigned nregs )
+void ptxinfo_regs( unsigned nregs )
{
g_ptxinfo_kinfo.regs=nregs;
}
-extern "C" void ptxinfo_lmem( unsigned declared, unsigned system )
+void ptxinfo_lmem( unsigned declared, unsigned system )
{
g_ptxinfo_kinfo.lmem=declared+system;
}
-extern "C" void ptxinfo_smem( unsigned declared, unsigned system )
+void ptxinfo_smem( unsigned declared, unsigned system )
{
g_ptxinfo_kinfo.smem=declared+system;
}
-extern "C" void ptxinfo_cmem( unsigned nbytes, unsigned bank )
+void ptxinfo_cmem( unsigned nbytes, unsigned bank )
{
g_ptxinfo_kinfo.cmem+=nbytes;
}
diff --git a/src/cuda-sim/ptx_loader.cc b/src/cuda-sim/ptx_loader.cc
index 56b9449..4ed57da 100644
--- a/src/cuda-sim/ptx_loader.cc
+++ b/src/cuda-sim/ptx_loader.cc
@@ -43,13 +43,13 @@ bool g_override_embedded_ptx = false;
/// extern prototypes
-extern "C" int ptx_parse();
-extern "C" int ptx__scan_string(const char*);
+extern int ptx_parse();
+extern int ptx__scan_string(const char*);
const char *g_ptxinfo_filename;
-extern "C" int ptxinfo_parse();
-extern "C" int ptxinfo_debug;
-extern "C" FILE *ptxinfo_in;
+extern int ptxinfo_parse();
+extern int ptxinfo_debug;
+extern FILE *ptxinfo_in;
static bool g_save_embedded_ptx;
bool g_keep_intermediate_files;
diff --git a/src/cuda-sim/ptx_parser.cc b/src/cuda-sim/ptx_parser.cc
index a02832d..6e02a54 100644
--- a/src/cuda-sim/ptx_parser.cc
+++ b/src/cuda-sim/ptx_parser.cc
@@ -30,7 +30,7 @@
#include "ptx.tab.h"
#include <stdarg.h>
-extern "C" int ptx_error( const char *s );
+extern int ptx_error( const char *s );
extern int ptx_lineno;
static const struct core_config *g_shader_core_config;
@@ -240,7 +240,7 @@ void parse_assert_impl( int test_value, const char *file, unsigned line, const c
parse_error_impl(file,line, msg);
}
-extern "C" char linebuf[1024];
+extern char linebuf[1024];
void set_return()
diff --git a/src/cuda-sim/ptx_parser.h b/src/cuda-sim/ptx_parser.h
index 7405dd3..fef7635 100644
--- a/src/cuda-sim/ptx_parser.h
+++ b/src/cuda-sim/ptx_parser.h
@@ -35,7 +35,6 @@ extern int g_error_detected;
#ifdef __cplusplus
class symbol_table* init_parser(const char*);
const class ptx_instruction *ptx_instruction_lookup( const char *filename, unsigned linenumber );
-extern "C" {
#endif
const char *decode_token( int type );
@@ -94,9 +93,6 @@ void change_double_operand_type( int addr_type );
void change_operand_neg( );
void set_immediate_operand_type( );
void version_header(double a);
-#ifdef __cplusplus
-}
-#endif
#define NON_ARRAY_IDENTIFIER 1
#define ARRAY_IDENTIFIER_NO_DIM 2
diff --git a/src/option_parser.h b/src/option_parser.h
index b29bda8..1f7f96c 100644
--- a/src/option_parser.h
+++ b/src/option_parser.h
@@ -47,10 +47,6 @@ enum option_dtype {
OPT_CSTR
};
-#ifdef __cplusplus
-extern "C" {
-#endif
-
// create and destroy option parser
option_parser_t option_parser_create();
void option_parser_destroy(option_parser_t opp);
@@ -81,7 +77,3 @@ void option_parser_delimited_string(option_parser_t opp,
void option_parser_print(option_parser_t opp,
FILE *fout);
-#ifdef __cplusplus
-};
-#endif
-