annotate constant-q-cpp/src/ext/kissfft/test/Makefile @ 372:af71cbdab621 tip

Update bqvec code
author Chris Cannam
date Tue, 19 Nov 2019 10:13:32 +0000
parents 5d0a2ebb4d17
children
rev   line source
Chris@366 1
Chris@366 2 WARNINGS=-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return \
Chris@366 3 -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast \
Chris@366 4 -Wwrite-strings
Chris@366 5
Chris@366 6 CFLAGS=-O3 -I.. -I../tools $(WARNINGS)
Chris@366 7 CFLAGS+=-ffast-math -fomit-frame-pointer
Chris@366 8 #CFLAGS+=-funroll-loops
Chris@366 9 #CFLAGS+=-march=prescott
Chris@366 10 #CFLAGS+= -mtune=native
Chris@366 11 # TIP: try adding -openmp or -fopenmp to enable OPENMP directives and use of multiple cores
Chris@366 12 #CFLAGS+=-fopenmp
Chris@366 13 CFLAGS+= $(CFLAGADD)
Chris@366 14
Chris@366 15
Chris@366 16 ifeq "$(NFFT)" ""
Chris@366 17 NFFT=1800
Chris@366 18 endif
Chris@366 19 ifeq "$(NUMFFTS)" ""
Chris@366 20 NUMFFTS=10000
Chris@366 21 endif
Chris@366 22
Chris@366 23 ifeq "$(DATATYPE)" ""
Chris@366 24 DATATYPE=float
Chris@366 25 endif
Chris@366 26
Chris@366 27 BENCHKISS=bm_kiss_$(DATATYPE)
Chris@366 28 BENCHFFTW=bm_fftw_$(DATATYPE)
Chris@366 29 SELFTEST=st_$(DATATYPE)
Chris@366 30 TESTREAL=tr_$(DATATYPE)
Chris@366 31 TESTKFC=tkfc_$(DATATYPE)
Chris@366 32 FASTFILTREAL=ffr_$(DATATYPE)
Chris@366 33 SELFTESTSRC=twotonetest.c
Chris@366 34
Chris@366 35
Chris@366 36 TYPEFLAGS=-Dkiss_fft_scalar=$(DATATYPE)
Chris@366 37
Chris@366 38 ifeq "$(DATATYPE)" "int16_t"
Chris@366 39 TYPEFLAGS=-DFIXED_POINT=16
Chris@366 40 endif
Chris@366 41
Chris@366 42 ifeq "$(DATATYPE)" "int32_t"
Chris@366 43 TYPEFLAGS=-DFIXED_POINT=32
Chris@366 44 endif
Chris@366 45
Chris@366 46 ifeq "$(DATATYPE)" "simd"
Chris@366 47 TYPEFLAGS=-DUSE_SIMD=1 -msse
Chris@366 48 endif
Chris@366 49
Chris@366 50
Chris@366 51 ifeq "$(DATATYPE)" "float"
Chris@366 52 # fftw needs to be built with --enable-float to build this lib
Chris@366 53 FFTWLIB=-lfftw3f
Chris@366 54 else
Chris@366 55 FFTWLIB=-lfftw3
Chris@366 56 endif
Chris@366 57
Chris@366 58 FFTWLIBDIR=-L/usr/local/lib/
Chris@366 59
Chris@366 60 SRCFILES=../kiss_fft.c ../tools/kiss_fftnd.c ../tools/kiss_fftr.c pstats.c ../tools/kfc.c ../tools/kiss_fftndr.c
Chris@366 61
Chris@366 62 all: tools $(BENCHKISS) $(SELFTEST) $(BENCHFFTW) $(TESTREAL) $(TESTKFC)
Chris@366 63
Chris@366 64 tools:
Chris@366 65 cd ../tools && make all
Chris@366 66
Chris@366 67
Chris@366 68 $(SELFTEST): $(SELFTESTSRC) $(SRCFILES)
Chris@366 69 $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) $+ -lm
Chris@366 70
Chris@366 71 $(TESTKFC): $(SRCFILES)
Chris@366 72 $(CC) -o $@ $(CFLAGS) -DKFC_TEST $(TYPEFLAGS) $+ -lm
Chris@366 73
Chris@366 74 $(TESTREAL): test_real.c $(SRCFILES)
Chris@366 75 $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) $+ -lm
Chris@366 76
Chris@366 77 $(BENCHKISS): benchkiss.c $(SRCFILES)
Chris@366 78 $(CC) -o $@ $(CFLAGS) $(TYPEFLAGS) $+ -lm
Chris@366 79
Chris@366 80 $(BENCHFFTW): benchfftw.c pstats.c
Chris@366 81 @echo "======attempting to build FFTW benchmark"
Chris@366 82 @$(CC) -o $@ $(CFLAGS) -DDATATYPE$(DATATYPE) $+ $(FFTWLIB) $(FFTWLIBDIR) -lm || echo "FFTW not available for comparison"
Chris@366 83
Chris@366 84 test: all
Chris@366 85 @./$(TESTKFC)
Chris@366 86 @echo "======1d & 2-d complex fft self test (type= $(DATATYPE) )"
Chris@366 87 @./$(SELFTEST)
Chris@366 88 @echo "======real FFT (type= $(DATATYPE) )"
Chris@366 89 @./$(TESTREAL)
Chris@366 90 @echo "======timing test (type=$(DATATYPE))"
Chris@366 91 @./$(BENCHKISS) -x $(NUMFFTS) -n $(NFFT)
Chris@366 92 @[ -x ./$(BENCHFFTW) ] && ./$(BENCHFFTW) -x $(NUMFFTS) -n $(NFFT) ||true
Chris@366 93 @echo "======higher dimensions type=$(DATATYPE))"
Chris@366 94 @./testkiss.py
Chris@366 95
Chris@366 96 selftest.c:
Chris@366 97 ./mk_test.py 10 12 14 > selftest.c
Chris@366 98 selftest_short.c:
Chris@366 99 ./mk_test.py -s 10 12 14 > selftest_short.c
Chris@366 100
Chris@366 101
Chris@366 102 CXXFLAGS=-O3 -ffast-math -fomit-frame-pointer -I.. -I../tools -W -Wall
Chris@366 103 testcpp: testcpp.cc ../kissfft.hh
Chris@366 104 $(CXX) -o $@ $(CXXFLAGS) testcpp.cc -lm
Chris@366 105
Chris@366 106
Chris@366 107 clean:
Chris@366 108 rm -f *~ bm_* st_* tr_* kf_* tkfc_* ff_* ffr_* *.pyc *.pyo *.dat testcpp