From b621489268b00e816eb18e72be53f9a049787ffb Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Tue, 10 Aug 2010 18:04:54 -0800 Subject: refactor: mostly finished getting rid of extern decl [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7183] --- libopencl/Makefile | 5 +++++ libopencl/opencl_runtime_api.cc | 23 +++-------------------- 2 files changed, 8 insertions(+), 20 deletions(-) (limited to 'libopencl') diff --git a/libopencl/Makefile b/libopencl/Makefile index d4c3c69..1352764 100644 --- a/libopencl/Makefile +++ b/libopencl/Makefile @@ -74,6 +74,11 @@ CCFLAGS = -O3 -g -Wall -fPIC $(GL) ifeq ($(DEBUG),1) CCFLAGS = -Wall -g -fPIC $(GL) endif +GNUC_CPP0X := $(shell gcc --version | perl -ne 'if (/gcc\s+\(.*\)\s+([0-9.]+)/){ if($$1 >= 4.3) {$$n=1} else {$$n=0;} } END { print $$n; }') +ifeq ($(GNUC_CPP0X), 1) + CCFLAGS += -std=c++0x +endif + PROG =opencl diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc index 92eb136..b886f90 100644 --- a/libopencl/opencl_runtime_api.cc +++ b/libopencl/opencl_runtime_api.cc @@ -77,23 +77,16 @@ #include "__cudaFatFormat.h" #include "../src/abstract_hardware_model.h" #include "../src/cuda-sim/cuda-sim.h" -#include "../src/gpgpusim_entrypoint.h" #include "../src/cuda-sim/ptx_loader.h" +#include "../src/cuda-sim/ptx_ir.h" +#include "../src/gpgpusim_entrypoint.h" #include "../src/gpgpu-sim/gpu-sim.h" - -struct gpgpu_ptx_sim_arg { - const void *m_start; - size_t m_nbytes; - size_t m_offset; - struct gpgpu_ptx_sim_arg *m_next; -}; +#include "../src/gpgpu-sim/shader.h" static struct cudaDeviceProp the_cuda_device; static struct cudaDeviceProp **gpgpu_cuda_devices; static int g_gpgpusim_init = 0; -extern const char *g_gpgpusim_version_string; - #define GPGPUSIM_INIT \ if( gpgpu_cuda_devices == NULL ) { \ snprintf(the_cuda_device.name,256,"GPGPU-Sim_v%s", g_gpgpusim_version_string );\ @@ -317,12 +310,6 @@ cl_int _cl_kernel::bind_args( struct gpgpu_ptx_sim_arg **arg_list ) return CL_SUCCESS; } - -unsigned ptx_kernel_shmem_size( void *kernel_impl ); -unsigned ptx_kernel_nregs( void *kernel_impl ); -extern unsigned int gpgpu_shmem_size; -extern unsigned int gpgpu_shader_registers; - #define min(a,b) ((a