mirror of
https://github.com/dmlc/dgl.git
synced 2026-06-03 19:34:33 +08:00
[Graphbolt]Fix windows nominmax issue (#6853)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-21-218.ap-northeast-1.compute.internal>
This commit is contained in:
@@ -8,6 +8,11 @@ if(USE_CUDA)
|
||||
add_definitions(-DGRAPHBOLT_USE_CUDA)
|
||||
endif()
|
||||
|
||||
# For windows, define NOMINMAX to avoid conflict with std::min/max
|
||||
if(MSVC)
|
||||
add_definitions(-DNOMINMAX)
|
||||
endif()
|
||||
|
||||
# Find PyTorch cmake files and PyTorch versions with the python interpreter
|
||||
# $PYTHON_INTERP ("python3" or "python" if empty)
|
||||
if(NOT PYTHON_INTERP)
|
||||
|
||||
@@ -8,21 +8,12 @@
|
||||
#define GRAPHBOLT_SHARED_MEMORY_H_
|
||||
|
||||
#ifdef _WIN32
|
||||
// Add the macro to avoid MIN/MAX conflict.
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#define GRAPHBOLT_WINDOWS_NOMINMAX_
|
||||
#endif // NOMINMAX
|
||||
#include <windows.h>
|
||||
#endif // _WIN32
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#ifdef GRAPHBOLT_WINDOWS_NOMINMAX_
|
||||
#undef NOMINMAX
|
||||
#endif // GRAPHBOLT_WINDOWS_NOMINMAX_
|
||||
|
||||
namespace graphbolt {
|
||||
namespace sampling {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user