﻿<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
	Name="CUDA"
	Version="8.00"
	>
	<Rules>
		<CustomBuildRule
			Name="CUDA"
			DisplayName="CUDA"
			CommandLine="nvcc.exe [AllOptions]  [AdditionalOptions] $(InputFileName)"
			Outputs="[$ObjectFileName]"
			FileExtensions="*.cu"
			ExecutionDescription="Compiling..."
			>
			<Properties>
				<StringProperty
					Name="CompilerDirectory"
					DisplayName="Compiler Directory"
					PropertyPageName="Advanced"
					Category="Paths"
					Description="Specify the directory in which the host compiler executable (Microsoft Visual Studion cl, or a gcc derivative) resides. By default, this executable is expected in the current executable search path."
					Switch="-ccbin &quot;[value]&quot;"
					DefaultValue="$(VCInstallDir)bin"
				/>
				<StringProperty
					Name="Include"
					DisplayName="Additional Include Directories"
					Description="Specifies one or more directories to add to the include path; use semi-colon delimited list if more than one.   (/I[path])"
					Switch="-I&quot;[value]&quot;"
					Delimited="true"
					Delimiters=";"
					Inheritable="true"
				/>
				<EnumProperty
					Name="Optimization"
					DisplayName="Optimization"
					PropertyPageName="Optimization"
					Description="Select option for code optimization; choose Custom to use specific optimization options.  (/Od, /O1, /O2, /Ox)"
					DefaultValue="2"
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="-O0"
							DisplayName="Disabled (-O0)"
						/>
						<EnumValue
							Value="1"
							Switch="-O1"
							DisplayName="Minimize Size (-O1)"
						/>
						<EnumValue
							Value="2"
							Switch="-O2"
							DisplayName="Maximize Speed (-O2)"
						/>
						<EnumValue
							Value="3"
							Switch="-O3"
							DisplayName="Full Optimization (-O3)"
						/>
					</Values>
				</EnumProperty>
				<StringProperty
					Name="Defines"
					DisplayName="Preprocessor Definitions"
					PropertyPageName="Preprocessor"
					Description="Specifies one or more preprocessor defines.   (/D[macro])"
					Switch="-D[value]"
					Delimited="true"
					Inheritable="true"
				/>
				<BooleanProperty
					Name="Emulation"
					DisplayName="Emulation"
					PropertyPageName="Advanced"
					Category="Backend"
					Description="Whether or not to generate emulated code."
					Switch="-deviceemu"
				/>
				<StringProperty
					Name="MaximumRegisters"
					DisplayName="Maximum registers"
					PropertyPageName="Advanced"
					Category="Code Generation2"
					Description="Specify the maximum amount of registers that GPU functions can use (4-128, will be rounded to the next multiple of 4)."
					Switch="-maxregcount [value]"
				/>
				<BooleanProperty
					Name="NoAlignDouble"
					DisplayName="No align double"
					PropertyPageName="Advanced"
					Category="Code Generation2"
					Description="Specifies that -malign-double should not be passed as a compiler argument on 32-bit platforms. WARNING: this makes the ABI incompatible with the CUDA&apos;s kernel ABI for certain 64-bit types."
					Switch="--no-align-double"
				/>
				<EnumProperty
					Name="GPUArchCompName"
					DisplayName="GPU Architecture Compile Name"
					PropertyPageName="Advanced"
					Category="Code Generation2"
					Description="Specify the name of the NVIDIA GPU to compile for. This can either be a ‘real’ GPU, or a ‘virtual’ ptx architecture."
					DefaultValue="4"
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="-arch compute_10"
							DisplayName="1.0 (virtual) Arch"
						/>
						<EnumValue
							Value="1"
							Switch="-arch compute_11"
							DisplayName="1.1 (virtual) Arch"
						/>
						<EnumValue
							Value="2"
							Switch="-arch compute_12"
							DisplayName="1.2 (virtual) Arch"
						/>
						<EnumValue
							Value="3"
							Switch="-arch compute_13"
							DisplayName="1.3 (virtual) Arch"
						/>
						<EnumValue
							Value="4"
							Switch="-arch sm_10"
							DisplayName="1.0 (hardware) Arch"
						/>
						<EnumValue
							Value="5"
							Switch="-arch sm_11"
							DisplayName="1.1 (hardware) Arch"
						/>
						<EnumValue
							Value="6"
							Switch="-arch sm_12"
							DisplayName="1.2 (hardware) Arch"
						/>
						<EnumValue
							Value="7"
							Switch="-arch sm_13"
							DisplayName="1.3 (hardware) Arch"
						/>
					</Values>
				</EnumProperty>
				<EnumProperty
					Name="GPUArchCodeName"
					DisplayName="GPU Architecture Code Name"
					PropertyPageName="Advanced"
					Category="Code Generation2"
					Description="Specify the name of nVidia gpu to generate code for."
					DefaultValue="4"
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="-code compute_10"
							DisplayName="1.0 (virtual) code"
						/>
						<EnumValue
							Value="1"
							Switch="-code compute_11"
							DisplayName="1.1 (virtual) code"
						/>
						<EnumValue
							Value="2"
							Switch="-code compute_12"
							DisplayName="1.2 (virtual) code"
						/>
						<EnumValue
							Value="3"
							Switch="-code compute_13"
							DisplayName="1.3 (virtual) code"
						/>
						<EnumValue
							Value="4"
							Switch="-code sm_10"
							DisplayName="1.0 (hardware) code"
						/>
						<EnumValue
							Value="5"
							Switch="-code sm_11"
							DisplayName="1.1 (hardware) code"
						/>
						<EnumValue
							Value="6"
							Switch="-code sm_12"
							DisplayName="1.2 (hardware) code"
						/>
						<EnumValue
							Value="7"
							Switch="-code sm_13"
							DisplayName="1.3 (hardware) code"
						/>
					</Values>
				</EnumProperty>
				<EnumProperty
					Name="CompileAs"
					DisplayName="Compile As"
					PropertyPageName="Advanced"
					Category="Backend"
					Description="Select compile language option for source files."
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="--host-compilation C++"
							DisplayName="Compile as C++ code"
						/>
						<EnumValue
							Value="1"
							Switch="--host-compilation C"
							DisplayName="Compile as C code"
						/>
					</Values>
				</EnumProperty>
				<StringProperty
					Name="CompilerOptions"
					DisplayName="Compiler Options"
					PropertyPageName="Backends"
					Category="Backend"
					Description="Specify options directly to the compiler/preprocessor."
					Switch="-Xcompiler &quot;[value]&quot;"
					DefaultValue="[$Warning]"
					Delimited="true"
					Inheritable="true"
				/>
				<StringProperty
					Name="LinkerOptions"
					DisplayName="Linker Options"
					PropertyPageName="Backends"
					Category="Backend"
					Description="Specify options directly to the linker."
					Switch="-Xlinker &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<StringProperty
					Name="OpenccOptions"
					DisplayName="Opencc Options"
					PropertyPageName="Backends"
					Category="Backends"
					Description="Specify options directly to nvopencc."
					Switch="-Xopencc &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<StringProperty
					Name="CudafeOptions"
					DisplayName="Cudafe Options"
					PropertyPageName="Backends"
					Category="Backend"
					Description="Specify options directly to cudafe."
					Switch="-Xcudafe &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<StringProperty
					Name="PtxOptions"
					DisplayName="PTX options"
					PropertyPageName="Backends"
					Category="Backend"
					Description="Specify options directly to the ptx optimizing assembler."
					Switch="-Xptxas &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<StringProperty
					Name="FatbinOptions"
					DisplayName="Fatbin Options"
					PropertyPageName="Backends"
					Category="Backend"
					Description="Specify options directly to the fatbin generator."
					Switch="-Xfatbin &quot;[value]&quot;"
					Delimited="true"
				/>
				<StringProperty
					Name="GlobalEntryFunctions"
					DisplayName="Global Entries"
					PropertyPageName="Backends"
					Category="Ptx"
					Description="In case of compilation of ptx  or gpu files to cubin: specify the global entry functions for which code must be generated. By default, code will be generated for all entries. "
					Switch="--entries &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<BooleanProperty
					Name="GenerateDependencies"
					DisplayName="Generate dependencies"
					PropertyPageName="Advanced"
					Category="Backend"
					Description="Generate for the one of the input file a denepdency file that can be included in a make file."
					Switch="-M"
				/>
				<BooleanProperty
					Name="GenerateDebugInformation"
					DisplayName="Debug Information"
					Category="Behaviour"
					Description="Generate debug information for host code."
					Switch="-g"
				/>
				<EnumProperty
					Name="OutType"
					DisplayName="Compile to"
					Category="Code Generation"
					Description="Specifies the generated output type (C or PTX source, object files, gpu intermediate files, etc.)"
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="-c"
							DisplayName="Object file (.o)"
						/>
						<EnumValue
							Value="1"
							Switch="-cuda"
							DisplayName="C file (.cu.c)"
						/>
						<EnumValue
							Value="2"
							Switch="-cubin"
							DisplayName="Device Code (.cubin)"
						/>
						<EnumValue
							Value="3"
							Switch="-ptx"
							DisplayName="PTX device- only (.ptx)"
						/>
						<EnumValue
							Value="4"
							Switch="-gpu"
							DisplayName="GPU device- only (.gpu)"
						/>
						<EnumValue
							Value="5"
							Switch="-lib"
							DisplayName="Library (.lib)"
						/>
					</Values>
				</EnumProperty>
				<BooleanProperty
					Name="SharedLibrary"
					DisplayName="Shared library"
					Category="Code Generation"
					Description="Generate a shared library during linking. Note: when other linker options are required for controlling dll generation, use option -Xlinker."
					Switch="-shared"
				/>
				<EnumProperty
					Name="TargetMachine"
					DisplayName="Target Machine"
					Category="Code Generation"
					Description="Specify a machine bit architecture."
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="-m 32"
							DisplayName="MachineX86"
						/>
						<EnumValue
							Value="1"
							Switch="-m 64"
							DisplayName="MachineX64"
						/>
					</Values>
				</EnumProperty>
				<StringProperty
					Name="AdditionalLibraryDirectories"
					DisplayName="Library paths"
					Category="Paths"
					Description="Specify library search paths."
					Switch="-L &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<StringProperty
					Name="SystemInclude"
					DisplayName="System paths"
					Category="Paths"
					Description="Specify system include search paths."
					Switch="-isystem &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<StringProperty
					Name="AdditionalLibraryDependencies"
					DisplayName="Additional libraries"
					Category="Paths"
					Description="Specify libraries to be used in the linking stage. The libraries are searched for on the library search paths that have been specified using option &apos;-L&apos;."
					Switch="--library &quot;[value]&quot;"
					DefaultValue="cudart.lib"
					Delimited="true"
					Inheritable="true"
				/>
				<BooleanProperty
					Name="NoProfile"
					DisplayName="No profile"
					PropertyPageName="Miscellaneous"
					Description="This is intended for use during the cuda build, when no profile is present yet."
					Switch="-noprof"
				/>
				<BooleanProperty
					Name="ShowOptions"
					DisplayName="Show Options, Not Compilation "
					PropertyPageName="Miscellaneous"
					Description="Do not execute the compilation commands generated by nvcc. Instead, list them."
					Switch="-dryrun"
				/>
				<BooleanProperty
					Name="Verbose"
					DisplayName="Verbose"
					PropertyPageName="Miscellaneous"
					Description="List the compilation commands generated by this compiler driver, but do not suppress their execution."
					Switch="-v"
				/>
				<BooleanProperty
					Name="KeepFiles"
					DisplayName="Keep Files"
					PropertyPageName="Miscellaneous"
					Description="Keep all intermediate files that are generated during internal compilation steps."
					Switch="-keep"
				/>
				<BooleanProperty
					Name="CleanTargets"
					DisplayName="Clean Targets"
					PropertyPageName="Miscellaneous"
					Description="This option reverses the behaviour of nvcc. When specified, none of the compilation phases will be executed. Instead, all of the non- temporary files that nvcc would otherwise create will be deleted."
					Switch="-clean"
				/>
				<BooleanProperty
					Name="FastMath"
					DisplayName="Use Fast Math"
					PropertyPageName="Optimization"
					Category="Default"
					Description="Make use of the fast math library."
					Switch="-use_fast_math"
				/>
				<StringProperty
					Name="ObjectFileName"
					DisplayName="Output File Name"
					PropertyPageName="Output"
					Description="Specify name and location of the output file."
					Switch="-o &quot;[value]&quot;"
					DefaultValue="$(IntDir)\$(InputName).obj"
					Delimited="true"
				/>
				<StringProperty
					Name="OutputDirectory"
					DisplayName="Output Directory"
					PropertyPageName="Output"
					Category="Paths"
					Description="Specify the directory of the output file. This option is intended for letting the dependency generation step (option &apos;--generate-dependencies&apos;) generate a rule that defines the target object file in the proper directory."
					Switch="-odir &quot;[value]&quot;"
					DefaultValue="$(IntDir)"
				/>
				<StringProperty
					Name="ExportDirectory"
					DisplayName="Export Directory"
					PropertyPageName="Output"
					Category="Code Generation"
					Description="Specify the name of a file to which all &apos;external&apos; code images will be copied, intended as a device code repository that can be inspected by the cuda driver at application runtime when it occurs in the appropriate device code search paths."
					Switch="-dir &quot;[value]&quot;"
				/>
				<EnumProperty
					Name="ExternMode"
					DisplayName="Extern Mode"
					PropertyPageName="Output"
					Category="Code Generation"
					Description="Specify which of the listed images will be copied into the directory specified with option &apos;export-dir&apos;."
					DefaultValue="1"
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="-ext all"
							DisplayName="All"
						/>
						<EnumValue
							Value="1"
							Switch="-ext none"
							DisplayName="None"
						/>
						<EnumValue
							Value="2"
							Switch="-ext real"
							DisplayName="Real"
						/>
						<EnumValue
							Value="3"
							Switch="-ext virtual"
							DisplayName="Virtual"
						/>
					</Values>
				</EnumProperty>
				<EnumProperty
					Name="InternMode"
					DisplayName="Intern Mode"
					PropertyPageName="Output"
					Category="Code Generation"
					Description="Specify which of the listed images will be copied into the embedded fat binary structure (option &apos;embedded-fatbin&apos;)."
					DefaultValue="1"
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="-int all"
							DisplayName="All"
						/>
						<EnumValue
							Value="1"
							Switch="-int none"
							DisplayName="None"
						/>
						<EnumValue
							Value="2"
							Switch="-int real"
							DisplayName="Real"
						/>
						<EnumValue
							Value="3"
							Switch="-int virtual"
							DisplayName="Virtual"
						/>
					</Values>
				</EnumProperty>
				<StringProperty
					Name="Preinclude"
					DisplayName="Preincluded headers"
					PropertyPageName="Preprocessor"
					Category="Paths"
					Description="Specify header files that must be preincluded during preprocessing."
					Switch="-include &quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<BooleanProperty
					Name="Preprocess"
					DisplayName="Preprocess input files"
					PropertyPageName="Preprocessor"
					Category="Code Generation"
					Description="Generates a preprocessed source listing"
					Switch="-E"
				/>
				<StringProperty
					Name="Undefinitions"
					DisplayName="Undefine Preprocessor Definitions"
					PropertyPageName="Preprocessor"
					Category="Code Generation"
					Description="Specify macro definitions to undefine for use during preprocessing or compilation."
					Switch="-U&quot;[value]&quot;"
					Delimited="true"
					Inheritable="true"
				/>
				<EnumProperty
					Name="Runtime"
					DisplayName="Runtime Library"
					PropertyPageName="Code Generation"
					Description="Specify runtime library for linking.   (/MT, /MTd, /MD, /MDd)"
					DefaultValue="0"
					>
					<Values>
						<EnumValue
							Value="0"
							Switch="--compiler-options /MT"
							DisplayName="Multi-Threaded (/MT)"
						/>
						<EnumValue
							Value="1"
							Switch="--compiler-options /MTd"
							DisplayName="Multi-Threaded Debug (/MTd)"
						/>
						<EnumValue
							Value="2"
							Switch="--compiler-options /MD"
							DisplayName="Multi-Threaded DLL (/MD)"
						/>
						<EnumValue
							Value="3"
							Switch="--compiler-options /MDd"
							DisplayName="Multi-Threaded Debug DLL (/MDd)"
						/>
					</Values>
				</EnumProperty>
			</Properties>
		</CustomBuildRule>
	</Rules>
</VisualStudioToolFile>
