Updated formatting of documentation plus a little reorganization.

This commit is contained in:
James Bigler 2009-09-23 01:01:51 -04:00
parent fb9d7d3c59
commit b7142e9214
1 changed files with 145 additions and 141 deletions

View File

@ -1,4 +1,4 @@
# - Tools for building C for CUDA files: libraries and build dependencies. # - Tools for building CUDA C files: libraries and build dependencies.
# This script locates the Nvidia Compute Unified Driver Architecture (CUDA) # This script locates the Nvidia Compute Unified Driver Architecture (CUDA)
# tools. It should work on linux, windows, and mac and should be reasonably # tools. It should work on linux, windows, and mac and should be reasonably
# up to date with cuda releases. # up to date with cuda releases.
@ -7,18 +7,25 @@
# REQUIRED and QUIET. CUDA_FOUND will report if an acceptable version of CUDA # REQUIRED and QUIET. CUDA_FOUND will report if an acceptable version of CUDA
# was found. # was found.
# #
# The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR if the # The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR if the prefix
# prefix cannot be determined by the location of nvcc in the system path. To # cannot be determined by the location of nvcc in the system path and REQUIRED
# use a different installed version of the toolkit set the environment variable # is specified to find_package(). To use a different installed version of the
# CUDA_BIN_PATH before running cmake (e.g. CUDA_BIN_PATH=/usr/local/cuda1.0 # toolkit set the environment variable CUDA_BIN_PATH before running cmake
# instead of the default /usr/local/cuda). # (e.g. CUDA_BIN_PATH=/usr/local/cuda1.0 instead of the default
# /usr/local/cuda) or set CUDA_TOOLKIT_ROOT_DIR after configuring.
#
# It might be necessary to set CUDA_TOOLKIT_ROOT_DIR manually on certain
# platforms, or to use a cuda runtime not installed in the default location. In
# newer versions of the toolkit the cuda library is included with the graphics
# driver- be sure that the driver version matches what is needed by the cuda
# runtime version.
# #
# Set CUDA_BUILD_EMULATION to ON for Emulation mode. Defaults to OFF (device # Set CUDA_BUILD_EMULATION to ON for Emulation mode. Defaults to OFF (device
# mode). # mode). -D_DEVICEEMU is defined for CUDA C files when CUDA_BUILD_EMULATION is
# _DEVICEEMU is defined when CUDA_BUILD_EMULATION is TRUE. # TRUE.
# #
# Set CUDA_HOST_COMPILATION_CPP to OFF for C compilation of host code. # Set CUDA_HOST_COMPILATION_CPP to OFF for C compilation of host code. Default
# Default TRUE. # TRUE.
# #
# Set CUDA_BUILD_CUBIN to "ON" or "OFF" to enable and extra compilation pass # Set CUDA_BUILD_CUBIN to "ON" or "OFF" to enable and extra compilation pass
# with the -cubin option in Device mode. The output is parsed and register, # with the -cubin option in Device mode. The output is parsed and register,
@ -71,8 +78,8 @@
# All of the specified source files and generated .cpp files are compiled # All of the specified source files and generated .cpp files are compiled
# using the standard CMake compiler, so the normal INCLUDE_DIRECTORIES, # using the standard CMake compiler, so the normal INCLUDE_DIRECTORIES,
# LINK_DIRECTORIES, and TARGET_LINK_LIBRARIES can be used to affect their # LINK_DIRECTORIES, and TARGET_LINK_LIBRARIES can be used to affect their
# build and link. In addition CUDA_INCLUDE_DIRS is added automatically added # build and link. In addition CUDA_INCLUDE_DIRS is added automatically
# to include_directories(). # added to include_directories().
# #
# CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... # CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
# [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) # [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
@ -89,19 +96,19 @@
# CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... # CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
# [STATIC | SHARED | MODULE] [OPTIONS ...] ) # [STATIC | SHARED | MODULE] [OPTIONS ...] )
# -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, # -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
# CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this function # CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
# under the hood. # function under the hood.
# #
# Given the list of files (file0 file1 ... fileN) this macro generates custom # Given the list of files (file0 file1 ... fileN) this macro generates
# commands that generate either PTX or linkable objects (use "PTX" or "OBJ" # custom commands that generate either PTX or linkable objects (use "PTX" or
# for the format argument to switch. Files that don't end with .cu or have # "OBJ" for the format argument to switch. Files that don't end with .cu or
# the HEADER_FILE_ONLY property are ignored. # have the HEADER_FILE_ONLY property are ignored.
# #
# The arguments passed in after OPTIONS are extra command line options to # The arguments passed in after OPTIONS are extra command line options to
# give to NVCC. You can also specify per configuration options by specifying # give to NVCC. You can also specify per configuration options by
# the name of the configuration followed by the options. General options # specifying the name of the configuration followed by the options. General
# must preceed configuration specific options. Not all configurations need # options must preceed configuration specific options. Not all
# to be specified, only the ones provided will be used. # configurations need to be specified, only the ones provided will be used.
# #
# OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" # OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
# DEBUG -g # DEBUG -g
@ -111,9 +118,9 @@
# #
# For certain configurations (namely VS generating object files with # For certain configurations (namely VS generating object files with
# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will # CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
# be produced for the given cuda file. This is because when you add the cuda # be produced for the given cuda file. This is because when you add the
# file to Visual Studio it knows that this file produces and will link in the # cuda file to Visual Studio it knows that this file produces and will link
# resulting object file automatically. # in the resulting object file automatically.
# #
# This script also looks at optional arguments STATIC, SHARED, or MODULE to # This script also looks at optional arguments STATIC, SHARED, or MODULE to
# override the behavior specified by the value of the CMake variable # override the behavior specified by the value of the CMake variable
@ -136,17 +143,17 @@
# output files will be regenerated. # output files will be regenerated.
# #
# CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) # CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
# -- Adds the cufft library to the target. Handles whether you are in emulation # -- Adds the cufft library to the target. Handles whether you are in
# mode or not. # emulation mode or not.
# #
# CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) # CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
# -- Adds the cublas library to the target. Handles whether you are in emulation # -- Adds the cublas library to the target. Handles whether you are in
# mode or not. # emulation mode or not.
# #
# CUDA_BUILD_CLEAN_TARGET() # CUDA_BUILD_CLEAN_TARGET()
# -- Creates a convience target that deletes all the dependency files generated. # -- Creates a convience target that deletes all the dependency files
# You should make clean after running this target to ensure the dependency # generated. You should make clean after running this target to ensure the
# files get regenerated. # dependency files get regenerated.
# #
# The script defines the following variables: # The script defines the following variables:
# #
@ -176,31 +183,23 @@
# CUDA_ADD_CUBLAS_TO_TARGET macro). # CUDA_ADD_CUBLAS_TO_TARGET macro).
# #
# #
# The script now builds object files instead of generating C files. In order to # The script generates object files by default. In order to facilitate this,
# facilitate this, the script now makes use of the CMAKE_{C,CXX}_FLAGS along # the script makes use of the CMAKE_{C,CXX}_FLAGS along with their configuration
# with their configuration dependent counterparts (i.e. CMAKE_C_FLAGS_DEBUG). # dependent counterparts (i.e. CMAKE_C_FLAGS_DEBUG). These flags are passed
# These flags are passed through nvcc to the native compiler. In addition, on # through nvcc to the native compiler. In addition, on some systems special
# some systems special flags are added for building objects intended for shared # flags are added for building objects intended for shared libraries. FindCUDA
# libraries. FindCUDA make use of the CMake variable BUILD_SHARED_LIBS and the # make use of the CMake variable BUILD_SHARED_LIBS and the usual STATIC, SHARED,
# usual STATIC, SHARED, and MODULE arguments to determine if these flags should # and MODULE arguments to determine if these flags should be used. Please set
# be used. Please set BUILD_SHARED_LIBS or pass in STATIC, SHARED, or MODULE # BUILD_SHARED_LIBS or pass in STATIC, SHARED, or MODULE according to how the
# according to how the objects are to be used before calling CUDA_ADD_LIBRARY. # objects are to be used before calling CUDA_ADD_LIBRARY. A preprocessor macro,
# A preprocessor macro, <target_name>_EXPORTS is defined when BUILD_SHARED_LIBS # <target_name>_EXPORTS is defined when BUILD_SHARED_LIBS is defined. In
# is defined. In addition, flags passed into add_definitions with -D or /D are # addition, flags passed into add_definitions with -D or /D are passed along to
# passed along to nvcc. # nvcc.
# #
# Files with the HEADER_FILE_ONLY property set will not be compiled. # Files with the HEADER_FILE_ONLY property set will not be compiled.
# #
# It might be necessary to set CUDA_TOOLKIT_ROOT_DIR manually on certain platforms, # James Bigler, NVIDIA Corp
# or to use a cuda runtime not installed in the default location. In newer # Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
# versions of the toolkit the cuda library is included with the graphics
# driver- be sure that the driver version matches what is needed by the cuda
# runtime version.
#
# * James Bigler, NVIDIA Corp
# * Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
#
# The MIT License
# #
# Copyright (c) 2008-2009 # Copyright (c) 2008-2009
# NVIDIA Corp. # NVIDIA Corp.
@ -208,6 +207,11 @@
# Copyright (c) 2007-2009 # Copyright (c) 2007-2009
# Scientific Computing and Imaging Institute, University of Utah # Scientific Computing and Imaging Institute, University of Utah
# #
# This code is licensed under the MIT License. See the FindCUDA.cmake script
# for the text of the license.
# The MIT License
#
# License for the specific language governing rights and limitations under # License for the specific language governing rights and limitations under
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"), # copy of this software and associated documentation files (the "Software"),