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
28 changes: 25 additions & 3 deletions CSGOptiX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,31 @@ target_include_directories(${OPTIX_PTX_TARGET} PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/CSG>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/sysrap>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/qudarap>)
target_compile_definitions(${OPTIX_PTX_TARGET} PUBLIC WITH_PRD WITH_SIMULATE WITH_SIMTRACE WITH_RENDER
OPTICKS_CSGOPTIX WITH_THRUST OPTICKS_CSG WITH_CONTIGUOUS WITH_S_BB CONFIG_Debug OPTICKS_SYSRAP
PLOG_LOCAL RNG_PHILOX DEBUG_TAG DEBUG_PIDX DEBUG_PIDXYZ OPTICKS_OKCONF OPTICKS_QUDARAP NVCC)
target_compile_definitions(${OPTIX_PTX_TARGET}
PUBLIC
WITH_PRD
WITH_SIMULATE
WITH_SIMTRACE
WITH_RENDER
OPTICKS_CSGOPTIX
WITH_THRUST
OPTICKS_CSG
WITH_CONTIGUOUS
WITH_S_BB
$<$<CONFIG:Debug>:CONFIG_Debug>
$<$<CONFIG:RelWithDebInfo>:CONFIG_RelWithDebInfo>
$<$<CONFIG:Release>:CONFIG_Release>
$<$<CONFIG:MinSizeRel>:CONFIG_MinSizeRel>
OPTICKS_SYSRAP
PLOG_LOCAL
RNG_PHILOX
$<$<CONFIG:Debug>:DEBUG_TAG>
$<$<CONFIG:Debug>:DEBUG_PIDX>
$<$<CONFIG:Debug>:DEBUG_PIDXYZ>
$<$<CONFIG:Release>:PRODUCTION>
Comment on lines +46 to +56

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use config-specific PTX output paths

When using a multi-config generator, these config-specific definitions make the Debug and Release PTX semantically different, but csgoptix_ptx still copies every config to the single ${PROJECT_BINARY_DIR}/ptx/CSGOptiX7.ptx and sysrap/config_path.h.in:4 makes runtime lookup use that shared directory. After building one config and then running a binary from another, the binary loads whichever PTX was copied last, so Release can still run non-PRODUCTION PTX or Debug can silently lose the DEBUG_* instrumentation. Please include the config in the PTX output/search path or otherwise keep the artifacts separate.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created an issue to be addressed later

OPTICKS_OKCONF
OPTICKS_QUDARAP
NVCC)
target_link_libraries(${OPTIX_PTX_TARGET} PUBLIC OptiX::OptiX)

get_filename_component(ptx_stem "${OPTIX_PTX_SRC}" NAME_WE)
Expand Down
6 changes: 4 additions & 2 deletions qudarap/qsim.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Canonical use is from CSGOptiX/CSGOptiX7.cu:simulate

#if defined(__CUDACC__) || defined(__CUDABE__)
#define QSIM_METHOD __device__
#define QSIM_FORCEINLINE_METHOD __device__ __forceinline__
#else
#define QSIM_METHOD
#define QSIM_FORCEINLINE_METHOD inline
#endif

#include "OpticksGenstep.h"
Expand Down Expand Up @@ -125,7 +127,7 @@ struct qsim
QSIM_METHOD void reflect_specular( RNG& rng, sctx& ctx );

QSIM_METHOD void fake_propagate( sphoton& p, const quad2* mock_prd, RNG& rng, unsigned long long idx );
QSIM_METHOD int propagate(const int bounce, RNG& rng, sctx& ctx );
QSIM_FORCEINLINE_METHOD int propagate(const int bounce, RNG& rng, sctx& ctx);

QSIM_METHOD void hemisphere_polarized( unsigned polz, bool inwards, RNG& rng, sctx& ctx );
QSIM_METHOD void generate_photon_simtrace( quad4& p, RNG& rng, const quad6& gs, unsigned long long photon_id, unsigned genstep_id ) const ;
Expand Down Expand Up @@ -2121,7 +2123,7 @@ Prior to supporting special surfaces, within the command == BOUNDARY used::

**/

inline QSIM_METHOD int qsim::propagate(const int bounce, RNG& rng, sctx& ctx ) // ::simulate
QSIM_FORCEINLINE_METHOD int qsim::propagate(const int bounce, RNG& rng, sctx& ctx)
{
const unsigned boundary = ctx.prd->boundary() ;
const unsigned identity = ctx.prd->identity() ; // sensor_identifier+1, 0:not-a-sensor
Expand Down
Loading