How to create a generic compute and override per target without autotvm?

I am trying to call cblas libraries when “cblas” is specified in the target libs and the target is x86. This needs to happen in two places: dense and batch_matmul.

Dense is straightforward because x86 already has an overridden compute and schedule. However, batch_matmul only has an overridden schedule. All computes call the same compute function. Further, batch_matmul doesn’t support autotvm tuning. How can I make a generic compute call and override it per target?

Should I use the same methodology as the generic schedules in topi/python/topi/generic/nn.py? Or should I still use the @autotvm.register_topi_compute decorator?

Should this be done using the same methodology as the generic dense compute in topi.cc? Using a new FTVMBatchMatMulBuilder?

I found that this can be done by using a couple of decorators, @tvm.target.generic_func and @<function_name>.register

Hi, I have met the same question. Could you please explain how to override batch_matmul’s compute function in more detail? Thanks~