Skip to content

Commit 1f0dab2

Browse files
committed
README and better automated build
1 parent 1e3fd94 commit 1f0dab2

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
*flops

Makefile

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
CPPFLAGS += -fopenmp -O3 -g -march=native
22

3-
all: avxflops sseflops
3+
all: sseflops avxflops
4+
5+
sseflops: sseflops.o
6+
$(CXX) -o $@ $< $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
47

58
avxflops: avxflops.o
6-
$(CXX) -o $@ $< $(CPPFLAGS) $(LDFLAGS)
9+
$(CXX) -o $@ $< $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
710

8-
sseflops: sseflops.o
9-
$(CXX) -o $@ $< $(CPPFLAGS) $(LDFLAGS)
11+
clean:
12+
rm -f *.o

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FLOPs
2+
=====
3+
4+
This is project for awesome code of [Mystical](http://stackoverflow.com/users/922184/mysticial) available at ["how to achieve 4 flops per cycle"](http://stackoverflow.com/questions/8389648/how-to-achieve-4-flops-per-cycle/8391601#8391601).
5+
6+
Usage
7+
-----
8+
9+
Just `make` then run. If you do not have min. *Sandy Bridge / AVX* CPU `avxflops` build will fail, but you can still test with `sseflops`.

avxflops.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// x86 AVX FLOPs counter
22
// Based on:
33
// http://stackoverflow.com/questions/8389648/how-to-achieve-4-flops-per-cycle
4-
// Build with:
5-
// g++ -O3 -fopenmp -march=native -o avxflops avxflops.cc
64

75
#include <stdint.h>
86
#include <iostream>

sseflops.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// x86 SSE FLOPs counter
22
// Based on:
33
// http://stackoverflow.com/questions/8389648/how-to-achieve-4-flops-per-cycle
4-
// Build with:
5-
// g++ -O3 -fopenmp -march=native -o sseflops sseflops.cc
64

75
#include <stdint.h>
86
#include <iostream>

0 commit comments

Comments
 (0)