-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move struct and upfront tests to separate library
- Loading branch information
1 parent
8589d60
commit e74142a
Showing
6 changed files
with
62 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
main.exe: main.c | ||
gcc $< -o $@ | ||
test: main.exe | ||
time -p ./main.exe | ||
|
||
main.exe: main.o libincrement.so | ||
gcc -Wl,-rpath,$(CURDIR) -o $@ $< -L. -lincrement | ||
|
||
libincrement.so: libincrement.o | ||
gcc -shared -o $@ $< | ||
|
||
%.o: %.c | ||
gcc -fPIC -Wall -c $< -o $@ | ||
|
||
clean: | ||
rm -f *.exe *.o *.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Use this incrementer algorithm if AVX2 is available. | ||
int fancy_incrementer(int x) { | ||
return x + 1; | ||
} | ||
|
||
// Use this if AVX2 is not available. It's the same as above, because we don't | ||
// actually rely on AVX2. | ||
int normal_incrementer(int x) { | ||
return x + 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
main.exe: main.c | ||
gcc $< -o $@ | ||
test: main.exe | ||
time -p ./main.exe | ||
|
||
main.exe: main.o libincrement.so | ||
gcc -Wl,-rpath,$(CURDIR) -o $@ $< -L. -lincrement | ||
|
||
libincrement.so: libincrement.o | ||
gcc -shared -o $@ $< | ||
|
||
%.o: %.c | ||
gcc -fPIC -Wall -c $< -o $@ | ||
|
||
clean: | ||
rm -f *.exe *.o *.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Use this incrementer algorithm if AVX2 is available. | ||
int fancy_incrementer(int x) { | ||
return x + 1; | ||
} | ||
|
||
// Use this if AVX2 is not available. It's the same as above, because we don't | ||
// actually rely on AVX2. | ||
int normal_incrementer(int x) { | ||
return x + 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters