Clang 9 and GCC 9 Support (#35835)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35835

Make compilable with Clang 9 and GCC 9.

Test Plan: Compile with Clang 9 and GCC 9

Differential Revision: D20800182

fbshipit-source-id: dd9474640270de0ad6392641513a7f2fa970d6e3
This commit is contained in:
Islam Ismailov
2020-04-06 21:12:10 -07:00
committed by Facebook GitHub Bot
parent 803a4e135e
commit 64594d8333
2 changed files with 6 additions and 6 deletions

View File

@ -29,7 +29,7 @@ static void adaptive_avg_pool3d_out_frame(
int64_t istrideT,
int64_t istrideH,
int64_t istrideW) {
int64_t d;
int64_t d = 0;
#pragma omp parallel for private(d)
for (d = 0; d < sizeD; d++) {
/* loop over output */
@ -172,7 +172,7 @@ static void adaptive_avg_pool3d_backward_out_frame(
int64_t osizeT,
int64_t osizeH,
int64_t osizeW) {
int64_t d;
int64_t d = 0;
#pragma omp parallel for private(d)
for (d = 0; d < sizeD; d++) {
scalar_t* gradInput_p_d = gradInput_p + d * isizeT * isizeW * isizeH;

View File

@ -33,7 +33,7 @@ Tensor max_unpooling2d_forward_out_cpu_frame(
for (int64_t n = 0; n < numBatch; n++) {
int64_t nOutputOffset = n * numChannels * owidth * oheight;
int64_t nInputOffset = n * numChannels * inputWidth * inputHeight;
int64_t k;
int64_t k = 0;
bool has_error = false;
int64_t error_index = 0;
#pragma omp parallel for private(k)
@ -164,7 +164,7 @@ Tensor max_unpooling3d_forward_out_cpu_frame(
for (int64_t p = 0; p < nBatch; p++) {
int64_t inputOffset = p * nSlices * iT * iW * iH;
int64_t outputOffset = p * nSlices * oT * oW * oH;
int64_t k;
int64_t k = 0;
bool has_error = false;
int error_index = 0;
#pragma omp parallel for private(k)
@ -352,7 +352,7 @@ static void max_unpooling2d_backward_out_cpu_frame(
int64_t owidth) {
bool has_error = false;
int64_t error_index = 0;
int k;
int k = 0;
#pragma omp parallel for private(k)
for (k = 0; k < nslices; k++) {
scalar_t* gradInput_p_k = gradInput_p + k * iwidth * iheight;
@ -484,7 +484,7 @@ static void max_unpooling3d_backward_out_cpu_frame(
int64_t oT,
int64_t oH,
int64_t oW) {
int k;
int k = 0;
bool has_error = false;
int error_index = 0;
#pragma omp parallel for private(k)