功能|示例|入门|贡献|许可证|接触
STDGPU是一个开源库,为快速可靠的数据管理提供通用的GPU数据结构。
insert(begin, end) ,编写共享的C ++代码find(key) ,编写自定义CUDA内核等。STDGPU并没有提供另一个生态系统,而是设计为轻质容器库。以前的库,例如推力,vexcl,arrayfire或boost.com.com.posute opute opute opute to posent of to contiguinder存储的数据。 STDGPU遵循一种正交方法,并专注于快速,可靠的数据管理,以便像CPU对应物一样快速开发更一般和灵活的GPU算法。
从本质上讲,STDGPU提供了以下GPU数据结构和容器:
atomic & atomic_ref原子原始类型和参考 | bitset空间有效的位阵列 | deque动态尺寸的双端队列 |
queue和stack容器适配器 | unordered_map & unordered_setHashed集合的独特键和键值对 | vector动态尺寸的连续数组 |
In addition, stdgpu also provides further commonly used helper functionality in algorithm , bit , contract , cstddef , execution , functional , iterator , limits , memory , mutex , numeric , ranges , type_traits , utility .
为了可靠地在GPU上执行复杂的任务,STDGPU提供了灵活的界面,可以在不可知代码中使用,例如通过推力提供的算法以及本机代码,例如在Cudan Cuda内核中。
例如,STDGPU广泛用于Slamcast,这是一个可扩展的实时触觉系统,以实现实时,大规模的3D场景重建以及服务器和任意数量的远程客户端之间的实时3D数据流。
不可知论代码。在Slamcast的上下文中,一个简单的任务是将一系列更新的块集成到无重复的无重复的排队块中,用于数据流,可以非常方便地表达出来:
# include < stdgpu/cstddef.h > // stdgpu::index_t
# include < stdgpu/iterator.h > // stdgpu::make_device
# include < stdgpu/unordered_set.cuh > // stdgpu::unordered_set
class stream_set
{
public:
void
add_blocks ( const short3* blocks,
const stdgpu:: index_t n)
{
set. insert ( stdgpu::make_device (blocks),
stdgpu::make_device (blocks + n));
}
// Further functions
private:
stdgpu::unordered_set<short3> set;
// Further members
};本机代码。更复杂的操作,例如创建无重复的无重复块或其他算法,可以在本地实施,例如,使用STDGPU的CUDA Backend启用了自定义CUDA内核中:
# include < stdgpu/cstddef.h > // stdgpu::index_t
# include < stdgpu/unordered_map.cuh > // stdgpu::unordered_map
# include < stdgpu/unordered_set.cuh > // stdgpu::unordered_set
__global__ void
compute_update_set ( const short3* blocks,
const stdgpu:: index_t n,
const stdgpu::unordered_map<short3, voxel*> tsdf_block_map,
stdgpu::unordered_set<short3> mc_update_set)
{
// Global thread index
stdgpu:: index_t i = blockIdx. x * blockDim. x + threadIdx. x ;
if (i >= n) return ;
short3 b_i = blocks[i];
// Neighboring candidate blocks for the update
short3 mc_blocks[ 8 ]
= {
short3 (b_i. x - 0 , b_i. y - 0 , b_i. z - 0 ),
short3 (b_i. x - 1 , b_i. y - 0 , b_i. z - 0 ),
short3 (b_i. x - 0 , b_i. y - 1 , b_i. z - 0 ),
short3 (b_i. x - 0 , b_i. y - 0 , b_i. z - 1 ),
short3 (b_i. x - 1 , b_i. y - 1 , b_i. z - 0 ),
short3 (b_i. x - 1 , b_i. y - 0 , b_i. z - 1 ),
short3 (b_i. x - 0 , b_i. y - 1 , b_i. z - 1 ),
short3 (b_i. x - 1 , b_i. y - 1 , b_i. z - 1 ),
};
for (stdgpu:: index_t j = 0 ; j < 8 ; ++j)
{
// Only consider existing neighbors
if (tsdf_block_map. contains (mc_blocks[j]))
{
mc_update_set. insert (mc_blocks[j]);
}
}
}在examples目录中可以找到更多示例。
STDGPU需要C ++ 17编译器以及最小的后端依赖项,并且可以轻松地通过CMAKE构建和集成到您的项目中:
可以在文档中找到更多的准则以及对STDGPU的设计和API的全面介绍。
有关如何贡献的详细信息,请参见文档中的贡献部分。
根据Apache 2.0许可分发。有关更多信息,请参见LICENSE 。
如果您在其中一个项目中使用STDGPU,请引用以下出版物:
STDGPU:GPU上有效的STL样数据结构
@UNPUBLISHED { stotko2019stdgpu ,
author = { Stotko, P. } ,
title = { {stdgpu: Efficient STL-like Data Structures on the GPU} } ,
year = { 2019 } ,
month = aug,
note = { arXiv:1908.05936 } ,
url = { https://arxiv.org/abs/1908.05936 }
}Slamcast:大规模实时3D重建和流式传输,用于沉浸式多客户实时电视
@article { stotko2019slamcast ,
author = { Stotko, P. and Krumpen, S. and Hullin, M. B. and Weinmann, M. and Klein, R. } ,
title = { {SLAMCast: Large-Scale, Real-Time 3D Reconstruction and Streaming for Immersive Multi-Client Live Telepresence} } ,
journal = { IEEE Transactions on Visualization and Computer Graphics } ,
volume = { 25 } ,
number = { 5 } ,
pages = { 2102--2112 } ,
year = { 2019 } ,
month = may
}帕特里克·斯托特科 - [email protected]