stdgpu icon indicating copy to clipboard operation
stdgpu copied to clipboard

Header-only and GPU architecture independence

Open stotko opened this issue 5 years ago • 3 comments

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 to memory from 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.

stotko avatar Feb 11 '20 15:02 stotko

In #104, the global variables in memory have been cleaned up.

stotko avatar Apr 26 '20 14:04 stotko

In #190, bitset and mutex have been inlined to achieve GPU architecture independence for the compiled library.

stotko avatar Oct 07 '20 11:10 stotko

In #326, limits has been inlined as the declarations became obsolete with C++17.

stotko avatar May 24 '23 19:05 stotko