Skip to content
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: adding sphinx+doxygen doc generation pipeline for READTHEDOCS #1

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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