adding code to Linux-only samples to guard against building on Windows

This commit is contained in:
Jonathan Bentz 2024-12-18 14:36:12 -06:00
parent fcd39008ec
commit f9dd4323af
11 changed files with 158 additions and 117 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

@ -1,33 +1,34 @@
add_subdirectory(EGLStream_CUDA_CrossGPU) cmake_minimum_required(VERSION 3.20)
add_subdirectory(EGLStream_CUDA_Interop)
#add_subdirectory(EGLSync_CUDAEvent_Interop) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
add_subdirectory(FunctionPointers)
add_subdirectory(MC_EstimatePiInlineP) project(streamOrderedAllocationIPC LANGUAGES C CXX CUDA)
add_subdirectory(MC_EstimatePiInlineQ)
add_subdirectory(MC_EstimatePiP) find_package(CUDAToolkit REQUIRED)
add_subdirectory(MC_EstimatePiQ)
add_subdirectory(MC_SingleAsianOptionP) set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
add_subdirectory(boxFilter) if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_subdirectory(convolutionSeparable) # set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
add_subdirectory(convolutionTexture) endif()
add_subdirectory(dct8x8)
add_subdirectory(eigenvalues) # Include directories and libraries
add_subdirectory(histogram) include_directories(../../../Common)
add_subdirectory(imageDenoising)
add_subdirectory(inlinePTX) if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_subdirectory(inlinePTX_nvrtc) # Source file
add_subdirectory(interval) # Add target for streamOrderedAllocationIPC
add_subdirectory(particles) add_executable(streamOrderedAllocationIPC streamOrderedAllocationIPC.cu ../../../Common/helper_multiprocess.cpp)
add_subdirectory(radixSortThrust)
add_subdirectory(reduction) target_compile_options(streamOrderedAllocationIPC PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
add_subdirectory(reductionMultiBlockCG)
add_subdirectory(scalarProd) target_compile_features(streamOrderedAllocationIPC PRIVATE cxx_std_17 cuda_std_17)
add_subdirectory(scan)
add_subdirectory(segmentationTreeThrust) set_target_properties(streamOrderedAllocationIPC PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
add_subdirectory(shfl_scan)
add_subdirectory(sortingNetworks) target_link_libraries(streamOrderedAllocationIPC PUBLIC
add_subdirectory(streamOrderedAllocation) CUDA::cuda_driver
add_subdirectory(streamOrderedAllocationIPC) )
add_subdirectory(streamOrderedAllocationP2P) else()
add_subdirectory(threadFenceReduction) message(STATUS "Will not build sample streamOrderedAllocationIPC - requires Linux OS")
add_subdirectory(threadMigration) endif()

View File

@ -16,6 +16,7 @@ include_directories(../../../Common)
find_package(EGL) find_package(EGL)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file # Source file
if(${EGL_FOUND}) if(${EGL_FOUND})
# Add target for EGLStream_CUDA_CrossGPU # Add target for EGLStream_CUDA_CrossGPU
@ -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() endif()
else()
message(STATUS "Will not build sample EGLStream_CUDA_CrossGPU - requires Linux OS")
endif()

View File

@ -16,6 +16,7 @@ include_directories(../../../Common)
find_package(EGL) find_package(EGL)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file # Source file
if(${EGL_FOUND}) if(${EGL_FOUND})
# Add target for EGLStream_CUDA_Interop # Add target for EGLStream_CUDA_Interop
@ -40,3 +41,6 @@ target_compile_features(EGLStream_CUDA_Interop PRIVATE cxx_std_17 cuda_std_17)
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() endif()
else()
message(STATUS "Will not build sample EGLStream_CUDA_Interop - requires Linux OS")
endif()

View File

@ -18,6 +18,7 @@ find_package(EGL)
find_package(X11) find_package(X11)
find_package(OpenGL) find_package(OpenGL)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Source file # Source file
if(${OpenGL_FOUND}) if(${OpenGL_FOUND})
if(${EGL_FOUND}) if(${EGL_FOUND})
@ -54,3 +55,6 @@ target_compile_features(EGLSync_CUDAEvent_Interop PRIVATE cxx_std_17 cuda_std_17
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() endif()
else()
message(STATUS "Will not build sample streamOrderedAllocationIPC - 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 StreamPriorities # Add target for StreamPriorities
add_executable(StreamPriorities StreamPriorities.cu) add_executable(StreamPriorities StreamPriorities.cu)
@ -23,3 +24,8 @@ target_compile_options(StreamPriorities PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--ext
target_compile_features(StreamPriorities PRIVATE cxx_std_17 cuda_std_17) target_compile_features(StreamPriorities PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(StreamPriorities PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(StreamPriorities PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
else()
message(STATUS "Will not build sample StreamPriorities - 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 simpleCUFFT_callback # Add target for simpleCUFFT_callback
add_executable(simpleCUFFT_callback simpleCUFFT_callback.cu) add_executable(simpleCUFFT_callback simpleCUFFT_callback.cu)
@ -27,3 +28,6 @@ set_target_properties(simpleCUFFT_callback PROPERTIES CUDA_SEPARABLE_COMPILATION
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,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 nbody_opengles # Add target for nbody_opengles
add_executable(nbody_opengles nbody_opengles.cu) add_executable(nbody_opengles nbody_opengles.cu)
@ -23,3 +24,6 @@ target_compile_options(nbody_opengles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--exten
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,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 simpleGLES # Add target for simpleGLES
add_executable(simpleGLES simpleGLES.cu) add_executable(simpleGLES simpleGLES.cu)
@ -23,3 +24,6 @@ target_compile_options(simpleGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-
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,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 simpleGLES_EGLOutput # Add target for simpleGLES_EGLOutput
add_executable(simpleGLES_EGLOutput simpleGLES_EGLOutput.cu) add_executable(simpleGLES_EGLOutput simpleGLES_EGLOutput.cu)
@ -23,3 +24,6 @@ target_compile_options(simpleGLES_EGLOutput PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-
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()