Skip to content

Commit

Permalink
cihou cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Jul 4, 2022
1 parent 044cec2 commit 71d0dbf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .tasks
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ run_environ=ZENO_LOGLEVEL=info ZENO_OPEN=/tmp/a.zsg
;run_environ=ZENO_LOGLEVEL=info ZENO_OPEN=/tmp/a.zsg ZENO_ALWAYS=1 ZENO_OPTX=1
build_dir=/tmp/zeno-build
run_target="$(VIM:build_dir)/bin/zenoedit"
build_configs=-Wno-dev -DCMAKE_INSTALL_PREFIX=/tmp/zeno-dist -DZENO_NO_WARNING:BOOL=ON -DZENO_PARALLEL_STL:BOOL=ON -DZENO_BUILD_SHARED:BOOL=ON -DZENO_MULTIPROCESS:BOOL=ON -DZENO_IPC_USE_TCP:BOOL=ON -DZENO_ENABLE_BACKWARD:BOOL=ON -DZENO_ENABLE_OPTIX:BOOL=ON -DZENO_SYSTEM_ALEMBIC:BOOL=ON -DZENO_SYSTEM_OPENVDB:BOOL=ON -DZENO_WITH_MeshSubdiv:BOOL=ON -DZENO_WITH_ZenoFX:BOOL=ON -DZENO_WITH_zenvdb:BOOL=OFF -DZENO_WITH_FBX:BOOL=OFF -DZENO_WITH_SampleModel:BOOL=ON -DZENO_WITH_cgmesh:BOOL=OFF -DZENO_WITH_Rigid:BOOL=OFF
build_configs=-Wno-dev -DCMAKE_INSTALL_PREFIX=/tmp/zeno-dist -DZENO_NO_WARNING:BOOL=ON -DZENO_PARALLEL_STL:BOOL=ON -DZENO_BUILD_SHARED:BOOL=ON -DZENO_MULTIPROCESS:BOOL=ON -DZENO_IPC_USE_TCP:BOOL=ON -DZENO_ENABLE_BACKWARD:BOOL=ON -DZENO_ENABLE_OPTIX:BOOL=ON -DZENO_SYSTEM_ALEMBIC:BOOL=ON -DZENO_SYSTEM_OPENVDB:BOOL=ON -DZENO_WITH_MeshSubdiv:BOOL=ON -DZENO_WITH_ZenoFX:BOOL=ON -DZENO_WITH_zenvdb:BOOL=ON -DZENO_WITH_FBX:BOOL=OFF -DZENO_WITH_SampleModel:BOOL=ON -DZENO_WITH_cgmesh:BOOL=OFF -DZENO_WITH_Rigid:BOOL=OFF -DZENO_WITH_CUDA:BOOL=ON
pre_build_cmd=(test -d build || ln -sf "$(VIM:build_dir)" build) &&
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ option(ZENO_BUILD_SHARED "Build shared library for ZENO" OFF)
option(ZENO_USE_CCACHE "Use CCache if found in path" ON)
option(ZENO_NO_WARNING "Use customized compiler warnings" ON)
option(ZENO_INSTALL_TARGET "Enable installation targets" OFF)
option(ZENO_WITH_CUDA "Build ZENO with CUDA support" OFF)

if (ZENO_WITH_CUDA) # must move enable_language ahead to here
enable_language(CUDA) # otherwise projects/CUDA will fail to compile
endif()

if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
# Otherwise we can't link .so libs with .a libs
Expand Down
5 changes: 5 additions & 0 deletions projects/CUDA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.19)

if (NOT ZENO_WITH_zenvdb OR NOT ZENO_WITH_ZenoFX)
message(FATAL_ERROR "zenvdb and ZenoFX must be ON when CUDA is ON! "
"Please specify: -DZENO_WITH_zenvdb:BOOL=ON -DZENO_WITH_ZenoFX:BOOL=ON")
endif()

# assume cuda
SET(CMAKE_CUDA_ARCHITECTURES OFF)
project(ZENO_CUDA CXX CUDA)
Expand Down
2 changes: 1 addition & 1 deletion projects/ZenoFX/LinearBvh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ typename LBvh::TV LBvh::find_nearest(TV const &pos, Ti &id, float &dist) const {
return find_nearest(pos, id, dist, element_c<element_e::tri>);
else if (eleCategory == element_e::line)
return find_nearest(pos, id, dist, element_c<element_e::line>);
else if (eleCategory == element_e::point)
else // if (eleCategory == element_e::point)
return find_nearest(pos, id, dist, element_c<element_e::point>);
}

Expand Down

0 comments on commit 71d0dbf

Please sign in to comment.