功能|示例|入門|貢獻|許可證|接觸
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]