diff options
| author | Harsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com> | 2025-06-19 15:31:25 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-19 10:01:25 +0000 |
| commit | 23dcea810a79e19051e70ff2aa0b8953429c6461 (patch) | |
| tree | 2143cbc00288bbb1f2791aef0547f3eb53f801d4 /CMakeLists.txt | |
| parent | 5da7301d19e0a293bc2187520b471361beaefe92 (diff) | |
Enabling optix ci pipeline (#7311)
* Revert "Disable OptiX tests by default. (#1331)"
This reverts commit e45f8c1f49855cebe90b6722324ec24146ff5a3d.
* Enable optix submodule to build
Add support for default entry points in compilation
Implemented logic to check for defined entry points in the module
when no explicit entry points are provided. If found, these entry points
are added to the `specializedEntryPoints` list, with the assumption that
no specialization is needed for them at this time.
* Disable optix if cuda is not enabled
* Add submodule OptixSDK path in search
* Distinguish user-explicit vs auto-detected SLANG_ENABLE_OPTIX
When SLANG_ENABLE_OPTIX is explicitly set by user and CUDA is not available,
show SEND_ERROR to maintain strict validation. When OptiX is auto-detected
(e.g., local submodule present) but CUDA unavailable, gracefully disable
with STATUS message to allow builds to continue.
This addresses review feedback to keep error for explicit requests while
handling auto-detection gracefully.
* Apply CMake formatting to SLANG_ENABLE_OPTIX validation logic
* revert: slang-rhi changes
as those are merged independently as in PR # slang-rhi#400
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 144303fae..a57b2190c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,21 @@ auto_option( CUDAToolkit "Enable CUDA tests using CUDA found in CUDA_PATH" ) +# Check if SLANG_ENABLE_OPTIX was explicitly set by user before auto_option +set(_SLANG_ENABLE_OPTIX_USER_SPECIFIED FALSE) +get_property( + _SLANG_ENABLE_OPTIX_CACHE_TYPE + CACHE SLANG_ENABLE_OPTIX + PROPERTY TYPE +) +if( + DEFINED SLANG_ENABLE_OPTIX + AND NOT SLANG_ENABLE_OPTIX STREQUAL "AUTO" + AND _SLANG_ENABLE_OPTIX_CACHE_TYPE STREQUAL "BOOL" +) + set(_SLANG_ENABLE_OPTIX_USER_SPECIFIED TRUE) +endif() + auto_option( SLANG_ENABLE_OPTIX OptiX @@ -350,10 +365,18 @@ if(NOT SLANG_EMBED_CORE_MODULE AND NOT SLANG_EMBED_CORE_MODULE_SOURCE) endif() if(SLANG_ENABLE_OPTIX AND NOT SLANG_ENABLE_CUDA) - message( - SEND_ERROR - "SLANG_ENABLE_OPTIX is not supported without SLANG_ENABLE_CUDA" - ) + if(_SLANG_ENABLE_OPTIX_USER_SPECIFIED) + message( + SEND_ERROR + "SLANG_ENABLE_OPTIX is not supported without SLANG_ENABLE_CUDA" + ) + else() + message( + STATUS + "OptiX is not supported without CUDA. Automatically disabling SLANG_ENABLE_OPTIX." + ) + set(SLANG_ENABLE_OPTIX OFF) + endif() endif() if(SLANG_ENABLE_NVAPI AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows") |
