Skip to content

Commit 918516f

Browse files
committed
Merge branch 'develop' into anakin_v4
2 parents 79d4a99 + ef7bd03 commit 918516f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

paddle/fluid/operators/math/concat.cu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ class ConcatFunctor<platform::CUDADeviceContext, T> {
177177
dev_ins_data, dev_ins_col_data, static_cast<int>(inputs_col.size()),
178178
out_row, out_col, output->data<T>());
179179
}
180+
// Wait() must be called because `inputs_data` may be destructed before
181+
// kernel ends
182+
context.Wait();
180183
}
181184
};
182185

@@ -252,6 +255,9 @@ class ConcatGradFunctor<platform::CUDADeviceContext, T> {
252255
input.data<T>(), in_row, in_col, dev_outs_col_data,
253256
static_cast<int>(outputs_cols.size()), dev_out_gpu_data);
254257
}
258+
// Wait() must be called because `outputs_data` may be destructed before
259+
// kernel ends
260+
context.Wait();
255261
}
256262
};
257263

0 commit comments

Comments
 (0)