Skip to content

Commit 7102eb2

Browse files
authored
Merge pull request #9531 from luotao1/fix_profiler_test
fix compiler error of profiler_test in ONLY_CPU mode
2 parents 9565876 + 5baa529 commit 7102eb2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

paddle/fluid/platform/profiler_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515
#include "paddle/fluid/platform/profiler.h"
16+
#ifdef PADDLE_WITH_CUDA
1617
#include "cuda_runtime.h"
18+
#endif
1719
#include "gtest/gtest.h"
1820

1921
TEST(Event, CpuElapsedTime) {
@@ -159,10 +161,12 @@ TEST(RecordEvent, RecordEvent) {
159161
DisableProfiler(EventSortingKey::kTotal, "/tmp/profiler");
160162
}
161163

164+
#ifdef PADDLE_WITH_CUDA
162165
TEST(TMP, stream_wait) {
163166
cudaStream_t stream;
164167
cudaStreamCreate(&stream);
165168
cudaStreamSynchronize(stream);
166169
cudaStreamSynchronize(stream);
167170
cudaStreamSynchronize(stream);
168171
}
172+
#endif

0 commit comments

Comments
 (0)