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
# --------------------------
# 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'