summaryrefslogtreecommitdiff
path: root/libopencl
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-08-10 18:04:54 -0800
committerTor Aamodt <[email protected]>2010-08-10 18:04:54 -0800
commitb621489268b00e816eb18e72be53f9a049787ffb (patch)
tree7acb45634570179f27caaed9ae8243868c72c549 /libopencl
parent6eb2c84753d4538ef6ee6ee27802bff9adbbefab (diff)
refactor: mostly finished getting rid of extern decl
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7183]
Diffstat (limited to 'libopencl')
-rw-r--r--libopencl/Makefile5
-rw-r--r--libopencl/opencl_runtime_api.cc23
2 files changed, 8 insertions, 20 deletions
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<b)?(a):(b))
size_t _cl_kernel::get_workgroup_size()
@@ -439,8 +426,6 @@ _cl_program::_cl_program( cl_context context,
}
}
-extern const char *g_filename;
-
static pgm_info *sg_info;
void register_ptx_function( const char *name, function_info *impl )
@@ -1034,8 +1019,6 @@ clGetDeviceIDs(cl_platform_id platform,
return CL_SUCCESS;
}
-extern double core_freq;
-
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceInfo(cl_device_id device,
cl_device_info param_name,