Skip to content

Commit

Permalink
Clean up OSL_USE_OPTIX and OSL_USE_BATCHED symbol defs
Browse files Browse the repository at this point in the history
  • Loading branch information
lgritz committed Apr 24, 2023
1 parent 0bd8629 commit f640613
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ endif ()
option (OSL_BUILD_PLUGINS "Bool OSL plugins, for example OIIO plugin" ON)
option (OSL_BUILD_SHADERS "Build shaders" ON)
option (OSL_USE_OPTIX "Include OptiX support" OFF)
message(STATUS "OSL_USE_OPTIX: ${OSL_USE_OPTIX}")
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
set (CUDA_EXTRA_LIBS CACHE STRING "Extra lib targets needed for CUDA")
set (CUDA_TARGET_ARCH "sm_60" CACHE STRING "CUDA GPU architecture (e.g. sm_50)")
Expand Down
4 changes: 2 additions & 2 deletions src/cmake/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ set (USE_BATCHED "" CACHE STRING "Build batched SIMD shader execution for (0, b8
option (VEC_REPORT "Enable compiler's reporting system for vectorization" OFF)
set (BATCHED_SUPPORT_DEFINES "")
set (BATCHED_TARGET_LIBS "")
set (BUILD_BATCHED False)
set (OSL_BUILD_BATCHED 0)
if (NOT USE_BATCHED STREQUAL "")
message (STATUS "Compiling with batched SIMD targets ${USE_BATCHED}")
if (NOT USE_BATCHED STREQUAL "0")
set (BUILD_BATCHED 1)
set (OSL_BUILD_BATCHED 1)
string (REPLACE "," ";" BATCHED_TARGET_LIST ${USE_BATCHED})
foreach (batched_target ${BATCHED_TARGET_LIST})
if (VERBOSE)
Expand Down
4 changes: 2 additions & 2 deletions src/cmake/testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ macro ( TESTSUITE )
ENV TESTSHADE_OPT=2 TESTSHADE_OPTIX=1 )
endif ()

if (BUILD_BATCHED)
if (OSL_BUILD_BATCHED)
# When building for Batched support, also run it in Batched mode
# if there is an BATCHED marker file in the directory.
# If an environment variable $TESTSUITE_BATCHED is nonzero, then
Expand Down Expand Up @@ -397,7 +397,7 @@ macro (osl_add_all_tests)
endif ()

# Some regression tests have a lot of combinations and may need more time to finish
if (BUILD_BATCHED)
if (OSL_BUILD_BATCHED)
set_tests_properties (arithmetic-reg.regress.batched.opt
PROPERTIES TIMEOUT ${OSL_TEST_BIG_TIMEOUT})
set_tests_properties (transform-reg.regress.batched.opt
Expand Down
5 changes: 3 additions & 2 deletions src/include/OSL/oslconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

#pragma once

#define OSL_USE_BATCHED @BUILD_BATCHED@
#define OSL_USE_OPTIX @OSL_USE_OPTIX@
#cmakedefine01 OSL_USE_OPTIX
#cmakedefine01 OSL_BUILD_BATCHED
#define OSL_USE_BATCHED OSL_BUILD_BATCHED


#include <OSL/export.h>
Expand Down
2 changes: 1 addition & 1 deletion src/liboslexec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ set (lib_src
llvm_gen.cpp llvm_instance.cpp llvm_util.cpp
rs_fallback.cpp
)
if (BUILD_BATCHED)
if (OSL_BUILD_BATCHED)
list(APPEND lib_src
batched_analysis.cpp
batched_backendllvm.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/testshade/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set ( testshade_srcs
testshade.cpp
simplerend.cpp )

if (BUILD_BATCHED)
if (OSL_BUILD_BATCHED)
list(APPEND testshade_srcs
batched_simplerend.cpp)
endif()
Expand Down

0 comments on commit f640613

Please sign in to comment.