Skip to content

Commit

Permalink
Optimized GPU Knn Search (isl-org#4545)
Browse files Browse the repository at this point in the history
  • Loading branch information
junha-l authored Feb 4, 2022
1 parent 3bd635b commit 26effa3
Show file tree
Hide file tree
Showing 50 changed files with 4,198 additions and 762 deletions.
21 changes: 0 additions & 21 deletions 3rdparty/faiss/LICENSE

This file was deleted.

32 changes: 0 additions & 32 deletions 3rdparty/faiss/faiss_build.cmake

This file was deleted.

20 changes: 0 additions & 20 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1228,26 +1228,6 @@ open3d_import_3rdparty_library(3rdparty_parallelstl
)
list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS Open3D::3rdparty_parallelstl)

# Faiss
# Open3D should link Faiss before cuBLAS to avoid missing symbols error since
# Faiss uses cuBLAS symbols. For the same reason, Open3D should link Faiss
# before BLAS/Lapack if BLAS/Lapack are static libraries.
if (WITH_FAISS AND WIN32)
message(STATUS "Faiss is not supported on Windows")
set(WITH_FAISS OFF)
endif()
if (WITH_FAISS)
message(STATUS "Building third-party library faiss from source")
include(${Open3D_3RDPARTY_DIR}/faiss/faiss_build.cmake)
open3d_import_3rdparty_library(3rdparty_faiss
INCLUDE_DIRS ${FAISS_INCLUDE_DIR}
LIBRARIES ${FAISS_LIBRARIES}
LIB_DIR ${FAISS_LIB_DIR}
DEPENDS ext_faiss
)
target_link_libraries(3rdparty_faiss INTERFACE ${CMAKE_DL_LIBS})
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS Open3D::3rdparty_faiss)
endif()

# MKL/BLAS
if(USE_BLAS)
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ else()
endif()

option(PREFER_OSX_HOMEBREW "Prefer Homebrew libs over frameworks" ON )
option(WITH_FAISS "Enable Faiss" ON )

# Sensor options
option(BUILD_LIBREALSENSE "Build support for Intel RealSense camera" OFF)
Expand Down
1 change: 0 additions & 1 deletion cmake/Open3DPrintConfigurationSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function(open3d_print_configuration_summary)
set(3RDPARTY_DEPENDENCIES
BLAS
Eigen3
faiss
filament
fmt
GLEW
Expand Down
3 changes: 0 additions & 3 deletions cmake/Open3DSetGlobalProperties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ function(open3d_set_global_properties target)
if (WITH_IPPICV)
target_compile_definitions(${target} PRIVATE WITH_IPPICV)
endif()
if (WITH_FAISS)
target_compile_definitions(${target} PRIVATE WITH_FAISS)
endif()
if (GLIBCXX_USE_CXX11_ABI)
target_compile_definitions(${target} PUBLIC _GLIBCXX_USE_CXX11_ABI=1)
else()
Expand Down
7 changes: 2 additions & 5 deletions cpp/open3d/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ if (BUILD_CUDA_MODULE)
target_sources(core PRIVATE
nns/KnnSearchOps.cu
nns/FixedRadiusSearchOps.cu
nns/kernel/BlockSelectFloat32.cu
nns/kernel/BlockSelectFloat64.cu
)
endif()

Expand All @@ -125,11 +127,6 @@ if (BUILD_ISPC_MODULE)
)
endif()

if (WITH_FAISS)
target_sources(core PRIVATE
nns/FaissIndex.cpp
)
endif()

open3d_show_and_abort_on_warning(core)
open3d_set_global_properties(core)
Expand Down
8 changes: 8 additions & 0 deletions cpp/open3d/core/CUDAUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,20 @@ int GetCUDACurrentWarpSize() {
return value;
}

size_t GetCUDACurrentTotalMemSize() {
size_t free;
size_t total;
OPEN3D_CUDA_CHECK(cudaMemGetInfo(&free, &total));
return total;
}

#endif

} // namespace core
} // namespace open3d

#ifdef BUILD_CUDA_MODULE

namespace open3d {
namespace core {

Expand Down
2 changes: 2 additions & 0 deletions cpp/open3d/core/CUDAUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ int GetCUDACurrentWarpSize();
/// Returns the texture alignment in bytes for the current device.
int GetCUDACurrentDeviceTextureAlignment();

/// Returns the size of total global memory for the current device.
size_t GetCUDACurrentTotalMemSize();
#endif

namespace cuda {
Expand Down
1 change: 1 addition & 0 deletions cpp/open3d/core/hashmap/HashBackendBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "open3d/core/hashmap/HashBackendBuffer.h"

#include "open3d/core/CUDAUtils.h"

namespace open3d {
namespace core {

Expand Down
170 changes: 0 additions & 170 deletions cpp/open3d/core/nns/FaissIndex.cpp

This file was deleted.

Loading

0 comments on commit 26effa3

Please sign in to comment.