forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
0170373
commit dae672a
Showing
11 changed files
with
64 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
#include <algorithm> | ||
#include <array> | ||
#include <cstdlib> | ||
#include <iostream> | ||
|
||
#include "HeterogeneousCore/CUDAUtilities/interface/supportedCUDADevices.h" | ||
#include <cuda_runtime.h> | ||
|
||
int main() { | ||
return supportedCUDADevices().empty() ? EXIT_FAILURE : EXIT_SUCCESS; | ||
int devices = 0; | ||
auto status = cudaGetDeviceCount(& devices); | ||
if (status != cudaSuccess) { | ||
return EXIT_FAILURE; | ||
} | ||
|
||
int minimumMajor = 6; // min minor is implicitly 0 | ||
|
||
// This approach (requiring all devices are supported) is rather | ||
// conservative. In principle we could consider just dropping the | ||
// unsupported devices. Currently that would be easiest to achieve | ||
// in CUDAService though. | ||
for (int i = 0; i < devices; ++i) { | ||
cudaDeviceProp properties; | ||
cudaGetDeviceProperties(&properties, i); | ||
|
||
if(properties.major < minimumMajor) { | ||
return EXIT_FAILURE; | ||
} | ||
} | ||
|
||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
HeterogeneousCore/CUDAUtilities/interface/supportedCUDADevices.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
HeterogeneousCore/CUDAUtilities/src/supportedCUDADevices.cu
This file was deleted.
Oops, something went wrong.