Skip to content

Commit

Permalink
Move CUDA utilities and implement fallbacks
Browse files Browse the repository at this point in the history
Move the CUDA command line utilities cudaComputeCapabilities and
cudaIsEnabled from HeterogeneousCore/CUDAServices to CUDAUtilities.

Implement fallback binaries for cudaComputeCapabilities and cudaIsEnabled
for platforms that do not support CUDA.
  • Loading branch information
fwyzard committed Jan 30, 2023
1 parent e1cb4dc commit bbcce06
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 9 deletions.
9 changes: 0 additions & 9 deletions HeterogeneousCore/CUDAServices/bin/BuildFile.xml

This file was deleted.

8 changes: 8 additions & 0 deletions HeterogeneousCore/CUDAUtilities/bin/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<iftool name="cuda-gcc-support">
<use name="cuda"/>
<bin name="cudaComputeCapabilities" file="cudaComputeCapabilities.cpp isCudaDeviceSupported.cu"/>
<bin name="cudaIsEnabled" file="cudaIsEnabled.cpp isCudaDeviceSupported.cu"/>
<else/>
<bin name="cudaComputeCapabilities" file="cudaComputeCapabilities_fallback.cpp"/>
<bin name="cudaIsEnabled" file="cudaIsEnabled_fallback.cpp"/>
</iftool>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// C/C++ headers
#include <cstdlib>
#include <iostream>

// always returns EXIT_FAILURE
int main() {
std::cerr << "cudaComputeCapabilities: CUDA is not supported on this architecture" << std::endl;
return EXIT_FAILURE;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// C/C++ headers
#include <cstdlib>

// always returns EXIT_FAILURE
int main() { return EXIT_FAILURE; }

0 comments on commit bbcce06

Please sign in to comment.