未验证 提交 7102eb2e 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #9531 from luotao1/fix_profiler_test

fix compiler error of profiler_test in ONLY_CPU mode
...@@ -13,7 +13,9 @@ See the License for the specific language governing permissions and ...@@ -13,7 +13,9 @@ See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "paddle/fluid/platform/profiler.h" #include "paddle/fluid/platform/profiler.h"
#ifdef PADDLE_WITH_CUDA
#include "cuda_runtime.h" #include "cuda_runtime.h"
#endif
#include "gtest/gtest.h" #include "gtest/gtest.h"
TEST(Event, CpuElapsedTime) { TEST(Event, CpuElapsedTime) {
...@@ -159,6 +161,7 @@ TEST(RecordEvent, RecordEvent) { ...@@ -159,6 +161,7 @@ TEST(RecordEvent, RecordEvent) {
DisableProfiler(EventSortingKey::kTotal, "/tmp/profiler"); DisableProfiler(EventSortingKey::kTotal, "/tmp/profiler");
} }
#ifdef PADDLE_WITH_CUDA
TEST(TMP, stream_wait) { TEST(TMP, stream_wait) {
cudaStream_t stream; cudaStream_t stream;
cudaStreamCreate(&stream); cudaStreamCreate(&stream);
...@@ -166,3 +169,4 @@ TEST(TMP, stream_wait) { ...@@ -166,3 +169,4 @@ TEST(TMP, stream_wait) {
cudaStreamSynchronize(stream); cudaStreamSynchronize(stream);
cudaStreamSynchronize(stream); cudaStreamSynchronize(stream);
} }
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册