Merge pull request #2 from jnbntz/linux_guarding

Guarding Linux-only samples so they only get build on Linux machines
This commit is contained in:
Rob Armstrong 2024-12-19 11:25:13 -08:00 committed by GitHub
commit d9efeae3bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 135 additions and 89 deletions

View File

@ -14,9 +14,9 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file # Source file
# Add target for systemWideAtomics (Linux-only) # Add target for systemWideAtomics
if(NOT WIN32)
add_executable(systemWideAtomics systemWideAtomics.cu) add_executable(systemWideAtomics systemWideAtomics.cu)
target_compile_options(systemWideAtomics PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(systemWideAtomics PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
@ -24,4 +24,7 @@ if(NOT WIN32)
target_compile_features(systemWideAtomics PRIVATE cxx_std_17 cuda_std_17) target_compile_features(systemWideAtomics PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(systemWideAtomics PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(systemWideAtomics PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample systemWideAtomics - requires Linux OS")
endif() endif()

View File

@ -16,14 +16,15 @@ include_directories(../../../Common)
find_package(EGL) find_package(EGL)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(${EGL_FOUND}) # Source file
if(${EGL_FOUND})
# Add target for EGLStream_CUDA_CrossGPU # Add target for EGLStream_CUDA_CrossGPU
add_executable(EGLStream_CUDA_CrossGPU cuda_consumer.cpp cuda_producer.cpp eglstrm_common.cpp kernel.cu main.cpp) add_executable(EGLStream_CUDA_CrossGPU cuda_consumer.cpp cuda_producer.cpp eglstrm_common.cpp kernel.cu main.cpp)
target_compile_options(EGLStream_CUDA_CrossGPU PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(EGLStream_CUDA_CrossGPU PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(EGLStream_CUDA_CrossGPU PRIVATE cxx_std_17 cuda_std_17) target_compile_features(EGLStream_CUDA_CrossGPU PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(EGLStream_CUDA_CrossGPU PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(EGLStream_CUDA_CrossGPU PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -36,7 +37,9 @@ target_compile_features(EGLStream_CUDA_CrossGPU PRIVATE cxx_std_17 cuda_std_17)
${EGL_LIBRARY} ${EGL_LIBRARY}
CUDA::cuda_driver CUDA::cuda_driver
) )
else()
else()
message(STATUS "EGL not found - will not build sample 'EGLStream_CUDA_CrossGPU'") message(STATUS "EGL not found - will not build sample 'EGLStream_CUDA_CrossGPU'")
endif()
else()
message(STATUS "Will not build sample EGLStream_CUDA_CrossGPU - requires Linux OS")
endif() endif()

View File

@ -16,14 +16,15 @@ include_directories(../../../Common)
find_package(EGL) find_package(EGL)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(${EGL_FOUND}) # Source file
if(${EGL_FOUND})
# Add target for EGLStream_CUDA_Interop # Add target for EGLStream_CUDA_Interop
add_executable(EGLStream_CUDA_Interop cuda_consumer.cpp cuda_producer.cpp eglstrm_common.cpp main.cpp) add_executable(EGLStream_CUDA_Interop cuda_consumer.cpp cuda_producer.cpp eglstrm_common.cpp main.cpp)
target_compile_options(EGLStream_CUDA_Interop PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(EGLStream_CUDA_Interop PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(EGLStream_CUDA_Interop PRIVATE cxx_std_17 cuda_std_17) target_compile_features(EGLStream_CUDA_Interop PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(EGLStream_CUDA_Interop PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(EGLStream_CUDA_Interop PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -37,6 +38,9 @@ target_compile_features(EGLStream_CUDA_Interop PRIVATE cxx_std_17 cuda_std_17)
CUDA::cuda_driver CUDA::cuda_driver
) )
else() else()
message(STATUS "EGL not found - will not build sample 'EGLStream_CUDA_Interop'") message(STATUS "EGL not found - will not build sample 'EGLStream_CUDA_Interop'")
endif()
else()
message(STATUS "Will not build sample EGLStream_CUDA_Interop - requires Linux OS")
endif() endif()

View File

@ -18,16 +18,17 @@ find_package(EGL)
find_package(X11) find_package(X11)
find_package(OpenGL) find_package(OpenGL)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(${OpenGL_FOUND}) # Source file
if(${OpenGL_FOUND})
if(${EGL_FOUND}) if(${EGL_FOUND})
if(${X11_FOUND}) if(${X11_FOUND})
# Add target for EGLSync_CUDAEvent_Interop # Add target for EGLSync_CUDAEvent_Interop
add_executable(EGLSync_CUDAEvent_Interop EGLSync_CUDAEvent_Interop.cu) add_executable(EGLSync_CUDAEvent_Interop EGLSync_CUDAEvent_Interop.cu)
target_compile_options(EGLSync_CUDAEvent_Interop PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(EGLSync_CUDAEvent_Interop PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(EGLSync_CUDAEvent_Interop PRIVATE cxx_std_17 cuda_std_17) target_compile_features(EGLSync_CUDAEvent_Interop PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(EGLSync_CUDAEvent_Interop PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(EGLSync_CUDAEvent_Interop PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -51,6 +52,10 @@ target_compile_features(EGLSync_CUDAEvent_Interop PRIVATE cxx_std_17 cuda_std_17
else() else()
message(STATUS "EGL not found - will not build sample 'EGLSync_CUDAEvent_Interop'") message(STATUS "EGL not found - will not build sample 'EGLSync_CUDAEvent_Interop'")
endif() endif()
else() else()
message(STATUS "OpenGL not found - will not build sample 'EGLSync_CUDAEvent_Interop'") message(STATUS "OpenGL not found - will not build sample 'EGLSync_CUDAEvent_Interop'")
endif()
else()
message(STATUS "Will not build sample EGLSync_CUDAEvent_Interop
- requires Linux OS")
endif() endif()

View File

@ -14,16 +14,21 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file # Source file
# Add target for streamOrderedAllocationIPC # Add target for streamOrderedAllocationIPC
add_executable(streamOrderedAllocationIPC streamOrderedAllocationIPC.cu ../../../Common/helper_multiprocess.cpp) add_executable(streamOrderedAllocationIPC streamOrderedAllocationIPC.cu ../../../Common/helper_multiprocess.cpp)
target_compile_options(streamOrderedAllocationIPC PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(streamOrderedAllocationIPC PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(streamOrderedAllocationIPC PRIVATE cxx_std_17 cuda_std_17) target_compile_features(streamOrderedAllocationIPC PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(streamOrderedAllocationIPC PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(streamOrderedAllocationIPC PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(streamOrderedAllocationIPC PUBLIC target_link_libraries(streamOrderedAllocationIPC PUBLIC
CUDA::cuda_driver CUDA::cuda_driver
) )
else()
message(STATUS "Will not build sample streamOrderedAllocationIPC - requires Linux OS")
endif()

View File

@ -14,12 +14,18 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Add target for StreamPriorities # Source file
add_executable(StreamPriorities StreamPriorities.cu) # Add target for StreamPriorities
add_executable(StreamPriorities StreamPriorities.cu)
target_compile_options(StreamPriorities PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(StreamPriorities PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(StreamPriorities PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(StreamPriorities PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample StreamPriorities - requires Linux OS")
endif()
target_compile_features(StreamPriorities PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(StreamPriorities PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

View File

@ -14,16 +14,20 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Add target for simpleCUFFT_callback # Source file
add_executable(simpleCUFFT_callback simpleCUFFT_callback.cu) # Add target for simpleCUFFT_callback
add_executable(simpleCUFFT_callback simpleCUFFT_callback.cu)
target_compile_options(simpleCUFFT_callback PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(simpleCUFFT_callback PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(simpleCUFFT_callback PRIVATE cxx_std_17 cuda_std_17) target_compile_features(simpleCUFFT_callback PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(simpleCUFFT_callback PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(simpleCUFFT_callback PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(simpleCUFFT_callback PRIVATE target_link_libraries(simpleCUFFT_callback PRIVATE
CUDA::cufft CUDA::cufft
) )
else()
message(STATUS "Will not build sample simpleCUFFT_callback - requires Linux OS")
endif()

View File

@ -14,6 +14,7 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file # Source file
# Add target for fluidsGLES # Add target for fluidsGLES
add_executable(fluidsGLES fluidsGLES.cu) add_executable(fluidsGLES fluidsGLES.cu)
@ -23,3 +24,6 @@ target_compile_options(fluidsGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-
target_compile_features(fluidsGLES PRIVATE cxx_std_17 cuda_std_17) target_compile_features(fluidsGLES PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(fluidsGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(fluidsGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample fluidsGLES - requires Linux OS")
endif()

View File

@ -14,12 +14,16 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Add target for nbody_opengles # Source file
add_executable(nbody_opengles nbody_opengles.cu) # Add target for nbody_opengles
add_executable(nbody_opengles nbody_opengles.cu)
target_compile_options(nbody_opengles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(nbody_opengles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(nbody_opengles PRIVATE cxx_std_17 cuda_std_17) target_compile_features(nbody_opengles PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(nbody_opengles PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(nbody_opengles PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample nbody_opengles - requires Linux OS")
endif()

View File

@ -14,12 +14,16 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Add target for simpleGLES # Source file
add_executable(simpleGLES simpleGLES.cu) # Add target for simpleGLES
add_executable(simpleGLES simpleGLES.cu)
target_compile_options(simpleGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(simpleGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(simpleGLES PRIVATE cxx_std_17 cuda_std_17) target_compile_features(simpleGLES PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(simpleGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(simpleGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample simpleGLES - requires Linux OS")
endif()

View File

@ -14,12 +14,16 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)
# Source file if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Add target for simpleGLES_EGLOutput # Source file
add_executable(simpleGLES_EGLOutput simpleGLES_EGLOutput.cu) # Add target for simpleGLES_EGLOutput
add_executable(simpleGLES_EGLOutput simpleGLES_EGLOutput.cu)
target_compile_options(simpleGLES_EGLOutput PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(simpleGLES_EGLOutput PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(simpleGLES_EGLOutput PRIVATE cxx_std_17 cuda_std_17) target_compile_features(simpleGLES_EGLOutput PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(simpleGLES_EGLOutput PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(simpleGLES_EGLOutput PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample simpleGLES_EGLOutput - requires Linux OS")
endif()