This is what we currently do. The user is given different sources, e.g., MAGMA, clMAGMA, or MAGMA MIC, and in addition in make.inc a user may specify which accelerator is available. Then only a particular version gets installed. This mechanisms is not convenient though, e.g., for tools like MATLAB, where the distribution is just a binary. For those cases we will build everything in single binary and have wrappers for every routine that at runtime will determine which hardware-specific routine to execute (based on MAGMA hardware context created at MAGMA initialization time or other user mechanisms of specifying on what hardware to run a specific routine). Using this mechanism one will be also able for example to explicitly set a device and run something on it, e.g., something like this
- Code: Select all
would run LU factorization on a device that is marked (during initialization) as 5. Something similar can be done through a stream/queue that is previously linked to a device (in which case the stream/queue will be an argument of dgetrf).