Skip to content

Commit

Permalink
compile on gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
mike dupont committed Nov 29, 2023
1 parent 22b4495 commit e33eaa6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W1 /MP") # -Wall produces 20k warnings. Enable parallel compilation
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-finite-math-only -Wall -Wno-missing-braces -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-finite-math-only -Wall -Wno-missing-braces -std=c++20")

if (NOT RELEASE_OPT_LEVEL)
set(RELEASE_OPT_LEVEL "fast")
Expand Down Expand Up @@ -181,6 +181,7 @@ if (WITH_CUDA_BACKEND)
endif()
endif()

set(EIGEN3_INCLUDE_DIR /usr/local/include/eigen3/)
# look for Eigen
if (DEFINED ENV{EIGEN3_INCLUDE_DIR} AND NOT DEFINED EIGEN3_INCLUDE_DIR) # use env variable if not set
set(EIGEN3_INCLUDE_DIR $ENV{EIGEN3_INCLUDE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion dynet/exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "dynet/globals.h"
#include "dynet/timing.h"
#include "dynet/devices.h"

#include <cassert>
#ifdef HAVE_CUDA
#include "dynet/gpu-ops.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion dynet/nodes-softmaxes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "dynet/nodes-impl-macros.h"
#include "dynet/functors.h"

#include <cassert>
using namespace std;

namespace dynet {
Expand Down
5 changes: 5 additions & 0 deletions dynet/simd-functors.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ struct functor_traits<dynet::const_minus_op<Scalar> > {
};
} }

#define EIGEN_EMPTY_STRUCT_CTOR(X) \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE X() {} \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE X(const X& ) {}


namespace dynet {
template<typename Scalar> struct scalar_logistic_sigmoid_op {
EIGEN_EMPTY_STRUCT_CTOR(scalar_logistic_sigmoid_op)
Expand Down

0 comments on commit e33eaa6

Please sign in to comment.