Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
# ------------------------------------------------------------------
Expand Down
10 changes: 6 additions & 4 deletions include/owl/owl_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

#pragma once

#include <cuda.h>
// #include <cuda.h>
#include <cuda_runtime.h>
#include <driver_types.h>
#include <optix.h>

Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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 */
Expand Down
5 changes: 3 additions & 2 deletions owl/APIHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ namespace owl {
assert(object);
std::shared_ptr<T> asT = std::dynamic_pointer_cast<T>(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
Expand Down
16 changes: 10 additions & 6 deletions owl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

find_package(OptiX REQUIRED)

include(cmake/configure_tbb.cmake)

set(OWL_SOURCES
# -------------------------------------------------------
# infrastructure
Expand Down Expand Up @@ -191,11 +189,17 @@ endif()

target_include_directories(owl-config
INTERFACE
${PROJECT_SOURCE_DIR}
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
#CMAKE_CURRENT_LIST_DIR}/include
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
#CMAKE_CURRENT_LIST_DIR}/include
)
target_include_directories(owl PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_include_directories(owl_static PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

if (WIN32)
target_compile_definitions(owl-config INTERFACE -DNOMINMAX)
endif()
Expand Down
2 changes: 1 addition & 1 deletion owl/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Geom::SP> geometries;
Expand Down
2 changes: 2 additions & 0 deletions owl/LaunchParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace owl {
{
return std::make_shared<Object::DeviceData>(device);
}

std::string LaunchParamsType::toString() const { return "LaunchParamsType"; }


// ------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion owl/LaunchParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions owl/UserGeomGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion owl/UserGeomGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions owl/cmake/embed_ptx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions owl/cmake/owlConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
16 changes: 10 additions & 6 deletions owl/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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<Texture>();
assert(texture);
return texture->getObject(deviceID);
return (cudaTextureObject_t)texture->getObject(deviceID);
}

OWL_API owl2ui
Expand Down Expand Up @@ -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<LaunchParams>();
assert(lp);
return lp->getCudaStream(lp->context->getDevice(deviceID));
return (cudaTextureObject_t)lp->getCudaStream(lp->context->getDevice(deviceID));
}

OWL_API void
Expand Down