From: Andrew Reusch Date: Thu, 3 Sep 2020 01:43:49 +0000 (-0700) Subject: Make docs build again when not everything is enabled (#6386) X-Git-Tag: upstream/0.7.0~170 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19de6250f0c665cfd2bbf6b1f0293dbf39634ba3;p=platform%2Fupstream%2Ftvm.git Make docs build again when not everything is enabled (#6386) --- diff --git a/tutorials/language/extern_op.py b/tutorials/language/extern_op.py index 64e9880..c20339d 100644 --- a/tutorials/language/extern_op.py +++ b/tutorials/language/extern_op.py @@ -36,6 +36,9 @@ from tvm import te import numpy as np from tvm.contrib import cblas +if not tvm.get_global_func("tvm.contrib.cblas.matmul", allow_missing=True): + raise Exception("Not compiled with cblas support; can't build this tutorial") + ###################################################################### # Use Extern Tensor Function # -------------------------- diff --git a/tutorials/optimize/opt_matmul_auto_tensorcore.py b/tutorials/optimize/opt_matmul_auto_tensorcore.py index 7dbd475..30be723 100644 --- a/tutorials/optimize/opt_matmul_auto_tensorcore.py +++ b/tutorials/optimize/opt_matmul_auto_tensorcore.py @@ -237,13 +237,11 @@ def test_gemm(N, L, M, dtype, layout): # check whether the gpu has tensorcore if not tvm.gpu(0).exist or not tvm.runtime.enabled("cuda"): - print("skip because cuda is not enabled..") - sys.exit(0) + raise Exception("skip building this tutorial because cuda is not enabled..") ctx = tvm.gpu() if not nvcc.have_tensorcore(ctx.compute_version): - print('the gpu has no tensorcore, skipping...') - sys.exit(0) + raise Exception("the gpu has no tensorcore, skipping...") M, N, L = 512, 32, 512 dtype = 'float16'