Skip to content

Commit

Permalink
add definition for WITH_TESTING
Browse files Browse the repository at this point in the history
  • Loading branch information
Superjomn committed Oct 9, 2017
1 parent df46223 commit e578fc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ if(WITH_DOUBLE)
add_definitions(-DPADDLE_TYPE_DOUBLE)
endif(WITH_DOUBLE)

if(WITH_TESTING)
add_definitions(-DPADDLE_WITH_TESTING)
endif(WITH_TESTING)

if(NOT WITH_TIMER)
add_definitions(-DPADDLE_DISABLE_TIMER)
endif(NOT WITH_TIMER)
Expand Down
4 changes: 4 additions & 0 deletions paddle/operators/dynamic_recurrent_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#pragma once

#ifdef PADDLE_WITH_TESTING
#include "gtest/gtest.h"
#endif

#include "paddle/framework/lod_tensor.h"
#include "paddle/framework/operator.h"
Expand Down Expand Up @@ -132,6 +134,7 @@ class DynamicRecurrentOp : public framework::OperatorBase {
mutable rnn::Argument arg_;
mutable ArgCache cache_;

#ifdef PADDLE_WITH_TESTING
friend class DynamicRecurrentOpTestHelper;
FRIEND_TEST(DynamicRecurrentOpTestHelper, SplitInputs);
FRIEND_TEST(DynamicRecurrentOpTestHelper, CreateCache);
Expand All @@ -140,6 +143,7 @@ class DynamicRecurrentOp : public framework::OperatorBase {
FRIEND_TEST(DynamicRecurrentOpTestHelper, WriteStepOutputs);
FRIEND_TEST(DynamicRecurrentOpTestHelper, InitStates);
FRIEND_TEST(DynamicRecurrentOpTestHelper, ConcatOutputs);
#endif
};

class DynamicRecurrentGradientOp : public framework::OperatorBase {
Expand Down

0 comments on commit e578fc3

Please sign in to comment.