Skip to content

v0.2.0 API changes and ndarray integration 🎉

Latest
Compare
Choose a tag to compare
@UpsettingBoy UpsettingBoy released this 23 Dec 11:26
· 8 commits to dev since this release
3beca2c

New gpgpu release! This revision includes, among other things, improvements of the API and the new integration with the ndarray crate.

✨New features

🚩 integrate-ndarray feature for integration with ndarray crate

Integration with ndarray its been added with #3. I'm no expert using this crate so any comments are welcome!

  • Upload ndarray arrays to the GPU using GpuArray objects. They save the dimensions of the array previous upload to the GPU.
  • Take a look at the ndarray example. It has some comments about its usage and problems.

⚡ Major changes

👩‍💻 API changes

This changes are focused on improve the usability of gpgpu, making more clear the asynchronous intent. The most important changes are:

  • Background polling: Polling functions cannot be used from gpgpu (can be used from wgpu). They are invoked every 10ms by default.
  • Read functions: All read function of GpuBuffer and friends have both async and blocking methods:
    • read() and read_blocking(): Now it needs into an user provided buffer (#8).
    • read_vec() and read_vec_blocking(): Reads into a non-user allocated vector (ol' way).
  • Write functions: All writes are instantly offloaded, this meaning that writes (updates to GPU) are non-blocking, but it progress cannot be checked.
  • More clear interaction with wgpu: gpgpu GPU objects can now be created from wgpu ones using from_gpu_parts() and converted back using into_gpu_parts (#5).
  • Kernel creation is simplified. It now has to be created from a Program which contains information about the shader, entry point and bindings (#4).
  • Error handling it's been updated. Every GPU object has its own kind of error (#6).

🛠 General changes

  • Added CI that checks code format, build status on some platforms and documentation errors. Right now it does not run any example or test (#7).
  • Docs.rs documentation pulls examples into the usage of some of the functions.
  • Selection of backend via environment variables is done using Framework::default().
  • Updated wgpu to 0.12.

Full Changelog: v0.1.0...v0.2.0