1 2OPENCL_STD := -cl-std=CL1.2 3OPENCL_PRE := __OPENCL_C_VERSION__=120 4 5IOC_IR_OPTS_OPT := $(OPENCL_STD) -cl-single-precision-constant -cl-denorms-are-zero \ 6 -cl-mad-enable -cl-no-signed-zeros -cl-fast-relaxed-math -cl-kernel-arg-info 7 8TARGETS := hs_kernels.src.xxd hs_kernels.src.len.xxd hs_kernels.bin.xxd hs_kernels.bin.len.xxd hs_target.bin 9 10all: $(TARGETS) 11 12clean: 13 rm $(TARGETS) hs_kernels.pre.cl hs_kernels.bin 14 15hs_target.bin: hs_kernels.bin 16 gcc -D HS_DUMP -x c hs_target.h -o hs_dump 17 hs_dump 18 19hs_kernels.bin.len.xxd: hs_kernels.bin 20 $(shell bytes=$$(wc -c < $<); printf "%.8x" $$bytes | xxd -r -p | xxd -i 1> $@) 21 22hs_kernels.bin.xxd: hs_kernels.bin 23 $(shell xxd -i < $< 1> $@) 24 25hs_kernels.bin: hs_kernels.pre.cl 26 ioc64 -cmd=build -bo="$(IOC_IR_OPTS_OPT)" -device=gpu -input=$< -ir=$@ 27 28hs_kernels.src.len.xxd: hs_kernels.pre.cl 29 $(shell bytes=$$(wc -c < $<); printf "%.8x" $$bytes | xxd -r -p | xxd -i 1> $@) 30 31hs_kernels.src.xxd: hs_kernels.pre.cl 32 $(shell xxd -i < $< 1> $@) 33 34hs_kernels.pre.cl: hs_kernels.cl 35 gcc -x c -E -P -I . -D $(OPENCL_PRE) $< -o $@ 36