platform: Add automatic dispatching of backend-specific definitions by stotko · Pull Request #119 · stotko/stdgpu (original) (raw)

In comparison to memory and atomic, the platform module does not automatically infer the definition of the provided functionality from the chosen backend. Instead, the dispatching logic as well as all backend-specific definitions are thrown together in preprocessor if clauses.

Move these definitions into backend platform modules and add an automatic dispatch mechanism similar to the one used in the memory and atomic modules. This simplifies the introduction of new backends in the future and exposes the requirements to backends in a more complete manner. In addition to this change, the compiler detection has been moved to a new compiler module which is implicitly included by platform for backwards compatibility.