Skip to content

Commit

Permalink
Merge pull request #1 from msu-sparta/final-edits
Browse files Browse the repository at this point in the history
WIP: adding sphinx+doxygen doc generation pipeline for READTHEDOCS
  • Loading branch information
Shihab-Shahriar authored Oct 9, 2023
2 parents 962f052 + 0ba3931 commit 3c1dcc2
Show file tree
Hide file tree
Showing 6 changed files with 2,889 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
# documentation
docs/build/
docs/sphinx/_build/

# PyBuilder
.pybuilder/
Expand Down
31 changes: 31 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
pre_build:
- cd docs && doxygen

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/sphinx/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ OpenRAND is header only, so there is no need to install it. Simply copy the head
You can also install OpenRAND using CMake. To integrate OpenRAND into your CMake project, add the following lines to your CMakeLists.txt file:

```
EDIT THIS STUFF FOR NEW URL
include(FetchContent)
FetchContent_Declare(
crng
GIT_REPOSITORY https://github.com/Shihab-Shahriar/rnd.git
GIT_REPOSITORY https://github.com/msu-sparta/OpenRAND.git
GIT_TAG main
)
Expand Down Expand Up @@ -54,23 +52,19 @@ int main() {
}
```

The seed should correspond a work-unit or processing element of the program. For example, it could be the unique global id of a particle in a monte carlo simulation, or the pixel flat index in a ray tracing renderer. The counter should be incremented every time a new random number is drawn for a particular seed. This is helpful, for example, when a particle undergoes multiple kernel launches (with a new random stream required in each) in it's lifespan.
The seed should correspond a work-unit of the program. For example, it could be the unique global id of a particle in a monte carlo simulation, or the pixel flat index in a ray tracing renderer. The counter should be incremented every time a new random number is drawn for a particular seed. This is helpful, for example, when a particle undergoes multiple kernel launches (with a new random stream required in each) in it's lifespan.

```
__global__ void apply_forces(Particle *particles, int counter, double sqrt_dt){
int i = blockIdx.x * blockDim.x + threadIdx.x;
Particle p = particles[i];
...
// Apply random force
RNG local_rand_state(p.pid, counter);
//double2 r = curand_uniform2_double(&local_rand_state);
auto x = local_rand_state.rand<double>();
auto y = local_rand_state.rand<double>();
p.vx += (x * 2.0 - 1.0) * sqrt_dt;
p.vy += (y * 2.0 - 1.0) * sqrt_dt;
particles[i] = p;
p.vx += (local_rand_state.rand<double>() * 2.0 - 1.0) * sqrt_dt;
...
}
Expand Down
Loading

0 comments on commit 3c1dcc2

Please sign in to comment.