diff options
| -rw-r--r-- | CHANGES | 6 | ||||
| -rw-r--r-- | cuobjdump_to_ptxplus/Makefile | 3 | ||||
| -rw-r--r-- | cuobjdump_to_ptxplus/cuobjdump_to_ptxplus.cc | 6 | ||||
| -rw-r--r-- | libcuda/cuda_runtime_api.cc | 18 | ||||
| -rw-r--r-- | libopencl/opencl_runtime_api.cc | 2 | ||||
| -rw-r--r-- | src/cuda-sim/Makefile | 17 | ||||
| -rw-r--r-- | src/cuda-sim/cuda-sim.cc | 12 | ||||
| -rw-r--r-- | src/cuda-sim/ptx_loader.cc | 10 | ||||
| -rw-r--r-- | src/cuda-sim/ptx_parser.cc | 4 | ||||
| -rw-r--r-- | src/cuda-sim/ptx_parser.h | 4 | ||||
| -rw-r--r-- | src/option_parser.h | 8 |
11 files changed, 37 insertions, 53 deletions
@@ -23,7 +23,11 @@ Version 3.2.1+edits (development branch) versus 3.2.1 warning message display - Removed a spamming print at kernel finish that dumped a warp issuing histogram. - - Fixing OpenCL functional simulation. Now the functional simulation routine is called instead of mistakenly printing that the functional simulation is not implemented. + - Fixing OpenCL functional simulation. Now the functional simulation routine + is called instead of mistakenly printing that the functional simulation + is not implemented. + - Removed the use of gcc in compilation and the need for a bunch of unnecessary + 'extern "c"' statements. Version 3.2.1 versus 3.2.0 - Added kernel name and launch uids to performance statistics log. - Added l2_cache_config class to extend baseline cache_config. Allows for diff --git a/cuobjdump_to_ptxplus/Makefile b/cuobjdump_to_ptxplus/Makefile index 62ef492..14fcc68 100644 --- a/cuobjdump_to_ptxplus/Makefile +++ b/cuobjdump_to_ptxplus/Makefile @@ -2,7 +2,6 @@ LEX = flex LEXFLAGS = -B YACC = bison YFLAGS = -t -d --report=all --verbose -CC = gcc CCFLAGS = -ggdb -fPIC -Wall -Wno-unused-function -Wno-sign-compare CXX = g++ CXXFLAGS = ${CCFLAGS} @@ -61,7 +60,7 @@ $(OUTPUT_DIR)/%.o: %.cpp %.h $(CXX) ${CXXFLAGS} -c -o $@ $< $(OUTPUT_DIR)/%.o: %.c %.h - ${CC} ${CCFLAGS} -c -o $@ $< + ${CXX} ${CCFLAGS} -c -o $@ $< SRCS = $(shell ls *.cc) diff --git a/cuobjdump_to_ptxplus/cuobjdump_to_ptxplus.cc b/cuobjdump_to_ptxplus/cuobjdump_to_ptxplus.cc index af8babe..82dcb7c 100644 --- a/cuobjdump_to_ptxplus/cuobjdump_to_ptxplus.cc +++ b/cuobjdump_to_ptxplus/cuobjdump_to_ptxplus.cc @@ -38,13 +38,13 @@ cuobjdumpInstList *g_instList = new cuobjdumpInstList(); cuobjdumpInstList *g_headerList = new cuobjdumpInstList(); int sass_parse(); -extern "C" FILE *sass_in; +extern FILE *sass_in; int ptx_parse(); -extern "C" FILE *ptx_in; +extern FILE *ptx_in; int elf_parse(); -extern "C" FILE *elf_in; +extern FILE *elf_in; extern int g_error_detected; diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc index ef30748..72ade49 100644 --- a/libcuda/cuda_runtime_api.cc +++ b/libcuda/cuda_runtime_api.cc @@ -344,7 +344,7 @@ static CUctx_st* GPGPUSim_Context() return the_context; } -extern "C" void ptxinfo_addinfo() + void ptxinfo_addinfo() { if( !strcmp("__cuda_dummy_entry__",get_ptxinfo_kname()) ) { // this string produced by ptxas for empty ptx files (e.g., bandwidth test) @@ -1249,8 +1249,8 @@ void setCuobjdumpsassfilename(const char* filename){ } (dynamic_cast<cuobjdumpELFSection*>(cuobjdumpSectionList.front()))->setSASSfilename(filename); } -extern "C" int cuobjdump_parse(); -extern "C" FILE *cuobjdump_in; +extern int cuobjdump_parse(); +extern FILE *cuobjdump_in; //! Return the executable file of the process containing the PTX/SASS code //! @@ -2020,13 +2020,13 @@ int CUDARTAPI __cudaSynchronizeThreads(void**, void*) //////// -extern "C" int ptx_parse(); -extern "C" int ptx__scan_string(const char*); -extern "C" FILE *ptx_in; +extern int ptx_parse(); +extern int ptx__scan_string(const char*); +extern FILE *ptx_in; -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 functions diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc index 07cab56..bb350bd 100644 --- a/libopencl/opencl_runtime_api.cc +++ b/libopencl/opencl_runtime_api.cc @@ -415,7 +415,7 @@ void register_ptx_function( const char *name, function_info *impl ) sg_info->m_kernels[name] = impl; } -extern "C" void ptxinfo_addinfo() + void ptxinfo_addinfo() { ptxinfo_opencl_addinfo( sg_info->m_kernels ); } 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 - |
