-
Notifications
You must be signed in to change notification settings - Fork 62
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
SDE #1884
Merged
Merged
SDE #1884
Changes from 90 commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
0060463
cpu
boeschf dc12fda
Merge remote-tracking branch 'upstream/master' into SDE
boeschf aa07ab4
missing include
boeschf 687a4c6
simplified API calls
boeschf 263dd86
better random numbers
boeschf e9a3255
size_type, rand, coalesce
boeschf b46d459
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 8071f79
fixes after merge
boeschf 5aeb5cd
removed comment
boeschf 1e3518b
removed printouts
boeschf 1b66a60
seed now settable via overrides
boeschf 71ddbda
moved random number generation from modcc to backend
boeschf 8a7e2bc
cosmetics
boeschf 4e05517
moved random123 out of the way
boeschf ae99b0f
Merge remote-tracking branch 'upstream/master' into SDE_backend
boeschf d990f77
cleanup
boeschf 93e5d66
cleanup
boeschf d1ecd6c
cleanup
boeschf 4930f83
cleanup
boeschf ccc55f7
simd printer
boeschf 26ff30e
export backtrace
boeschf 214f0d0
backtrace
boeschf 1876136
storage
boeschf 9e7d194
gpu backend
boeschf be25475
gpu printer
boeschf ec7e609
documentation
boeschf 51832fc
review low hanging fruit
boeschf ca98b1c
removed stochastic flag
boeschf 2103820
added global seed via recipe, removed per-mechanism seed
boeschf 2fbaf04
more detailed comments
boeschf 52996d8
seed initialization
boeschf 0824a96
seed initialization documentation
boeschf 5d141aa
removed blank lines
boeschf e52745d
Update doc/concepts/mechanisms.rst
boeschf f06979d
Update doc/concepts/mechanisms.rst
boeschf 1443dc5
Update doc/cpp/simulation.rst
boeschf ac3871c
Update doc/fileformat/nmodl.rst
boeschf a07fd85
link to wikipedia for Ito calculus
boeschf b36b885
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 0edcfd7
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 064b698
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 256a272
Merge remote-tracking branch 'upstream/master' into SDE
boeschf d2c5bf6
modcc tests
boeschf c0555ed
simulation builder test
boeschf 7bd20a4
simulation builder test
boeschf 40428c9
easier random values extraction with probes
boeschf 3cdca99
python probes
boeschf 426eef0
extensive tests for random numbers
boeschf 479af5f
Merge remote-tracking branch 'upstream/master' into SDE
boeschf c860f4d
typo
boeschf db4bd21
Merge remote-tracking branch 'upstream/master' into SDE
boeschf b912862
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 9534a50
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 3fc3238
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 91b0e1f
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 913ec2a
remove warning: comparison to unsigned
boeschf 432e02d
review part 1
boeschf 66f9e12
review part 2
boeschf 43cd610
Merge remote-tracking branch 'upstream/master' into SDE
boeschf addcd4e
minor cosmentic fixes
boeschf 42864b0
doc updates
boeschf c7aa1b3
simplifed calling rng
boeschf 3aedb37
simplified gpu shared state rng
boeschf 67dddc9
bump abi version
boeschf 79fc2e8
fix some sphinx errors
boeschf 8bc054c
dev docs
boeschf e0699a7
typo
boeschf d605697
different solver test
boeschf 2c3b0ec
coupled SDE
boeschf 1d54ca8
small doc updates
boeschf 093c9a0
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 44b16d9
dev doc update
boeschf 6786464
typo
boeschf c2fbfb7
changed weird indentation
boeschf 6c82d04
remove unnecessary move
boeschf be7a883
test with static gtest
boeschf a033740
gpu fix
boeschf fa7b7be
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 133dc16
Merge branch 'SDE' into SDE_gpu_fix
boeschf c00466a
guard against multiple defines
boeschf 9846fec
padding for gpu indices
boeschf 7bada96
gpu and flag for not using random number generation on gpus
boeschf 13335a0
fill empty fields in rng with default values different from zero
boeschf f308b33
use aligned memory (width_padded) and add better compile time flags
boeschf dea964e
add restrict keyword
boeschf b39c06d
test printouts
boeschf 9e09b09
Merge remote-tracking branch 'origin/SDE' into SDE_gpu_fix
boeschf 0696b4e
removed printouts
boeschf c881fb0
Merge pull request #1 from boeschf/SDE_gpu_fix
boeschf f914b51
fixed value_width_padded for simd
boeschf 811eab0
Merge remote-tracking branch 'upstream/master' into SDE
boeschf 4a7547e
gpu: delegated random number generation to pimpl
boeschf d73eea2
forgot include
boeschf c305b73
Merge remote-tracking branch 'upstream/master' into SDE
boeschf ac87eef
fix cable solver
boeschf ccb18c9
white space
boeschf 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
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,64 @@ | ||
#include <arbor/gpu/gpu_api.hpp> | ||
#include <arbor/gpu/gpu_common.hpp> | ||
|
||
#include "backends/rand_impl.hpp" | ||
|
||
namespace arb { | ||
namespace gpu { | ||
|
||
namespace kernel { | ||
__global__ | ||
void generate_random_numbers( | ||
arb_value_type* __restrict__ dst, | ||
std::size_t width, | ||
std::size_t width_padded, | ||
std::size_t num_rv, | ||
arb::cbprng::value_type seed, | ||
arb::cbprng::value_type mech_id, | ||
arb::cbprng::value_type counter, | ||
arb_size_type const * __restrict__ gids, | ||
arb_size_type const * __restrict__ idxs, | ||
unsigned cache_size) { | ||
// location and variable number extracted from thread block | ||
const int i = threadIdx.x + blockDim.x*blockIdx.x; | ||
const arb::cbprng::value_type n = blockIdx.y; | ||
|
||
if (i < width) { | ||
const arb::cbprng::value_type gid = gids[i]; | ||
const arb::cbprng::value_type idx = idxs[i]; | ||
const auto r = arb::cbprng::generator{}(arb::cbprng::array_type{seed, mech_id, n, counter}, | ||
arb::cbprng::array_type{gid, idx, 0xdeadf00dull, 0xdeadbeefull}); | ||
const auto a = r123::boxmuller(r[0], r[1]); | ||
const auto b = r123::boxmuller(r[2], r[3]); | ||
dst[i + width_padded*(0 + cache_size*n)] = a.x; | ||
dst[i + width_padded*(1 + cache_size*n)] = a.y; | ||
dst[i + width_padded*(2 + cache_size*n)] = b.x; | ||
dst[i + width_padded*(3 + cache_size*n)] = b.y; | ||
} | ||
} | ||
} // namespace kernel | ||
|
||
void generate_random_numbers( | ||
arb_value_type* dst, // points to random number storage | ||
std::size_t width, // number of sites | ||
std::size_t width_padded, // padded number of sites | ||
std::size_t num_rv, // number of random variables | ||
cbprng::value_type seed, // simulation seed value | ||
cbprng::value_type mech_id, // mechanism id | ||
cbprng::value_type counter, // step counter | ||
arb_size_type const * gid, // global cell ids (size = width) | ||
arb_size_type const * idx // per-cell location index (size = width) | ||
) { | ||
using impl::block_count; | ||
|
||
unsigned const block_dim = 128; | ||
unsigned const grid_dim_x = block_count(width, block_dim); | ||
unsigned const grid_dim_y = num_rv; | ||
|
||
kernel::generate_random_numbers<<<dim3{grid_dim_x, grid_dim_y, 1}, block_dim>>>( | ||
dst, width, width_padded, num_rv, seed, mech_id, counter, gid, idx, cbprng::cache_size()); | ||
} | ||
|
||
} // namespace gpu | ||
} // namespace arb | ||
|
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
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.
This is my only painpoint left:
Could we make it so that shared state doesn't need to know about this flag? Currently it's used in
threefour different places, which might cause issues down the road. How about delegating these things to the
pRNG impl
via the use of an appropriate interface. In said interface we can make the decision once.