2016-06-16 23:39:51 +00:00
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##
2017-09-20 21:33:44 +00:00
## Copyright 2016 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
2016-06-16 23:39:51 +00:00
## Copyright 2016 UT-Battelle, LLC.
## Copyright 2016 Los Alamos National Security.
##
2017-09-20 21:33:44 +00:00
## Under the terms of Contract DE-NA0003525 with NTESS,
2016-06-16 23:39:51 +00:00
## the U.S. Government retains certain rights in this software.
##
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
## Laboratory (LANL), the U.S. Government retains certain rights in
## this software.
##============================================================================
# This file provides all the component-specific configuration. To add a
# component to this list, first add the name of the component to
# VTKm_AVAILABLE_COMPONENTS. Then add a macro (or function) named
# vtkm_configure_component_<name> that configures the given component. At a
# minimum, this macro should set (or clear) the variable VTKm_<name>_FOUND. It
# should also modify other apropos variables such as VTKm_INCLUDE_DIRS and
# VTKm_LIBRARIES.
#
# Components generally rely on other components, and should call
# vtkm_configure_component_<name> for those components as necessary.
#
# Any component configuration added to VTKm_AVAILABLE_COMPONENTS will
# automatically be added to the components available to find_package(VTKm).
#
set ( VTKm_AVAILABLE_COMPONENTS
B a s e
S e r i a l
O p e n G L
O S M e s a
2016-06-20 23:08:11 +00:00
E G L
2016-08-24 20:22:48 +00:00
G L F W
2016-10-03 21:55:34 +00:00
G L U T
2016-08-25 23:54:32 +00:00
R e n d e r i n g
2016-06-16 23:39:51 +00:00
T B B
C U D A
)
2016-09-07 15:25:46 +00:00
#-----------------------------------------------------------------------------
# Support function for giving status messages on component configurations
#-----------------------------------------------------------------------------
set ( VTKm_CONFIGURE_COMPONENT_MESSAGES "" CACHE INTERNAL "" FORCE )
function ( vtkm_configure_component_message message_text )
if ( NOT VTKm_CONFIGURE_QUIET )
list ( FIND VTKm_CONFIGURE_COMPONENT_MESSAGES "${message_text}" in_list )
if ( in_list EQUAL -1 )
message ( STATUS "${message_text}" )
2017-04-13 19:34:08 +00:00
set ( VTKm_CONFIGURE_COMPONENT_MESSAGES "${VTKm_CONFIGURE_COMPONENT_MESSAGES} ${message_text}"
C A C H E S T R I N G " " F O R C E )
2016-09-07 15:25:46 +00:00
endif ( )
endif ( )
endfunction ( vtkm_configure_component_message )
2016-06-16 23:39:51 +00:00
#-----------------------------------------------------------------------------
# Support function for making vtkm_configure_component<name> functions.
#-----------------------------------------------------------------------------
2016-06-21 23:40:30 +00:00
macro ( vtkm_finish_configure_component component )
if ( NOT VTKm_ ${ component } _FOUND )
cmake_parse_arguments ( VTKm_FCC
2017-01-26 20:19:02 +00:00
" I S _ B A C K E N D "
2016-06-21 23:40:30 +00:00
" "
" D E P E N D E N T _ V A R I A B L E S ; A D D _ I N C L U D E S ; A D D _ L I B R A R I E S "
$ { A R G N }
)
set ( VTKm_ ${ component } _FOUND TRUE )
foreach ( var ${ VTKm_FCC_DEPENDENT_VARIABLES } )
if ( NOT ${ var } )
set ( VTKm_ ${ component } _FOUND )
2016-09-07 15:25:46 +00:00
vtkm_configure_component_message (
" F a i l e d t o c o n f i g u r e V T K - m c o m p o n e n t $ { c o m p o n e n t } : ! $ { v a r } " )
2016-06-21 23:43:59 +00:00
break ( )
2016-06-21 23:40:30 +00:00
endif ( )
endforeach ( var )
if ( VTKm_ ${ component } _FOUND )
set ( VTKm_INCLUDE_DIRS ${ VTKm_INCLUDE_DIRS } ${ VTKm_FCC_ADD_INCLUDES } )
set ( VTKm_LIBRARIES ${ VTKm_LIBRARIES } ${ VTKm_FCC_ADD_LIBRARIES } )
2017-01-26 20:19:02 +00:00
if ( ${ VTKm_FCC_IS_BACKEND } )
set ( VTKm_BACKEND_INCLUDE_DIRS ${ VTKm_BACKEND_INCLUDE_DIRS } ${ VTKm_FCC_ADD_INCLUDES } )
set ( VTKm_BACKEND_LIBRARIES ${ VTKm_BACKEND_LIBRARIES } ${ VTKm_FCC_ADD_LIBRARIES } )
endif ( )
2016-06-16 23:39:51 +00:00
endif ( )
endif ( )
2016-06-21 23:40:30 +00:00
endmacro ( )
2016-06-16 23:39:51 +00:00
#-----------------------------------------------------------------------------
# The configuration macros
#-----------------------------------------------------------------------------
macro ( vtkm_configure_component_Base )
2016-08-03 20:07:21 +00:00
# Set up the compiler flag optimizations
if ( NOT VTKm_Vectorization_flags_added )
include ( VTKmCompilerOptimizations )
endif ( )
2017-11-28 20:32:00 +00:00
# For now, MPI support is a compile time option.
if ( VTKm_ENABLE_MPI )
if ( NOT MPI_C_FOUND )
find_package ( MPI ${ VTKm_FIND_PACKAGE_QUIETLY } )
endif ( )
endif ( )
2018-01-30 00:24:31 +00:00
# Check for the existence of the base vtkm target
2016-09-29 18:06:07 +00:00
if ( TARGET vtkm )
set ( VTKm_base_vtkm_target_FOUND True )
endif ( )
2016-06-16 23:39:51 +00:00
vtkm_finish_configure_component ( Base
2016-10-21 12:37:30 +00:00
D E P E N D E N T _ V A R I A B L E S V T K m _ b a s e _ v t k m _ t a r g e t _ F O U N D
2016-12-16 21:51:04 +00:00
A D D _ L I B R A R I E S v t k m v t k m _ c o n t
2016-06-16 23:39:51 +00:00
)
endmacro ( )
macro ( vtkm_configure_component_Serial )
vtkm_configure_component_Base ( )
vtkm_finish_configure_component ( Serial
2017-01-26 20:19:02 +00:00
I S _ B A C K E N D
2016-06-16 23:39:51 +00:00
D E P E N D E N T _ V A R I A B L E S V T K m _ B a s e _ F O U N D
)
endmacro ( vtkm_configure_component_Serial )
macro ( vtkm_configure_component_OpenGL )
2016-09-07 15:02:17 +00:00
# OpenGL configuration "depends" on OSMesa because if OSMesa is used, then it
# (sometimes) requires its own version of OpenGL. The find_package for OpenGL
# is smart enough to configure this correctly if OSMesa is found first. Thus,
# we ensure that OSMesa is configured before OpenGL (assuming you are using
# the VTK-m configuration). However, the OpenGL configuration can still
# succeed even if the OSMesa configuration fails.
vtkm_configure_component_OSMesa ( )
2016-06-16 23:39:51 +00:00
2016-09-09 21:01:17 +00:00
if ( NOT VTKm_OSMesa_FOUND )
find_package ( OpenGL ${ VTKm_FIND_PACKAGE_QUIETLY } )
2016-06-16 23:39:51 +00:00
2016-10-03 22:46:13 +00:00
set ( vtkm_opengl_dependent_vars VTKm_Base_FOUND OPENGL_FOUND )
set ( vtkm_opengl_includes ${ OPENGL_INCLUDE_DIR } )
set ( vtkm_opengl_libraries ${ OPENGL_LIBRARIES } )
2016-09-09 21:01:17 +00:00
else ( )
# OSMesa comes with its own implementation of OpenGL. So if OSMesa has been
# found, then simply report that OpenGL has been found and use the includes
# and libraries already added for OSMesa.
2016-10-03 22:46:13 +00:00
set ( vtkm_opengl_dependent_vars )
set ( vtkm_opengl_includes )
set ( vtkm_opengl_libraries )
2016-09-09 21:01:17 +00:00
endif ( )
2016-10-03 22:46:13 +00:00
# Many OpenGL classes in VTK-m require GLEW (too many to try to separate them
# out and still get something worth using). So require that too.
find_package ( GLEW ${ VTKm_FIND_PACKAGE_QUIETLY } )
list ( APPEND vtkm_opengl_dependent_vars GLEW_FOUND )
2017-01-26 20:19:02 +00:00
if ( GLEW_FOUND )
list ( APPEND vtkm_opengl_includes ${ GLEW_INCLUDE_DIRS } )
list ( APPEND vtkm_opengl_libraries ${ GLEW_LIBRARIES } )
endif ( )
2016-10-03 22:46:13 +00:00
#on unix/linux Glew uses pthreads, so we need to find that, and link to it
#explicitly or else in release mode we get sigsegv on launch
if ( UNIX )
find_package ( Threads ${ VTKm_FIND_PACKAGE_QUIETLY } )
list ( APPEND vtkm_opengl_libraries ${ CMAKE_THREAD_LIBS_INIT } )
2016-09-09 21:01:17 +00:00
endif ( )
2016-10-03 22:46:13 +00:00
vtkm_finish_configure_component ( OpenGL
D E P E N D E N T _ V A R I A B L E S $ { v t k m _ o p e n g l _ d e p e n d e n t _ v a r s }
A D D _ I N C L U D E S $ { v t k m _ o p e n g l _ i n c l u d e s }
A D D _ L I B R A R I E S $ { v t k m _ o p e n g l _ l i b r a r i e s }
)
2017-01-26 20:19:02 +00:00
2017-07-09 17:30:58 +00:00
#setting VTKm_OPENGL_INCLUDE_DIRS when both mesa and
#opengl are not present causes cmake to fail to configure
2018-01-30 00:24:31 +00:00
#because of a perceived dependency in the rendering lib
2017-07-09 17:30:58 +00:00
if ( VTKm_OSMesa_FOUND OR OPENGL_FOUND )
set ( VTKm_OPENGL_INCLUDE_DIRS ${ vtkm_opengl_includes } )
set ( VTKm_OPENGL_LIBRARIES ${ vtkm_opengl_libraries } )
endif ( )
2017-01-26 20:19:02 +00:00
2016-06-16 23:39:51 +00:00
endmacro ( vtkm_configure_component_OpenGL )
macro ( vtkm_configure_component_OSMesa )
2016-09-07 15:02:17 +00:00
vtkm_configure_component_Base ( )
2016-06-16 23:39:51 +00:00
2016-09-09 20:50:31 +00:00
if ( VTKm_ENABLE_OSMESA )
2016-07-28 14:46:59 +00:00
find_package ( MESA ${ VTKm_FIND_PACKAGE_QUIETLY } )
2016-06-16 23:39:51 +00:00
vtkm_finish_configure_component ( OSMesa
2016-08-09 01:57:38 +00:00
D E P E N D E N T _ V A R I A B L E S O S M E S A _ F O U N D
2016-06-16 23:39:51 +00:00
A D D _ I N C L U D E S $ { O S M E S A _ I N C L U D E _ D I R }
A D D _ L I B R A R I E S $ { O S M E S A _ L I B R A R Y }
)
endif ( )
endmacro ( vtkm_configure_component_OSMesa )
2016-06-20 23:08:11 +00:00
macro ( vtkm_configure_component_EGL )
vtkm_configure_component_OpenGL ( )
2016-07-28 14:46:59 +00:00
find_package ( EGL ${ VTKm_FIND_PACKAGE_QUIETLY } )
2016-06-20 23:08:11 +00:00
2016-06-21 23:40:30 +00:00
vtkm_finish_configure_component ( EGL
2016-06-20 23:08:11 +00:00
D E P E N D E N T _ V A R I A B L E S V T K m _ O p e n G L _ F O U N D E G L _ F O U N D
2017-01-27 15:02:46 +00:00
A D D _ I N C L U D E S $ { E G L _ I N C L U D E _ D I R S }
A D D _ L I B R A R I E S $ { E G L _ L I B R A R I E S }
2016-06-20 23:08:11 +00:00
)
endmacro ( vtkm_configure_component_EGL )
2016-08-24 20:22:48 +00:00
macro ( vtkm_configure_component_GLFW )
vtkm_configure_component_OpenGL ( )
find_package ( GLFW ${ VTKm_FIND_PACKAGE_QUIETLY } )
vtkm_finish_configure_component ( GLFW
D E P E N D E N T _ V A R I A B L E S V T K m _ O p e n G L _ F O U N D G L F W _ F O U N D
2017-01-27 15:02:46 +00:00
A D D _ I N C L U D E S $ { G L F W _ I N C L U D E _ D I R S }
A D D _ L I B R A R I E S $ { G L F W _ L I B R A R I E S }
2016-08-24 20:22:48 +00:00
)
endmacro ( vtkm_configure_component_GLFW )
2016-10-03 21:55:34 +00:00
macro ( vtkm_configure_component_GLUT )
2016-06-16 23:39:51 +00:00
vtkm_configure_component_OpenGL ( )
2016-10-03 21:55:34 +00:00
find_package ( GLUT ${ VTKm_FIND_PACKAGE_QUIETLY } )
2016-06-16 23:39:51 +00:00
2016-10-03 21:55:34 +00:00
vtkm_finish_configure_component ( GLUT
D E P E N D E N T _ V A R I A B L E S V T K m _ O p e n G L _ F O U N D G L U T _ F O U N D
A D D _ I N C L U D E S $ { G L U T _ I N C L U D E _ D I R }
2016-10-03 22:46:13 +00:00
A D D _ L I B R A R I E S $ { G L U T _ L I B R A R I E S }
2016-06-16 23:39:51 +00:00
)
2016-10-03 21:55:34 +00:00
endmacro ( vtkm_configure_component_GLUT )
2016-08-25 23:54:32 +00:00
macro ( vtkm_configure_component_Rendering )
2016-09-15 15:27:48 +00:00
if ( VTKm_ENABLE_RENDERING )
2016-08-25 23:54:32 +00:00
vtkm_configure_component_OpenGL ( )
vtkm_configure_component_EGL ( )
vtkm_configure_component_OSMesa ( )
endif ( )
vtkm_finish_configure_component ( Rendering
2016-09-15 15:27:48 +00:00
D E P E N D E N T _ V A R I A B L E S V T K m _ E N A B L E _ R E N D E R I N G V T K m _ B a s e _ F O U N D
2016-10-31 19:16:36 +00:00
A D D _ L I B R A R I E S v t k m _ r e n d e r i n g
2016-08-25 23:54:32 +00:00
)
endmacro ( vtkm_configure_component_Rendering )
2016-06-16 23:39:51 +00:00
macro ( vtkm_configure_component_TBB )
2016-06-21 23:43:59 +00:00
if ( VTKm_ENABLE_TBB )
vtkm_configure_component_Base ( )
2016-06-16 23:39:51 +00:00
2016-07-28 14:46:59 +00:00
find_package ( TBB ${ VTKm_FIND_PACKAGE_QUIETLY } )
2016-06-21 23:43:59 +00:00
endif ( )
2016-06-16 23:39:51 +00:00
vtkm_finish_configure_component ( TBB
2017-01-26 20:19:02 +00:00
I S _ B A C K E N D
2016-06-21 23:43:59 +00:00
D E P E N D E N T _ V A R I A B L E S V T K m _ E N A B L E _ T B B V T K m _ B a s e _ F O U N D T B B _ F O U N D
2016-06-16 23:39:51 +00:00
A D D _ I N C L U D E S $ { T B B _ I N C L U D E _ D I R S }
A D D _ L I B R A R I E S $ { T B B _ L I B R A R I E S }
)
endmacro ( vtkm_configure_component_TBB )
macro ( vtkm_configure_component_CUDA )
2016-06-21 23:43:59 +00:00
if ( VTKm_ENABLE_CUDA )
vtkm_configure_component_Base ( )
2016-07-28 14:46:59 +00:00
find_package ( CUDA ${ VTKm_FIND_PACKAGE_QUIETLY } )
2017-01-24 22:38:59 +00:00
#Make cuda link privately to cuda libraries
set ( CUDA_LIBRARIES PRIVATE ${ CUDA_LIBRARIES } )
2016-06-21 23:43:59 +00:00
mark_as_advanced (
C U D A _ B U I L D _ C U B I N
C U D A _ B U I L D _ E M U L A T I O N
C U D A _ H O S T _ C O M P I L E R
C U D A _ S D K _ R O O T _ D I R
C U D A _ S E P A R A B L E _ C O M P I L A T I O N
C U D A _ T O O L K I T _ R O O T _ D I R
C U D A _ V E R B O S E _ B U I L D
)
2016-06-16 23:39:51 +00:00
2016-07-28 14:46:59 +00:00
find_package ( Thrust ${ VTKm_FIND_PACKAGE_QUIETLY } )
2016-06-21 23:43:59 +00:00
endif ( )
2016-06-16 23:39:51 +00:00
vtkm_finish_configure_component ( CUDA
2017-01-26 20:19:02 +00:00
I S _ B A C K E N D
2016-06-16 23:39:51 +00:00
D E P E N D E N T _ V A R I A B L E S
2016-06-21 23:43:59 +00:00
V T K m _ E N A B L E _ C U D A
2016-06-16 23:39:51 +00:00
V T K m _ B a s e _ F O U N D
C U D A _ F O U N D
T H R U S T _ F O U N D
A D D _ I N C L U D E S $ { T H R U S T _ I N C L U D E _ D I R S }
)
if ( VTKm_CUDA_FOUND )
#---------------------------------------------------------------------------
2016-08-29 18:26:26 +00:00
# Setup build flags for CUDA to have C++11 support
#---------------------------------------------------------------------------
2016-09-01 18:30:52 +00:00
if ( NOT MSVC )
2016-09-23 14:08:21 +00:00
if ( NOT "--std" IN_LIST CUDA_NVCC_FLAGS )
list ( APPEND CUDA_NVCC_FLAGS --std c++11 )
endif ( )
2016-09-01 18:30:52 +00:00
endif ( )
2016-08-29 18:26:26 +00:00
2016-06-16 23:39:51 +00:00
#---------------------------------------------------------------------------
# Populates CUDA_NVCC_FLAGS with the best set of flags to compile for a
# given GPU architecture. The majority of developers should leave the
# option at the default of 'native' which uses system introspection to
# determine the smallest numerous of virtual and real architectures it
# should target.
#
# The option of 'all' is provided for people generating libraries that
# will deployed to any number of machines, it will compile all CUDA code
# for all major virtual architectures, guaranteeing that the code will run
# anywhere.
#
#
# 1 - native
# - Uses system introspection to determine compile flags
# 2 - fermi
2017-05-15 18:26:54 +00:00
# - Uses: --generate-code=arch=compute_20,code=compute_20
2016-06-16 23:39:51 +00:00
# 3 - kepler
2017-05-15 18:26:54 +00:00
# - Uses: --generate-code=arch=compute_30,code=compute_30
# - Uses: --generate-code=arch=compute_35,code=compute_35
2016-06-16 23:39:51 +00:00
# 4 - maxwell
2017-05-15 18:26:54 +00:00
# - Uses: --generate-code=arch=compute_50,code=compute_50
# - Uses: --generate-code=arch=compute_52,code=compute_52
2016-09-21 19:07:34 +00:00
# 5 - pascal
2017-05-15 18:26:54 +00:00
# - Uses: --generate-code=arch=compute_60,code=compute_60
# - Uses: --generate-code=arch=compute_61,code=compute_61
2017-08-10 13:41:12 +00:00
# 6 - volta
# - Uses: --generate-code=arch=compute_70,code=compute_70
# 7 - all
2017-05-15 18:26:54 +00:00
# - Uses: --generate-code=arch=compute_20,code=compute_20
# - Uses: --generate-code=arch=compute_30,code=compute_30
# - Uses: --generate-code=arch=compute_35,code=compute_35
# - Uses: --generate-code=arch=compute_50,code=compute_50
# - Uses: --generate-code=arch=compute_52,code=compute_52
# - Uses: --generate-code=arch=compute_60,code=compute_60
# - Uses: --generate-code=arch=compute_61,code=compute_61
2017-08-10 13:41:12 +00:00
# - Uses: --generate-code=arch=compute_70,code=compute_70
2016-06-16 23:39:51 +00:00
#
#specify the property
set ( VTKm_CUDA_Architecture "native" CACHE STRING "Which GPU Architecture(s) to compile for" )
2017-08-10 13:41:12 +00:00
set_property ( CACHE VTKm_CUDA_Architecture PROPERTY STRINGS native fermi kepler maxwell pascal volta all )
2016-06-16 23:39:51 +00:00
2018-01-30 00:24:31 +00:00
#detect what the property is set too
2016-06-16 23:39:51 +00:00
if ( VTKm_CUDA_Architecture STREQUAL "native" )
2016-09-19 18:58:18 +00:00
if ( VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT )
#Use the cached value
2016-09-21 19:07:34 +00:00
list ( APPEND CUDA_NVCC_FLAGS ${ VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT } )
2016-09-19 18:58:18 +00:00
else ( )
2016-09-09 18:11:45 +00:00
2016-08-05 19:41:55 +00:00
#run execute_process to do auto_detection
2016-09-09 18:11:45 +00:00
if ( CMAKE_GENERATOR MATCHES "Visual Studio" )
2016-09-21 19:07:34 +00:00
set ( args "-ccbin" "${CMAKE_CXX_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu" )
2017-04-13 19:34:08 +00:00
elseif ( CUDA_HOST_COMPILER )
2016-09-21 19:07:34 +00:00
set ( args "-ccbin" "${CUDA_HOST_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu" )
2017-04-13 19:34:08 +00:00
else ( )
set ( args "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu" )
2016-09-09 18:11:45 +00:00
endif ( )
2016-08-05 19:41:55 +00:00
execute_process (
2016-09-09 18:11:45 +00:00
C O M M A N D $ { C U D A _ N V C C _ E X E C U T A B L E } $ { a r g s }
2016-08-05 19:41:55 +00:00
R E S U L T _ V A R I A B L E r a n _ p r o p e r l y
O U T P U T _ V A R I A B L E r u n _ o u t p u t
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } )
2017-04-13 19:34:08 +00:00
2016-08-05 19:41:55 +00:00
if ( ran_properly EQUAL 0 )
#find the position of the "--generate-code" output. With some compilers such as
#msvc we get compile output plus run output. So we need to strip out just the
#run output
string ( FIND "${run_output}" "--generate-code" position )
string ( SUBSTRING "${run_output}" ${ position } -1 run_output )
2016-09-19 18:58:18 +00:00
2016-09-21 19:07:34 +00:00
list ( APPEND CUDA_NVCC_FLAGS ${ run_output } )
2016-09-19 18:58:18 +00:00
set ( VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT ${ run_output } CACHE INTERNAL
" d e v i c e type ( s ) f o r c u d a [ n a t i v e ] " )
2016-08-05 19:41:55 +00:00
else ( )
set ( VTKm_CUDA_Architecture "fermi" )
2017-04-13 19:34:08 +00:00
vtkm_configure_component_message ( "Unable to run ${CUDA_NVCC_EXECUTABLE} to autodetect GPU architecture. Falling back to fermi, please manually specify if you want something else." )
2016-07-28 14:46:59 +00:00
endif ( )
2016-06-16 23:39:51 +00:00
endif ( )
endif ( )
#since when we are native we can fail, and fall back to "fermi" these have
#to happen after, and separately of the native check
if ( VTKm_CUDA_Architecture STREQUAL "fermi" )
2017-05-25 21:04:07 +00:00
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_20,code=compute_20" )
2016-06-16 23:39:51 +00:00
elseif ( VTKm_CUDA_Architecture STREQUAL "kepler" )
2017-05-25 21:04:07 +00:00
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_30,code=compute_30" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_35,code=compute_35" )
2016-06-16 23:39:51 +00:00
elseif ( VTKm_CUDA_Architecture STREQUAL "maxwell" )
2017-05-25 21:04:07 +00:00
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_50,code=compute_50" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_52,code=compute_52" )
2016-09-21 19:07:34 +00:00
elseif ( VTKm_CUDA_Architecture STREQUAL "pascal" )
2017-05-25 21:04:07 +00:00
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_60,code=compute_60" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_61,code=compute_61" )
2017-08-10 13:41:12 +00:00
elseif ( VTKm_CUDA_Architecture STREQUAL "volta" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_70,code=compute_70" )
2016-06-16 23:39:51 +00:00
elseif ( VTKm_CUDA_Architecture STREQUAL "all" )
2017-05-25 21:04:07 +00:00
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_20,code=compute_20" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_30,code=compute_30" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_35,code=compute_35" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_50,code=compute_50" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_52,code=compute_52" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_60,code=compute_60" )
list ( APPEND CUDA_NVCC_FLAGS "--generate-code=arch=compute_61,code=compute_61" )
2016-06-16 23:39:51 +00:00
endif ( )
2016-06-23 16:31:07 +00:00
if ( WIN32 )
# On Windows, there is an issue with performing parallel builds with
# nvcc. Multiple compiles can attempt to write the same .pdb file. Add
# this argument to avoid this problem.
set ( CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --compiler-options /FS" )
endif ( )
2016-06-16 23:39:51 +00:00
endif ( )
endmacro ( vtkm_configure_component_CUDA )