- Timestamp:
- Nov 22, 2021, 3:54:54 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 94647b0b
- Parents:
- 97d58dc
- Location:
- tests/zombies/string-perf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/zombies/string-perf/Makefile
r97d58dc rfefd77a 8 8 9 9 10 PERFPROGS = \ 11 perfexp-cfa-hl-pta-share \ 12 perfexp-cfa-hl-peq-share \ 13 perfexp-cfa-ll-pta-share \ 14 perfexp-cfa-ll-peq-share \ 15 perfexp-cfa-hl-pta-noshare \ 16 perfexp-cfa-hl-peq-noshare \ 17 perfexp-cfa-ll-pta-noshare \ 18 perfexp-cfa-ll-peq-noshare \ 19 perfexp-stl-pta \ 20 perfexp-stl-peq \ 21 perfexp-buhr94-pta \ 22 perfexp-buhr94-peq 23 24 all : $(PERFPROGS) 25 26 # upper-case conversion function 10 # function: convert to upper case 27 11 define uc 28 12 $(shell echo $(1) | tr '[:lower:]' '[:upper:]') 29 13 endef 30 14 31 perfexp-cfa-%: APILEVEL=$(call uc,$(word 3,$(subst -, ,$@))) 32 perfexp-cfa-%: OPERATION=$(call uc,$(word 4,$(subst -, ,$@))) 33 perfexp-cfa-%: SHARING=$(call uc,$(word 5,$(subst -, ,$@))) 15 # function: project numbered element of filename named by hyphen-delimited tuple 16 # (call hyphProj,q-w-e-r.txt,1) is Q 17 define ucHyphProj 18 $(call uc,$(word $(2),$(subst -, ,$(basename $(1))))) 19 endef 20 21 # function: cross two lists, adding hyphen delimiters 22 # (call hyphCross,a b c,1 2) is a-1 a-2 b-1 b-2 c-1 c-2 23 define hyphCross 24 $(foreach x,$(1),$(foreach xs,$(2),$(x)-$(xs))) 25 endef 26 27 define hyphCross3 28 $(call hyphCross,$(1),$(call hyphCross,$(2),$(3))) 29 endef 30 31 define hyphCross4 32 $(call hyphCross,$(1),$(call hyphCross3,$(2),$(3),$(4))) 33 endef 34 35 define hyphCross5 36 $(call hyphCross,$(1),$(call hyphCross4,$(2),$(3),$(4),$(5))) 37 endef 38 39 OPERATIONS=pta peq 40 ALLOCS=reuse fresh 41 CFA_APILEVELS=hl ll 42 CFA_SHARINGS=share noshare 43 PLATFORMS=cfa stl buhr94 44 45 ifneq ($(filter cfa,$(PLATFORMS)),) 46 CFA_PERFPROGS=$(call hyphCross5,perfexp-cfa,$(CFA_APILEVELS),$(OPERATIONS),$(CFA_SHARINGS),$(ALLOCS)) 47 endif 48 49 ifneq ($(filter stl,$(PLATFORMS)),) 50 STL_PERFPROGS=$(call hyphCross3,perfexp-stl,$(OPERATIONS),$(ALLOCS)) 51 endif 52 53 ifneq ($(filter buhr94,$(PLATFORMS)),) 54 BUHR94_PERFPROGS=$(call hyphCross3,perfexp-buhr94,$(OPERATIONS),$(ALLOCS)) 55 endif 56 57 PERFPROGS = $(CFA_PERFPROGS) $(STL_PERFPROGS) $(BUHR94_PERFPROGS) 58 59 all : $(PERFPROGS) 60 61 62 63 perfexp-cfa-%: CFA_APILEVEL=$(call ucHyphProj,$@,3) 64 perfexp-cfa-%: OPERATION=$(call ucHyphProj,$@,4) 65 perfexp-cfa-%: CFA_SHARING=$(call ucHyphProj,$@,5) 66 perfexp-cfa-%: ALLOC=$(call ucHyphProj,$@,6) 34 67 perfexp-cfa-%: prog.cfa $(LIBCFA) 35 $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_$( APILEVEL)_$(SHARING) -DOP_$(OPERATION)68 $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_$(CFA_APILEVEL)_$(CFA_SHARING) -DOP_$(OPERATION) -DALLOC_$(ALLOC) 36 69 37 perfexp-stl-%: OPERATION=$(call uc,$(word 3,$(subst -, ,$@))) 70 perfexp-stl-%: OPERATION=$(call ucHyphProj,$@,3) 71 perfexp-stl-%: ALLOC=$(call ucHyphProj,$@,4) 38 72 perfexp-stl-%: prog.cfa 39 $(CXX) -xc++ $(PERFFLAGS_CXX) $< -o $@ -DIMPL_STL -DOP_$(OPERATION) 73 $(CXX) -xc++ $(PERFFLAGS_CXX) $< -o $@ -DIMPL_STL -DOP_$(OPERATION) -DALLOC_$(ALLOC) 40 74 41 perfexp-buhr94-%.o: OPERATION=$(call uc,$(word 3,$(subst -, ,$(basename $@)))) 75 perfexp-buhr94-%.o: OPERATION=$(call ucHyphProj,$@,3) 76 perfexp-buhr94-%.o: ALLOC=$(call ucHyphProj,$@,4) 42 77 perfexp-buhr94-%.o: prog.cfa 43 $(CXX) -xc++ -c $(PERFFLAGS_CXX) $< -o $@ -DIMPL_BUHR94 -DOP_$(OPERATION) 78 $(CXX) -xc++ -c $(PERFFLAGS_CXX) $< -o $@ -DIMPL_BUHR94 -DOP_$(OPERATION) -DALLOC_$(ALLOC) 44 79 45 80 buhr94-string.o: … … 66 101 printed=`./$$prog 100 10 $$corpusbody` ; \ 67 102 echo $$prog,$$corpus,$$printed >> $$tofile ; \ 103 echo $$prog,$$corpus,$$printed ; \ 68 104 done ; \ 69 done ; \ 70 cat $$tofile 105 done -
tests/zombies/string-perf/prog.cfa
r97d58dc rfefd77a 108 108 clock_t start, end_target, end_actual; 109 109 110 #if defined IMPL_CFA_LL && defined OP_PTA 111 string_res pta_ll_temp; 112 #endif 113 110 114 #if defined IMPL_CFA_LL 111 string_res x = "starter"; 112 string_res y; 113 #if defined OP_PTA 114 string_res z; 115 #endif 116 #define RESET y = x; 115 #define DECLS \ 116 string_res initval = "starter"; \ 117 string_res accum = { initval, COPY_VALUE }; 117 118 #else 118 string x = "starter"; 119 string y; 120 #define RESET y = x; 119 #define DECLS \ 120 string initval = "starter"; \ 121 string accum = initval; 122 #endif 123 124 #if defined ALLOC_REUSE 125 DECLS 126 #define RESET \ 127 accum = initval; 128 #elif defined ALLOC_FRESH 129 #define RESET \ 130 DECLS 131 #else 132 #error bad alloc 121 133 #endif 122 134 … … 127 139 RESET 128 140 for ( volatile unsigned int i = 0; i < concatsPerReset; i += 1 ) { 129 MAYBE( PRINT( y) )141 MAYBE( PRINT(accum) ) 130 142 char *toAppend = corpus[i % corpuslen]; // ? corpus[rand() % corpuslen] 131 143 #if defined OP_PTA && defined IMPL_CFA_LL 132 z = y;133 z+= toAppend;134 y = z;144 pta_ll_temp = accum; 145 pta_ll_temp += toAppend; 146 accum = pta_ll_temp; 135 147 #elif defined OP_PTA 136 y = y+ toAppend;148 accum = accum + toAppend; 137 149 #elif defined OP_PEQ 138 y+= toAppend;150 accum += toAppend; 139 151 #endif 140 152 }
Note: See TracChangeset
for help on using the changeset viewer.