AGBV / YASF

Yet Another Scattering Framework python implementation
https://agbv.github.io/YASF/
MIT License
0 stars 0 forks source link

Abstract the computation functions #53

Open arunoruto opened 4 months ago

arunoruto commented 4 months ago

Currently, there are two types of parallelized functions: CPU and CUDA. A large number of functions need to be imported and usually the GPU version is denoted with a _gpu at the end of the function. This produces overhead when writing.

To mitigate this, an abstract class needs to be defined with the necessary functions to be implemented, Computer(). From that class, we can derive classes such as ComputerCPU() and ComputerCUDA(). This enables an easier drop-in replacement, and new computer classes can be easier to implement and import.