diff --git a/DIOPI-IMPL/torch/functions_mmcv.cpp b/DIOPI-IMPL/torch/functions_mmcv.cpp index 6c092737f..33ae0b05d 100644 --- a/DIOPI-IMPL/torch/functions_mmcv.cpp +++ b/DIOPI-IMPL/torch/functions_mmcv.cpp @@ -17,6 +17,11 @@ extern "C" { diopiError_t diopiNmsMmcv(diopiContextHandle_t ctx, diopiTensorHandle_t *out, diopiConstTensorHandle_t dets, diopiConstTensorHandle_t scores, double iouThreshold, int64_t offset) { + // fix just for one-iter-test tools on cuda device with DIPU_MOCK_CUDA=False + const char *mode = std::getenv("DIPU_MOCK_CUDA"); + if (mode != nullptr && (strcmp(mode, "False") == 0)) { + return diopiErrorOccurred; + } impl::aten::setCurCtx(ctx); auto atDets = impl::aten::buildATen(dets); auto atScores = impl::aten::buildATen(scores);