MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / check_compute_capability

Function check_compute_capability

dnn/test/cuda/utils.cpp:5–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace megdnn {
4namespace test {
5bool check_compute_capability(int major, int minor) {
6 int dev;
7 cuda_check(cudaGetDevice(&dev));
8 cudaDeviceProp prop;
9 cuda_check(cudaGetDeviceProperties(&prop, dev));
10
11 //! we just skip sm_62 here, which means jetson tx2
12 //! unless require sm_62 explicitly
13 if (prop.major == 6 && prop.minor == 2) {
14 return prop.major == major && prop.minor == minor;
15 }
16
17 return prop.major > major || (prop.major == major && prop.minor >= minor);
18}
19
20bool check_compute_capability_eq(int major, int minor) {
21 int dev;

Callers 9

TESTFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected