Browse Source

fix(mgb): add compute capability check

GitOrigin-RevId: fba819afb3
release-0.6
Megvii Engine Team Xu Xinran 4 years ago
parent
commit
ab3efab066
2 changed files with 7 additions and 0 deletions
  1. +3
    -0
      src/gopt/test/inference.cpp
  2. +4
    -0
      src/tensorrt/test/opr_replace.cpp

+ 3
- 0
src/gopt/test/inference.cpp View File

@@ -2727,6 +2727,9 @@ TEST(TestGoptInference, ConvertFormatNCHW4) {


TEST(TestGoptInference, ConvertFormatNCHW4Ic3) { TEST(TestGoptInference, ConvertFormatNCHW4Ic3) {
REQUIRE_GPU(1); REQUIRE_GPU(1);
auto cn = CompNode::load("gpu0");
cn.activate();
REQUIRE_CUDA_COMPUTE_CAPABILITY(6, 1);
HostTensorGenerator<dtype::Float32, RandomDistribution::UNIFORM> gen{ HostTensorGenerator<dtype::Float32, RandomDistribution::UNIFORM> gen{
1.2f, 127 * 127}; 1.2f, 127 * 127};
auto graph = ComputingGraph::make(); auto graph = ComputingGraph::make();


+ 4
- 0
src/tensorrt/test/opr_replace.cpp View File

@@ -1980,6 +1980,10 @@ TEST(TestTensorRTReplace, FuseConvAdd) {


TEST(TestTensorRTReplace, FuseConvAddNchw2nchw4) { TEST(TestTensorRTReplace, FuseConvAddNchw2nchw4) {
REQUIRE_GPU(1); REQUIRE_GPU(1);
auto cn = CompNode::load("gpu0");
cn.activate();
REQUIRE_CUDA_COMPUTE_CAPABILITY(6, 1);

HostTensorGenerator<dtype::Float32, RandomDistribution::UNIFORM> gen{ HostTensorGenerator<dtype::Float32, RandomDistribution::UNIFORM> gen{
1.2f, 127 * 127}; 1.2f, 127 * 127};
auto graph = ComputingGraph::make(); auto graph = ComputingGraph::make();


Loading…
Cancel
Save