 
     const int ncols_u = ncols*k;
     const int ncols_x = (k == 3) ? ncols : ncols_u;
-    const scalar_t mask = (mask_c == NULL) ? 1.0 : (*(mask_c + col));
+    const scalar_t mask = (mask_c == NULL) ? (scalar_t)1.0 : (*(mask_c + col));
     auto cur = *(init + col);
     const int d2 = d*2;
     const auto wc1 = *(weight_c + (col%d2));

    const auto wc2 = *(weight_c + (col%d) + d);
    const auto bias1 = *(bias + (col%d));
    const auto bias2 = *(bias + (col%d) + d);
    const auto mask = (mask_c == NULL) ? 1.0 : (*(mask_c + col));
    scalar_t gwc1 = 0;
    scalar_t gwc2 = 0;
    scalar_t gbias1 = 0;

    const auto wc2 = *(weight_c + (col%d) + d);
    const auto bias1 = *(bias + (col%d));
    const auto bias2 = *(bias + (col%d) + d);
    const auto  mask = (mask_c == NULL) ? (scalar_t)1.0 : (*(mask_c + col));
    auto cur = *(init + col);
    const auto* up = u + (col*k);
    const auto* xp = (skip_type == 0) ? NULL : ((skip_type == 1) ? (x + col) : (up + 3));
