diff --git a/CMakeLists.txt b/CMakeLists.txt index 40142f7..b048aaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ set(OWL_VERSION_MAJOR 1) set(OWL_VERSION_MINOR 2) -set(OWL_VERSION_PATCH 0) +set(OWL_VERSION_PATCH 2) cmake_minimum_required(VERSION 3.24) @@ -79,6 +79,10 @@ include(embed_optixir) option(OWL_BUILD_SHARED "Build OWL as a shared library? (otherwise static)" OFF) set(BUILD_SHARED_LIBS ${OWL_BUILD_SHARED}) # use 'OWL_' naming convention + +include(owl/cmake/configure_tbb.cmake) + + # ------------------------------------------------------------------ # owl library itself, including owl-common # ------------------------------------------------------------------ diff --git a/include/owl/owl_host.h b/include/owl/owl_host.h index 584d0fe..36568c0 100644 --- a/include/owl/owl_host.h +++ b/include/owl/owl_host.h @@ -5,7 +5,8 @@ #pragma once -#include +// #include +#include #include #include @@ -445,7 +446,7 @@ owlSetMaxInstancingDepth(OWLContext context, int32_t maxInstanceDepth); /* return the cuda stream associated with the given device. */ -OWL_API CUstream +OWL_API cudaStream_t owlContextGetStream(OWLContext context, int deviceID); /* return the optix context associated with the given device. */ @@ -723,7 +724,8 @@ owlTexture2DDestroy(OWLTexture texture); /*! returns the device handle of the given texture for the given device ID. Useful for custom texture object arrays. */ -OWL_API CUtexObject +OWL_API cudaTextureObject_t +// OWL_API CUtexObject owlTextureGetObject(OWLTexture texture, int deviceID); /*! returns the dimensions (number of pixels in) a given texture. */ @@ -893,7 +895,7 @@ owlAsyncLaunch2DOnDevice(OWLRayGen rayGen, int dims_x, int dims_y, int deviceID, OWLParams params); -OWL_API CUstream +OWL_API cudaTextureObject_t//CUstream owlParamsGetCudaStream(OWLParams params, int deviceID); /*! wait for the async launch to finish */ diff --git a/owl/APIHandle.h b/owl/APIHandle.h index f3dcbac..b888e2e 100644 --- a/owl/APIHandle.h +++ b/owl/APIHandle.h @@ -48,8 +48,9 @@ namespace owl { assert(object); std::shared_ptr asT = std::dynamic_pointer_cast(object); if (object && !asT) { - const std::string objectTypeID = typeid(*object.get()).name(); - + auto *obj = object.get(); + const std::string objectTypeID = typeid(*obj).name(); + const std::string tTypeID = typeid(T).name(); OWL_RAISE("could not convert APIHandle of type " + objectTypeID diff --git a/owl/CMakeLists.txt b/owl/CMakeLists.txt index b954a68..a39e391 100644 --- a/owl/CMakeLists.txt +++ b/owl/CMakeLists.txt @@ -3,8 +3,6 @@ find_package(OptiX REQUIRED) -include(cmake/configure_tbb.cmake) - set(OWL_SOURCES # ------------------------------------------------------- # infrastructure @@ -191,11 +189,17 @@ endif() target_include_directories(owl-config INTERFACE - ${PROJECT_SOURCE_DIR} - $ - #CMAKE_CURRENT_LIST_DIR}/include + $ + $ + $ + #CMAKE_CURRENT_LIST_DIR}/include +) +target_include_directories(owl PUBLIC + $ +) +target_include_directories(owl_static PUBLIC + $ ) - if (WIN32) target_compile_definitions(owl-config INTERFACE -DNOMINMAX) endif() diff --git a/owl/Group.h b/owl/Group.h index 1f40790..2f2a80a 100644 --- a/owl/Group.h +++ b/owl/Group.h @@ -107,7 +107,7 @@ namespace owl { int getSBTOffset() const override { return sbtOffset; } /*! pretty-printer, for printf-debugging */ - std::string toString() const; + std::string toString() const override; /*! list of child geometries to use in this BVH */ std::vector geometries; diff --git a/owl/LaunchParams.cpp b/owl/LaunchParams.cpp index bc348ed..a8db7ba 100644 --- a/owl/LaunchParams.cpp +++ b/owl/LaunchParams.cpp @@ -24,6 +24,8 @@ namespace owl { { return std::make_shared(device); } + + std::string LaunchParamsType::toString() const { return "LaunchParamsType"; } // ------------------------------------------------------------------ diff --git a/owl/LaunchParams.h b/owl/LaunchParams.h index d1c7b09..ce795e0 100644 --- a/owl/LaunchParams.h +++ b/owl/LaunchParams.h @@ -27,7 +27,7 @@ namespace owl { Object::DeviceData::SP createOn(const DeviceContext::SP &device) override; - virtual std::string toString() const { return "LaunchParamsType"; } + virtual std::string toString() const override; }; /*! an object that stores the variables used for building the launch diff --git a/owl/UserGeomGroup.cpp b/owl/UserGeomGroup.cpp index 21fcd3f..df65aab 100644 --- a/owl/UserGeomGroup.cpp +++ b/owl/UserGeomGroup.cpp @@ -27,6 +27,9 @@ namespace owl { buildFlags( (_buildFlags > 0) ? _buildFlags : defaultBuildFlags) {} + std::string UserGeomGroup::toString() const + { return "UserGeomGroup"; } + void UserGeomGroup::buildOrRefit(bool FULL_REBUILD) { for (auto child : geometries) { diff --git a/owl/UserGeomGroup.h b/owl/UserGeomGroup.h index 4adceed..e4cf964 100644 --- a/owl/UserGeomGroup.h +++ b/owl/UserGeomGroup.h @@ -17,7 +17,7 @@ namespace owl { UserGeomGroup(Context *const context, size_t numChildren, unsigned int buildFlags); - virtual std::string toString() const { return "UserGeomGroup"; } + virtual std::string toString() const override; /*! build() and refit() share most of their code; this functoin does all that code, with only minor specialization based on diff --git a/owl/cmake/embed_ptx.cmake b/owl/cmake/embed_ptx.cmake index fb29a8a..4049f9d 100644 --- a/owl/cmake/embed_ptx.cmake +++ b/owl/cmake/embed_ptx.cmake @@ -74,6 +74,7 @@ function(embed_ptx) target_sources(${PTX_TARGET} PUBLIC ${EMBED_PTX_SOURCES}) + set(CUDA_TOOLKIT_VERSION "13.0.0") target_link_libraries(${PTX_TARGET} PRIVATE ${EMBED_PTX_PTX_LINK_LIBRARIES}) set_property(TARGET ${PTX_TARGET} PROPERTY CUDA_PTX_COMPILATION ON) set_property(TARGET ${PTX_TARGET} PROPERTY CUDA_ARCHITECTURES OFF) diff --git a/owl/cmake/owlConfig.cmake.in b/owl/cmake/owlConfig.cmake.in index f030e85..e6d5ec3 100644 --- a/owl/cmake/owlConfig.cmake.in +++ b/owl/cmake/owlConfig.cmake.in @@ -23,9 +23,9 @@ set(OWL_DATAROOTDIR ${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_DATAROOTDIR@/owl ) -if (@OWL_MPI@) - find_dependency(MPI) - set(OWL_FEATURE_MPI ON) +if (@OWL_HAVE_TBB@ AND @TBB_FOUND@) + find_dependency(TBB) + set(OWL_HAVE_TBB ON) endif() diff --git a/owl/impl.cpp b/owl/impl.cpp index 21dbe4c..81f5fae 100644 --- a/owl/impl.cpp +++ b/owl/impl.cpp @@ -68,10 +68,12 @@ inline Buffer::SP checkGet(OWLBuffer _buffer) } /* return the cuda stream associated with the given device. */ -OWL_API CUstream owlContextGetStream(OWLContext _context, int deviceID) +OWL_API cudaStream_t owlContextGetStream(OWLContext _context, int deviceID) { LOG_API_CALL(); - return checkGet(_context)->getDevice(deviceID)->getStream(); + CUstream s = checkGet(_context)->getDevice(deviceID)->getStream(); + + return (cudaStream_t&)s; } /* return the optix context associated with the given device. */ @@ -748,14 +750,15 @@ owlTexture2DCreate(OWLContext _context, return (OWLTexture)context->createHandle(texture); } -OWL_API CUtexObject +// OWL_API CUtexObject +OWL_API cudaTextureObject_t owlTextureGetObject(OWLTexture _texture, int deviceID) { LOG_API_CALL(); assert(_texture); Texture::SP texture = ((APIHandle *)_texture)->get(); assert(texture); - return texture->getObject(deviceID); + return (cudaTextureObject_t)texture->getObject(deviceID); } OWL_API owl2ui @@ -876,14 +879,15 @@ owlGroupGetTraversable(OWLGroup _group, int deviceID) return group->getTraversable(group->context->getDevice(deviceID)); } -OWL_API CUstream +OWL_API cudaTextureObject_t +// OWL_API CUstream owlParamsGetCudaStream(OWLLaunchParams _lp, int deviceID) { LOG_API_CALL(); assert(_lp); LaunchParams::SP lp = ((APIHandle *)_lp)->get(); assert(lp); - return lp->getCudaStream(lp->context->getDevice(deviceID)); + return (cudaTextureObject_t)lp->getCudaStream(lp->context->getDevice(deviceID)); } OWL_API void