Skip to content

Commit

Permalink
fix build when BUILD_AZURE_KINECT is ON
Browse files Browse the repository at this point in the history
  • Loading branch information
daizhirui committed May 20, 2024
1 parent ace94eb commit c7c28ec
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 5 deletions.
4 changes: 3 additions & 1 deletion 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,9 @@ if(OPEN3D_USE_ONEAPI_PACKAGES)
TARGETS TBB::tbb
)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb)

target_compile_definitions(3rdparty_tbb INTERFACE OPEN3D_USE_ONEAPI_PACKAGES=1)
target_compile_definitions(3rdparty_tbb INTERFACE _PSTL_UDR_PRESENT=0)
target_compile_definitions(3rdparty_tbb INTERFACE _PSTL_UDS_PRESENT=0)
# 2. oneDPL
# /opt/intel/oneapi/dpl/latest/lib/cmake/oneDPL
open3d_find_package_3rdparty_library(3rdparty_onedpl
Expand Down
35 changes: 35 additions & 0 deletions cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,38 @@ k4a_result_t k4a_transformation_depth_image_to_point_cloud(
} // namespace k4a_plugin
} // namespace io
} // namespace open3d

#include <fmt/format.h>

namespace fmt {

template <>
struct formatter<k4a_wait_result_t> {
template <typename FormatContext>
auto format(const k4a_wait_result_t &c, FormatContext &ctx) const
-> decltype(ctx.out()) {
const char *text = nullptr;
switch (c) {
case K4A_WAIT_RESULT_SUCCEEDED:
text = "K4A_WAIT_RESULT_SUCCEEDED";
break;
case K4A_WAIT_RESULT_FAILED:
text = "K4A_WAIT_RESULT_FAILED";
break;
case K4A_WAIT_RESULT_TIMEOUT:
text = "K4A_WAIT_RESULT_TIMEOUT";
break;
default:
text = "Unknown k4a_wait_result_t";
break;
}
return format_to(ctx.out(), text);
}

template <typename ParseContext>
constexpr auto parse(ParseContext &ctx) -> decltype(ctx.begin()) {
return ctx.begin();
}
};

} // namespace fmt
11 changes: 10 additions & 1 deletion cpp/open3d/ml/pytorch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,18 @@ target_link_libraries(open3d_torch_ops PRIVATE
Open3D::3rdparty_eigen3
Open3D::3rdparty_fmt
Open3D::3rdparty_nanoflann
Open3D::3rdparty_parallelstl
Open3D::3rdparty_tbb
)
if (TARGET Open3D::3rdparty_parallelstl)
target_link_libraries(open3d_torch_ops PRIVATE
Open3D::3rdparty_parallelstl
)
endif()
if (TARGET Open3D::3rdparty_onedpl)
target_link_libraries(open3d_torch_ops PRIVATE
Open3D::3rdparty_onedpl
)
endif()

if (BUILD_CUDA_MODULE)
target_link_libraries(open3d_torch_ops PRIVATE
Expand Down
8 changes: 8 additions & 0 deletions cpp/open3d/utility/ParallelScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
// clang-format off
#if TBB_INTERFACE_VERSION >= 10000
#ifdef OPEN3D_USE_ONEAPI_PACKAGES
#ifdef _PSTL_UDR_PRESENT
#undef _PSTL_UDR_PRESENT
#endif
#define _PSTL_UDR_PRESENT 0
#ifdef _PSTL_UDS_PRESENT
#undef _PSTL_UDS_PRESENT
#endif
#define _PSTL_UDS_PRESENT 0
#include <oneapi/dpl/execution>
#include <oneapi/dpl/numeric>
#else
Expand Down
2 changes: 1 addition & 1 deletion cpp/open3d/visualization/rendering/RendererHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct REHandle : public REHandle_abstract {
id = REHandle_abstract::kBadId + 1;
}

return std::move(REHandle(id));
return REHandle(id);
}

static REHandle Concretize(const REHandle_abstract& abstract) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ using ResourcesContainer =
template <class ResourceType>
std::shared_ptr<ResourceType> MakeShared(ResourceType* pointer,
filament::Engine& engine) {
return std::move(std::shared_ptr<ResourceType>(
pointer, [&engine](ResourceType* p) { engine.destroy(p); }));
return std::shared_ptr<ResourceType>(
pointer, [&engine](ResourceType* p) { engine.destroy(p); });
}

template <class ResourceType>
Expand Down

0 comments on commit c7c28ec

Please sign in to comment.