AdvancedPhotonSource / tike

Repository for ptychography software
http://tike.readthedocs.io
Other
29 stars 15 forks source link

NEW: Allow mixed precision operators #258

Closed carterbox closed 1 year ago

carterbox commented 1 year ago

Purpose

Increase the available precision options for all of the implemented Operators. This allows users to use 64bit floating types or mix 32bit and 64bit types without causing errors to be raised.

Approach

Use CXX templates to compile the operator CUDA kernels for multiple input types. Using CuPy RawModule and runtime type introspections we can then match the cupy data types with the RawKernels compiled for those types.

The default precision of most functions is now controlled by the tike.precision module. Not sure whether this can be changed at runtime or not.

Pre-Merge Checklists

Submitter

Reviewer