Files
wgpu/examples/src/hello_compute
Connor Fitzgerald ad625f433f Convert Tests to Use Async Poll (#5053)
* Convert Tests to Use Async Poll

* Update examples/src/repeated_compute/mod.rs

Co-authored-by: Andreas Reich <r_andreas2@web.de>

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-01-13 17:34:51 +00:00
..
2024-01-13 17:34:51 +00:00
2023-11-25 22:59:40 +00:00

hello-compute

Runs a compute shader to determine the number of iterations of the rules from Collatz Conjecture

  • If n is even, n = n/2
  • If n is odd, n = 3n+1

that it will take to finish and reach the number 1.

To Run

# Pass in any 4 numbers as arguments
RUST_LOG=hello_compute cargo run --bin wgpu-examples hello_compute 1 4 3 295

Example Output

[2020-04-25T11:15:33Z INFO  hello_compute] Steps: [0, 2, 7, 55]