Rework core code and implement a new CUDA based GPU backend#50
Rework core code and implement a new CUDA based GPU backend#50bozbez wants to merge 64 commits intoemanuelev:develfrom
Conversation
emanuelev
left a comment
There was a problem hiding this comment.
Great work, thanks a lot! Got few comments to get a discussion started, let me know what you think.
| add_subdirectory(se_core) | ||
| add_subdirectory(se_shared) | ||
| add_subdirectory(se_tools) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fdiagnostics-color=always -faligned-new") |
There was a problem hiding this comment.
is there a reason here to manually set CMAKE_CXX_FLAGS instead of add_compile_options?
| all: | ||
| mkdir -p build/ | ||
| cd build/ && cmake -DCMAKE_BUILD_TYPE=Release \ | ||
| cd build/ && cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ |
There was a problem hiding this comment.
I am not sure adding a dependency on Ninja would be helpful. Perhaps making it optional and reverting back to Make if not available?
| template<typename OctreeT, typename HashType, typename IncF> | ||
| SE_DEVICE_FUNC static void buildAllocationList(HashType* allocation_list, | ||
| int reserved, IncF get_idx, const OctreeT& octree, | ||
| const Eigen::Vector3f& world_vertex, const Eigen::Vector3f& direction, | ||
| const Eigen::Vector3f& camera_pos, float depth_sample, | ||
| float noise_factor); |
There was a problem hiding this comment.
I am not sure about this. Usually traits class are quite lightweight and convey only type infos. I'd break this into two classes at least. Like having an ofusion/sdf class that specify and implements the buildAllocationList and raycast interface.
|
|
||
| inline float3 voxelToPos(const int3 p, const float voxelSize){ | ||
| return make_float3(p.x * voxelSize, p.y * voxelSize, p.z * voxelSize); | ||
| inline float3 voxelToPos(const int3 p, const float voxelSize) { |
There was a problem hiding this comment.
This should be deleted, leftover of the pre-eigen port.
| @@ -0,0 +1,188 @@ | |||
| /* | |||
There was a problem hiding this comment.
Not sure about moving this to backend. Do you see a way to keep it in the core lib? Ideally core is everything octree-related but denseslam independent. Backend at this stage is somehow a mix which I'd rather avoid (think of someone that wants to use the lib without the whole denseslam dependency).
Benchmark results
Benchmarking results for the new CUDA backend, with 640x480 computation resolution and 1cm voxel size (left bars are for SDF, right for OFusion). Note the tracker has not (yet) been ported and was running on the CPU for all backends.
Summary of changes
se_prefix from root directories.clang-formatand auto formatted all excepttools/andapps/Makefileto use Ninjatracking/voxel_traitsBackendclass inbackend/, which compiles to new static librariessupereight-backend-{openmp, cuda}-{sdf, ofusion}.aImageand added new 1DBufferclassOverview of new code structure
TODO
ImagetoBuffer, and makeImageinheritBufferBackendinterface to include save/load, VTK dumping, etcbackend/backend/src/openmpand extract common code toBackendBaseandbackend/src/commoncore/testand extend for new functions