-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] Gpu rebase inprog #107
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
export RUST_LOG=packet=TRACE | ||
#export RUST_BACKTRACE=1 | ||
|
||
all: htest | ||
|
||
htest:wfmt | ||
#cargo test accountant_skel::tests::test_layout -- --nocapture 2>&1 | head -n 30 | ||
#cargo test accountant_skel::tests::test_layout -- --nocapture | ||
cargo test accountant_stub -- --nocapture 2>&1 | head -n 30 | ||
|
||
ci: test bench release clippy ipv6 | ||
|
||
build: | ||
cargo build 2>&1 | head -n 30 | ||
|
||
loop: | ||
while true; do fswatch -1 -r src; make; done | ||
|
||
test: | ||
cargo test | ||
|
||
clippy: | ||
cargo +nightly clippy --features="unstable" | ||
|
||
cov: | ||
docker run -it --rm --security-opt seccomp=unconfined --volume "$$PWD:/volume" elmtai/docker-rust-kcov | ||
|
||
wfmt: | ||
cargo fmt -- --write-mode=overwrite | ||
|
||
release: | ||
cargo build --all-targets --release | ||
|
||
node: | ||
cat genesis.log | cargo run --bin silk-testnode > transactions0.log | ||
|
||
bench: | ||
cargo +nightly bench --features="unstable" -- --nocapture | ||
|
||
ipv6: | ||
cargo test ipv6 --features="ipv6" -- --nocapture | ||
|
||
lib:libcuda_verify_ed25519.a | ||
libcuda_verify_ed25519.a:dummy.c | ||
cc -o dummy.o -c dummy.c | ||
ar -cvq libcuda_verify_ed25519.a dummy.o |
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,8 @@ | ||
fn main() { | ||
println!("cargo:rustc-link-search=native=."); | ||
println!("cargo:rustc-link-lib=static=cuda_verify_ed25519"); | ||
println!("cargo:rustc-link-search=native=/usr/local/cuda/lib64"); | ||
println!("cargo:rustc-link-lib=dylib=cudart"); | ||
println!("cargo:rustc-link-lib=dylib=cuda"); | ||
println!("cargo:rustc-link-lib=dylib=cudadevrt"); | ||
} |
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,51 @@ | ||
#include <stdint.h> | ||
#include <assert.h> | ||
#include <stdio.h> | ||
|
||
#define PACKET_SIZE 288 | ||
#define PACKET_DATA_SIZE 256 | ||
union Packet { | ||
char data[PACKET_DATA_SIZE]; | ||
char total[PACKET_SIZE]; | ||
}; | ||
|
||
struct Elems { | ||
union Packet *packet; | ||
uint32_t len; | ||
}; | ||
|
||
int ed25519_verify_many( | ||
const struct Elems *vecs, | ||
uint32_t num, | ||
uint32_t message_size, | ||
uint32_t public_key_offset, | ||
uint32_t signature_offset, | ||
uint32_t signed_message_offset, | ||
uint32_t signed_message_len_offset, | ||
uint8_t *out | ||
) { | ||
int i, p = 0; | ||
assert(num > 0); | ||
for(i = 0; i < num; ++i) { | ||
int j; | ||
assert(vecs[i].len > 0); | ||
assert(message_size == PACKET_SIZE); | ||
assert(signed_message_len_offset == PACKET_DATA_SIZE); | ||
for(j = 0; j < vecs[i].len; ++j) { | ||
uint32_t *len = (uint32_t*)&vecs[i].packet[j].total[signed_message_len_offset]; | ||
assert(*len <= PACKET_DATA_SIZE); | ||
p += 1; | ||
if(public_key_offset > *len - 32) { | ||
continue; | ||
} | ||
if(signature_offset > *len - 64) { | ||
continue; | ||
} | ||
if(signed_message_offset > *len) { | ||
continue; | ||
} | ||
out[p - 1] = 1; | ||
} | ||
} | ||
return 0; | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the user doesn't have cuda libs installed or doesn't want to install them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we can have something like:
if !env::var("CARGO_CFG_CUDA").is_err() { prints... }
if we have a cfg like this:
#[cfg(cuda)] => CARGO_CFG_CUDA