Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
project(Transformer-DyNet)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/dynet/cmake)
set(ENABLE_BOOST yes)

# DYNET uses Eigen which exploits modern CPU architectures. To get the
# best possible performance, the following are recommended:
Expand Down Expand Up @@ -80,7 +81,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 -funroll-loops -fno-finite-math-only -Wall -Wno-missing-braces -std=c++11 -Ofast -g -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -funroll-loops -fno-finite-math-only -Wall -Wno-missing-braces -std=c++20 -Ofast -g -march=native")
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
Expand Down Expand Up @@ -169,6 +170,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/dynet/exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifdef HAVE_CUDA
#include "dynet/gpu-ops.h"
#endif

#include <cassert>
using namespace std;

namespace dynet {
Expand Down
2 changes: 1 addition & 1 deletion dynet/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
4 changes: 4 additions & 0 deletions dynet/dynet/simd-functors.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ 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