Skip to content

Commit

Permalink
UPDATE to _WIN32
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Oct 4, 2023
1 parent c34e2df commit 200fa0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions onnxruntime/core/providers/cpu/tensor/upsample_antialias.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,10 @@ void SetupUpsampleFilterAntiAlias(FilterParamsAntiAlias<T>& p,
}

float total_weight_inv = total_weight == 0.0f ? 1.f : 1.0f / total_weight;
#ifdef _MSC_VER
#pragma warning(push)
#ifdef _WIN32
#pragma warning(disable : 4189)
#endif
auto* scale_buffer_int = reinterpret_cast<int32_t*>(scale_buffer);
#ifdef _MSC_VER
#pragma warning(pop)
#endif
for (x = 0; x < xmax_cut - xmin_cut; x++) {
scale_buffer[x] *= total_weight_inv;

Expand All @@ -255,13 +251,17 @@ void SetupUpsampleFilterAntiAlias(FilterParamsAntiAlias<T>& p,
scale_buffer_int[x] = static_cast<int32_t>(std::round(scale_buffer[x] * ConstValue::mag_factor * 2.f));
}
}
#ifdef _WIN32
#pragma warning(default : 4189)
#endif
/*for (; x < window_size; x++) {
scale_buffer[x] = 0;
}*/
}
return window_size;
};


const size_t width_rindex = is_nchw ? 0 : 1;
const size_t height_rindex = is_nchw ? 1 : 2;
const size_t channel_rindex = is_nchw ? 2 : 2; // only works for trilinear NC(chw)
Expand Down

0 comments on commit 200fa0e

Please sign in to comment.