Yes,I guess so.However for most case I think those ifs are unnecessary.So I 
want to know the assertion sentences to avoid them.

Here's an example.  `N` is the `te.var`.You can clearly see the duplicate `if`



.


    extern "C" __global__ void default_function_kernel0(float* __restrict__ 
T_subtract1_red, float* __restrict__ Aa, float* __restrict__ ke, int k, int N) {
      if (((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) >> 18) < N) {
        if (((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) >> 18) < N) {
          if (((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) >> 9) < (N 
* 512)) {
            if ((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) < (N * 
262144)) {
              T_subtract1_red[(((((int)blockIdx.x) * 64) + 
((int)threadIdx.x)))] = 3.402823e+38f;
            }
          }
        }
      }
      for (int k4 = 0; k4 < k; ++k4) {
        if (((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) >> 18) < N) {
          if (((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) >> 18) < 
N) {
            if (((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) >> 9) < 
(N * 512)) {
              if ((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) < (N * 
262144)) {
                T_subtract1_red[(((((int)blockIdx.x) * 64) + 
((int)threadIdx.x)))] = min(T_subtract1_red[(((((int)blockIdx.x) * 64) + 
((int)threadIdx.x)))], (((((((k >> 1) <= ((((((((int)blockIdx.x) * 64) + 
((int)threadIdx.x)) / k) & 262143) >> 9) + k4)) & (((((((((int)blockIdx.x) * 
64) + ((int)threadIdx.x)) / k) & 262143) >> 9) + k4) < ((k + 511) - (k >> 1)))) 
& ((k >> 1) <= ((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) % k) + 
((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k) & 511)))) & 
(((((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) % k) + ((((((int)blockIdx.x) 
* 64) + ((int)threadIdx.x)) / k) & 511)) < ((k + 511) - (k >> 1)))) ? 
Aa[(((((k4 * 512) + (((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) / k)) + 
(((((int)blockIdx.x) * 64) + ((int)threadIdx.x)) % k)) - ((k >> 1) * 513)))] : 
1.000000e+04f) - ((float)((ke[(((k4 * k) + (((((int)blockIdx.x) * 64) + 
((int)threadIdx.x)) % k)))] == 0.000000e+00f) ? -10000 : 0))));
              }
            }
          }
        }
      }
    }





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/ops-become-slow-when-using-te-var/11486/3)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/d851416087c872eb509973483ea3846ae098acaee8e408cd0b47a34e9c0dd876).

Reply via email to