summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-14 13:34:42 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-03-14 13:35:00 (GMT)
commitdb4f4ad24e9a0ec8e0cb22b6b0204173d06e1cf8 (patch)
tree371c95db87ee1b9956ad84fd9f889196d027dc60 /Source/cmVisualStudio10TargetGenerator.cxx
parent9b68949a27e6962423fb75296b06f4d6d1e6cf73 (diff)
parent2def6a874b52ef70157f101cbca9ee9b92a5a7f5 (diff)
downloadCMake-db4f4ad24e9a0ec8e0cb22b6b0204173d06e1cf8.zip
CMake-db4f4ad24e9a0ec8e0cb22b6b0204173d06e1cf8.tar.gz
CMake-db4f4ad24e9a0ec8e0cb22b6b0204173d06e1cf8.tar.bz2
Merge topic 'support_cubin_fatbin_optix_cuda_output'
2def6a874b CUDA: Add support for CUBIN, FATBIN, and OPTIXIR compilation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8259
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ef0fcf3..8926f9e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3597,13 +3597,13 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
if (this->GeneratorTarget->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) {
cudaOptions.AddFlag("GenerateRelocatableDeviceCode", "true");
}
- bool notPtx = true;
+ bool notPtxLike = true;
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");
- notPtx = false;
+ notPtxLike = false;
if (cmSystemTools::VersionCompare(cmSystemTools::OP_GREATER_EQUAL,
cudaVersion, "9.0") &&
@@ -3618,9 +3618,24 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
"%(BaseCommandLineTemplate) [CompileOut] [FastMath] "
"[Defines] \"%(FullPath)\"");
}
- }
-
- if (notPtx &&
+ } else if (this->GeneratorTarget->GetPropertyAsBool(
+ "CUDA_CUBIN_COMPILATION")) {
+ cudaOptions.AddFlag("NvccCompilation", "cubin");
+ cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).cubin");
+ notPtxLike = false;
+ } else if (this->GeneratorTarget->GetPropertyAsBool(
+ "CUDA_FATBIN_COMPILATION")) {
+ cudaOptions.AddFlag("NvccCompilation", "fatbin");
+ cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).fatbin");
+ notPtxLike = false;
+ } else if (this->GeneratorTarget->GetPropertyAsBool(
+ "CUDA_OPTIX_COMPILATION")) {
+ cudaOptions.AddFlag("NvccCompilation", "optix-ir");
+ cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).optixir");
+ notPtxLike = false;
+ }
+
+ if (notPtxLike &&
cmSystemTools::VersionCompareGreaterEq(
"8.0", this->GlobalGenerator->GetPlatformToolsetCudaString())) {
// Explicitly state that we want this file to be treated as a