Header-only and GPU architecture independence
In contrast to boost, thrust and others, stdgpu is not a header-only library and, hence, requires shipping a compiled library. The following module currently require source file compilation:
- ~~
bitset: Contains host-only functions which also contain code executed on the device.~~ -
device: Contains a function relying on backend-specific host API functions. -
iterator: Only contains a wrapper function to hide the dependency tomemoryfrom the header. - ~~
limits: Contains the definition of static member variables.~~ -
memory: Both the general as well as the backend-specific parts handle the allocation and memcpy parts in the sources. ~~This includes some global variables that need to be converted to proper singletons.~~ - ~~
mutex: Contains host-only functions which also contain code executed on the device.~~
Inlining bitset and mutex will make the library independent of the required GPU architecture, e.g. the compute capability set for CUDA. Even if we decide not to go for header-only, achieving architecture independence might be a good compromise.
In #104, the global variables in memory have been cleaned up.
In #190, bitset and mutex have been inlined to achieve GPU architecture independence for the compiled library.
In #326, limits has been inlined as the declarations became obsolete with C++17.