-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#74 Make gpu and cpu calculation consistency
- Loading branch information
1 parent
e54682d
commit a8e8eb9
Showing
6 changed files
with
108 additions
and
84 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
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
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,24 +1,25 @@ | ||
# Cuda support | ||
|
||
## Install required libs | ||
```bash | ||
|
||
``` | ||
|
||
## Development | ||
To execute cuda code run. | ||
To execute gpu and cpu rank computing ran: | ||
|
||
```bash | ||
nvcc -shared -o librank.so rank.cu --compiler-options '-fPIC -frounding-math -fsignaling-nans' && sudo cp librank.so /usr/lib/ | ||
nvcc -fmad=false -shared -o librank.so rank.cu --compiler-options '-fPIC -frounding-math -fsignaling-nans' | ||
sudo cp librank.so /usr/lib/ | ||
go run *.go | ||
``` | ||
After executing check ranks. They should match. | ||
|
||
|
||
https://gcc.gnu.org/wiki/FloatingPointMath | ||
|
||
While creating the shared libraries, position independent code should be produced. This helps the shared library | ||
to get loaded as any address instead of some fixed address. For this -fPIC option is used. | ||
|
||
'-frounding-math' is round-to-zero for all floating point to integer conversions, and round-to-nearest for all other arithmetic truncations. | ||
to get loaded as any address instead of some fixed address. For this `-fPIC` option is used. | ||
|
||
## Determinism | ||
|
||
//fma is disabled for current version. | ||
|
||
https://gcc.gnu.org/wiki/FloatingPointMath | ||
'-frounding-math' is round-to-zero for all floating point to integer conversions, and round-to-nearest for | ||
all other arithmetic truncations. | ||
|
||
|
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
Oops, something went wrong.