未验证 提交 2f850990 编写于 作者: R risemeup1 提交者: GitHub

Fix gcc12 error when compiling using gcc12 and cuda12 (#50817)

* fix_gcc12_error

* fix_gcc12_error

* fix gcc12_error

* fix_gcc12_error
上级 7500ff61
......@@ -256,7 +256,7 @@ class CPUROIPerspectiveTransformOpKernel : public framework::OpKernel<T> {
auto transformed_width = ctx.Attr<int>("transformed_width");
auto spatial_scale = ctx.Attr<float>("spatial_scale");
const auto& in_dims = in->dims();
auto in_dims = phi::vectorize<int64_t>(in->dims());
int channels = in_dims[1];
int in_height = in_dims[2];
int in_width = in_dims[3];
......
......@@ -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<int64_t>(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));
......
......@@ -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 <immintrin.h>
#define __SSE2__
#else
#include <immintrin.h>
#endif
#endif
#include <stdint.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册