Skip to content

Commit

Permalink
Merge branch 'main' of github.com:M2-TE/chad_tsdf
Browse files Browse the repository at this point in the history
  • Loading branch information
M2-TE committed Dec 3, 2024
2 parents 9e2496b + 0e21a5a commit 04ec46d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ if (NOT DEFINED CHAD_LEAF_BITS)
endif()

# create executable/library
file(GLOB_RECURSE CPP_SOURCE_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
file(GLOB_RECURSE CPP_SOURCE_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/dag/*.cpp")
if (CHAD_TOP_LEVEL)
set(CPP_SOURCE_FILES ${CPP_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
add_executable(${PROJECT_NAME} ${CPP_SOURCE_FILES})
target_compile_definitions(${PROJECT_NAME} PRIVATE CHAD_MAIN)
set_target_properties(${PROJECT_NAME} PROPERTIES
Expand Down
1 change: 1 addition & 0 deletions include/dag/morton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ auto MortonCode::normals(std::vector<std::pair<MortonCode, glm::vec3>>& morton_c
}
}


// figure out index
std::size_t normal_idx = point_it - morton_codes.cbegin();

Expand Down
5 changes: 2 additions & 3 deletions src/dag/dag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ auto insert_octree(
std::vector<glm::vec3>& normals,
std::array<NodeLevel, 63/3-1>& node_levels,
LeafLevel& leaf_level)
-> uint32_t
{
-> uint32_t {
auto beg = std::chrono::steady_clock::now();

// trackers that will be updated during traversal
Expand Down Expand Up @@ -415,7 +414,7 @@ void DAG::print_stats() {
fmt::println("total hashing memory: {:.6f} MiB", total_hashing);
fmt::println("total combined memory: {:.6f} MiB", total_vector + total_hashing);
}
double DAG::get_readonly_size() {
auto DAG::get_readonly_size() -> double {
double total_vector = 0.0;
for (std::size_t i = 0; i < _node_levels_p->size(); i++) {
double mem_vector = (double)((*_node_levels_p)[i]._raw_data.size() * sizeof(uint32_t)) / 1024.0 / 1024.0;
Expand Down
12 changes: 6 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include "dag/dag.hpp"
// // DEBUG
// #include <dag/leaf_cluster.hpp>
#include <vk/vk.hpp>
#include <vulkan/vulkan.hpp>
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
#define VMA_IMPLEMENTATION
#include <vk_mem_alloc.hpp>
// #include <vk/vk.hpp>
// #include <vulkan/vulkan.hpp>
// VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
// #define VMA_IMPLEMENTATION
// #include <vk_mem_alloc.hpp>

void static read_pcl_file() {
std::ifstream file;
Expand Down Expand Up @@ -72,7 +72,7 @@ void static do_sphere_thing() {
// dag.merge_all_subtrees();
}
int main() {
init_vk();
// init_vk();
exit(0);
if (false) read_pcl_file();
else do_sphere_thing();
Expand Down

0 comments on commit 04ec46d

Please sign in to comment.