AdvancedPhotonSource / tike

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

Single path for multi- and single- GPU #90

Closed carterbox closed 4 years ago

carterbox commented 4 years ago

Purpose

Unify the multi- and single- GPU code paths to improve readability and maintainability.

Approach

Removes additional if-else statements for single- and multi- GPU implementations by using function substitution and the Pool class.

Pre-Merge Checklists

Submitter

Reviewer

carterbox commented 4 years ago

The num_gpu parameter is still in the argument list of recon(), but internal functions can access the attributes of the Pool to get the number of GPUs. If you are implementing some kind of primary and secondary groupings of GPUs, then this can be included as a property of the pool. Is that acceptable?

xiaodong-yu commented 4 years ago

Yes, that's acceptable. It would be great to add GPU grouping as a feature of the pool.