Skip to content

Commit 972e3c1

Browse files
swgu98Enigmatisms
authored andcommitted
Windows platform adapts to cuda12.6 (PaddlePaddle#71286)
* win-cuda12.6 fix * glog * glog * del glog
1 parent c42ee93 commit 972e3c1

File tree

19 files changed

+19
-22
lines changed

19 files changed

+19
-22
lines changed

cmake/external/glog.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
include(ExternalProject)
1616

17+
add_definitions(-DGLOG_NO_ABBREVIATED_SEVERITIES)
18+
1719
set(GLOG_PREFIX_DIR ${THIRD_PARTY_PATH}/glog)
1820
set(GLOG_INSTALL_DIR ${THIRD_PARTY_PATH}/install/glog)
1921
set(GLOG_INCLUDE_DIR

paddle/common/enforce.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
#include <execinfo.h>
3838
#endif
3939

40-
// msvc conflict logging with windows.h
41-
#define GLOG_NO_ABBREVIATED_SEVERITIES
4240
#include "paddle/utils/string/printf.h"
4341
#include "paddle/utils/string/to_string.h"
4442
#include "paddle/utils/variant.h"

paddle/fluid/framework/io/shell.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
#include <array>
16-
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
16+
1717
#include "paddle/fluid/framework/io/shell.h"
1818

1919
#include "paddle/common/enforce.h"

paddle/fluid/framework/op_registry.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ limitations under the License. */
2424
#include <unordered_map>
2525
#include <unordered_set>
2626

27-
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
28-
#include "glog/logging.h" // For VLOG()
27+
#include "glog/logging.h" // For VLOG()
2928
#include "paddle/common/flags.h"
3029
#include "paddle/common/macros.h"
3130
#include "paddle/fluid/framework/attribute.h"

paddle/fluid/platform/enforce.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ limitations under the License. */
5959
#include <execinfo.h>
6060
#endif
6161

62-
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
6362
#include "glog/logging.h"
6463
#include "paddle/common/errors.h"
6564
#include "paddle/common/flags.h"

paddle/phi/common/port.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include <string>
1818
#include "paddle/utils/test_macros.h"
1919

20-
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
21-
2220
#if !defined(_WIN32)
2321
#include <dlfcn.h> // dladdr
2422
#include <sys/time.h>

paddle/phi/core/memory/allocation/system_allocator.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
14-
#define GLOG_NO_ABBREVIATED_SEVERITIES
1514

1615
#include "paddle/phi/core/memory/allocation/system_allocator.h"
1716

paddle/phi/core/platform/profiler/cpu_utilization.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
1615
#include "paddle/phi/core/platform/profiler/cpu_utilization.h"
1716
#include <array>
1817
#include "glog/logging.h"

paddle/phi/kernels/funcs/shuffle_batch.cu.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ struct write_output_op_fixed {
149149
std::uint64_t m;
150150
InputIterT in;
151151
OutputIterT out;
152-
// flag contains inclusive scan of valid keys
153-
// perform gather using valid keys
152+
// flag contains inclusive scan of valid keys
153+
// perform gather using valid keys
154+
#if CUDA_VERSION < 12060
154155
__thrust_exec_check_disable__ __host__ __device__ std::size_t operator()(
155156
key_flag_tuple_fixed x) {
156157
if (x.key < m) {
@@ -159,6 +160,16 @@ struct write_output_op_fixed {
159160
}
160161
return 0; // Discarded
161162
}
163+
#else
164+
_CCCL_EXEC_CHECK_DISABLE
165+
_CCCL_HOST_DEVICE std::size_t operator()(key_flag_tuple_fixed x) {
166+
if (x.key < m) {
167+
// -1 because inclusive scan
168+
out[x.flag - 1] = in[x.key];
169+
}
170+
return 0; // Discarded
171+
}
172+
#endif
162173
};
163174

164175
template <typename ExecutionPolicy,

test/cpp/fluid/platform/bfloat16_test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ limitations under the License. */
1313

1414
#include "paddle/phi/kernels/funcs/eigen/extensions.h"
1515

16-
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
1716
#include "gtest/gtest.h"
1817
#include "paddle/fluid/framework/lod_tensor.h"
1918
#include "paddle/fluid/platform/enforce.h"

0 commit comments

Comments
 (0)