diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2017-03-23 13:31:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-20 17:25:38 (GMT) |
commit | 23691d789e198c228e5c2bb7016b3b1194fd0635 (patch) | |
tree | f193265a71bd50a5a8df8f6e5a4c562dbdc375f3 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46 (diff) | |
download | CMake-23691d789e198c228e5c2bb7016b3b1194fd0635.zip CMake-23691d789e198c228e5c2bb7016b3b1194fd0635.tar.gz CMake-23691d789e198c228e5c2bb7016b3b1194fd0635.tar.bz2 |
CUDA: Allow sources to be compiled to .ptx files
When the target property `CUDA_PTX_COMPILATION` is enabled CUDA OBJECT
libraries will generate ptx files instead of object files.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index f0f04a8..0aadcbf 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2467,6 +2467,12 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( if (this->GeneratorTarget->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) { cudaOptions.AddFlag("GenerateRelocatableDeviceCode", "true"); + } else if (this->GeneratorTarget->GetPropertyAsBool( + "CUDA_PTX_COMPILATION")) { + cudaOptions.AddFlag("NvccCompilation", "ptx"); + // We drop the %(Extension) component as CMake expects all PTX files + // to not have the source file extension at all + cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).ptx"); } // Convert the host compiler options to the toolset's abstractions |