Skip to content

Commit 1c6b75f

Browse files
Merge pull request #16 from falseywinchnet/feature-branch
locality
2 parents 11af86b + 39e7d3b commit 1c6b75f

6 files changed

Lines changed: 511 additions & 25 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ if(BFFT_BUILD_EXAMPLES)
8787
target_link_libraries(benchmark PRIVATE ${CMAKE_DL_LIBS})
8888
endif()
8989

90+
bfft_add_cpp_executable(locality_probe examples/locality_probe.cpp)
9091
bfft_add_cpp_executable(cpp_api_demo examples/cpp_api_demo.cpp)
9192
bfft_add_c_executable(c_api_demo examples/c_api_demo.c)
9293

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ STATIC_LIB := $(BUILD_DIR)/lib$(LIB_NAME).a
4040
SHARED_LIB := $(BUILD_DIR)/lib$(LIB_NAME).so
4141
PC_FILE := $(BUILD_DIR)/$(LIB_NAME).pc
4242
BENCH := $(BUILD_DIR)/examples/benchmark
43+
LOCALITY_PROBE := $(BUILD_DIR)/examples/locality_probe
4344
C_DEMO := $(BUILD_DIR)/examples/c_api_demo
4445
CPP_DEMO := $(BUILD_DIR)/examples/cpp_api_demo
4546
CORRECTNESS_TEST := $(BUILD_DIR)/tests/correctness
@@ -73,11 +74,14 @@ $(PC_FILE): pkgconfig/bfft.pc.in | $(BUILD_DIR)
7374
-e 's|@PROJECT_VERSION@|$(VERSION)|g' \
7475
$< > $@
7576

76-
examples: $(BENCH) $(C_DEMO) $(CPP_DEMO)
77+
examples: $(BENCH) $(LOCALITY_PROBE) $(C_DEMO) $(CPP_DEMO)
7778

7879
$(BENCH): examples/benchmark.cpp include/bfft/bfft.hpp $(STATIC_LIB) | $(BUILD_DIR)
7980
$(CXX) $(CPPFLAGS) $(INCLUDES) $(CXXFLAGS) $< $(STATIC_LIB) $(LDLIBS) $(DL_LIBS) -o $@
8081

82+
$(LOCALITY_PROBE): examples/locality_probe.cpp include/bfft/bfft.hpp $(STATIC_LIB) | $(BUILD_DIR)
83+
$(CXX) $(CPPFLAGS) $(INCLUDES) $(CXXFLAGS) $< $(STATIC_LIB) $(LDLIBS) -o $@
84+
8185
$(C_DEMO): examples/c_api_demo.c include/bfft/bfft.h $(STATIC_LIB) | $(BUILD_DIR)
8286
$(CC) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) $< $(STATIC_LIB) $(LDLIBS) -lstdc++ -o $@
8387

examples/benchmark_compile_instructions.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,11 @@ Then:
5555

5656
build/examples/benchmark --intel-mkl
5757
build/examples/benchmark --intel-mkl 1024 1000
58+
59+
Locality probe:
60+
61+
The ordinary make examples target also builds build/examples/locality_probe.
62+
It compares hot-cache timing with a rotating working set sized by ring_mib.
63+
64+
build/examples/locality_probe
65+
build/examples/locality_probe 65536 240 64

0 commit comments

Comments
 (0)