Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
[ocl/particlefilter] measure the time of single and double filters
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhc committed Sep 9, 2017
1 parent b80bdaf commit d647b9b
Show file tree
Hide file tree
Showing 6 changed files with 353 additions and 110 deletions.
43 changes: 31 additions & 12 deletions opencl/particlefilter/Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,54 @@
include ../../common/make.config
#OPENCL_DIR = /af21/den4gr/NVIDIA_GPU_Computing_SDK/

#Can be changed by `make TYPE=CPU`
TYPE = GPU

#Library
ifeq ($(TYPE),GPU)
OPENCL_INC = $(NV_OPENCL_INC)
OPENCL_LIB = $(NV_OPENCL_LIB)
else
OPENCL_INC = $(INTEL_OPENCL_INC)
OPENCL_LIB = $(INTEL_OPENCL_LIB)
endif

# C compiler
CC = g++
CC_FLAGS = -O2
#INCLUDES = -I$(OPENCL_DIR)/OpenCL/common/inc -I$(OPENCL_DIR)/shared/inc/
INCLUDES = -I$(OPENCL_INC)
INCLUDES = -I$(OPENCL_INC) -I../util

ALL: OCL_particlefilter_naive OCL_particlefilter_double OCL_particlefilter_single

OCL_particlefilter_naive: ex_particle_OCL_naive_seq.o
$(CC) $(CC_FLAGS) ex_particle_OCL_naive_seq.o $(INCLUDES) -L$(OPENCL_LIB) -lOpenCL -o OCL_particlefilter_naive
$(CC) $(CC_FLAGS) ex_particle_OCL_naive_seq.o \
$(INCLUDES) -L$(OPENCL_LIB) -lOpenCL \
-o OCL_particlefilter_naive.out

OCL_particlefilter_double: ex_particle_OCL_double_seq.o
$(CC) $(CC_FLAGS) ex_particle_OCL_double_seq.o $(INCLUDES) -L$(OPENCL_LIB) -lOpenCL -o OCL_particlefilter_double
OCL_particlefilter_double: ex_particle_OCL_double_seq.o timing.o
$(CC) $(CC_FLAGS) ex_particle_OCL_double_seq.o timing.o \
$(INCLUDES) -L$(OPENCL_LIB) -lOpenCL \
-o OCL_particlefilter_double.out

OCL_particlefilter_single: ex_particle_OCL_single_seq.o
$(CC) $(CC_FLAGS) ex_particle_OCL_single_seq.o $(INCLUDES) -L$(OPENCL_LIB) -lOpenCL -o OCL_particlefilter_single
OCL_particlefilter_single: ex_particle_OCL_single_seq.o timing.o
$(CC) $(CC_FLAGS) ex_particle_OCL_single_seq.o timing.o \
$(INCLUDES) -L$(OPENCL_LIB) -lOpenCL \
-o OCL_particlefilter_single.out


%.o: %.[ch]
$(CC) $(CC_FLAGS) $< -c

timing.o: ../util/timing.c
$(CC) $(CC_FLAGS) -I../util ../util/timing.c -c

ex_particle_OCL_naive_seq.o: ex_particle_OCL_naive_seq.cpp
$(CC) $(CC_FLAGS) $(INCLUDES) ex_particle_OCL_naive_seq.cpp -c
$(CC) $(CC_FLAGS) $(INCLUDES) ex_particle_OCL_naive_seq.cpp -c -Wno-unused-result

ex_particle_OCL_double_seq.o: ex_particle_OCL_double_seq.cpp
$(CC) $(CC_FLAGS) $(INCLUDES) ex_particle_OCL_double_seq.cpp -c
$(CC) $(CC_FLAGS) $(INCLUDES) ex_particle_OCL_double_seq.cpp -DTIMING -c -Wno-unused-result

ex_particle_OCL_single_seq.o: ex_particle_OCL_single_seq.cpp
$(CC) $(CC_FLAGS) $(INCLUDES) ex_particle_OCL_single_seq.cpp -c
$(CC) $(CC_FLAGS) $(INCLUDES) ex_particle_OCL_single_seq.cpp -DTIMING -c -Wno-unused-result

clean:
rm -f *.o *~ OCL_particlefilter_naive OCL_particlefilter_double OCL_particlefilter_single *.linkinfo
rm -f *.o *~ OCL_particlefilter_*.out *.linkinfo
Loading

0 comments on commit d647b9b

Please sign in to comment.