diff --git a/paddle/fluid/operators/detection/roi_perspective_transform_op.cc b/paddle/fluid/operators/detection/roi_perspective_transform_op.cc index 619d86c9bb252eafbff1a0dec57e23ab832684b8..0beaf31ab0cacad9107774059d3a57d6abcc7065 100644 --- a/paddle/fluid/operators/detection/roi_perspective_transform_op.cc +++ b/paddle/fluid/operators/detection/roi_perspective_transform_op.cc @@ -256,7 +256,7 @@ class CPUROIPerspectiveTransformOpKernel : public framework::OpKernel { auto transformed_width = ctx.Attr("transformed_width"); auto spatial_scale = ctx.Attr("spatial_scale"); - const auto& in_dims = in->dims(); + auto in_dims = phi::vectorize(in->dims()); int channels = in_dims[1]; int in_height = in_dims[2]; int in_width = in_dims[3]; diff --git a/paddle/phi/backends/gpu/cuda/cudnn_helper.h b/paddle/phi/backends/gpu/cuda/cudnn_helper.h index 670c1f43c82debcb0643251ec3959b3fea04cb3d..330c056458c94429c93e5934d856597016e23d98 100644 --- a/paddle/phi/backends/gpu/cuda/cudnn_helper.h +++ b/paddle/phi/backends/gpu/cuda/cudnn_helper.h @@ -369,7 +369,7 @@ class ScopedDropoutDescriptor { PADDLE_ENFORCE_GPU_SUCCESS(phi::dynload::cudnnSetDropoutDescriptor( desc_, handle, dropout_prob_, dropout_state_data, state_size, seed)); } else { - auto dropout_state_dims = dropout_state_->dims(); + auto dropout_state_dims = phi::vectorize(dropout_state_->dims()); state_size = dropout_state_dims[0]; PADDLE_ENFORCE_GPU_SUCCESS(phi::dynload::cudnnRestoreDropoutDescriptor( desc_, handle, dropout_prob_, dropout_state_data, state_size, 0)); diff --git a/paddle/phi/common/float16.h b/paddle/phi/common/float16.h index d44a13fa11fceaac383dfa61fd95ae0f187c219e..cf79346f047424a2b846c048b4391ad671148e29 100644 --- a/paddle/phi/common/float16.h +++ b/paddle/phi/common/float16.h @@ -17,7 +17,14 @@ #if defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || \ defined(__i386__) #define __PADDLE_x86__ +// Note(risemeup1):undef __SSE2__ to avoid fp16 conflict between cuda and gcc12 +#ifdef __SSE2__ +#undef __SSE2__ #include +#define __SSE2__ +#else +#include +#endif #endif #include