Conditionally add mkldnn test

This commit is contained in:
Eugene Zhulenev 2018-09-26 17:57:37 -07:00
parent 71cd3fbd6a
commit 22ed98a331
2 changed files with 4 additions and 11 deletions

View File

@ -191,6 +191,10 @@ if(EIGEN_TEST_CXX11)
ei_add_test_sycl(cxx11_tensor_custom_op_sycl ${STD_CXX_FLAG}) ei_add_test_sycl(cxx11_tensor_custom_op_sycl ${STD_CXX_FLAG})
endif(EIGEN_TEST_SYCL) endif(EIGEN_TEST_SYCL)
if (MKLDNN_FOUND)
ei_add_test(cxx11_tensor_contraction_mkldnn)
endif (MKLDNN_FOUND)
ei_add_test(cxx11_eventcount "-pthread" "${CMAKE_THREAD_LIBS_INIT}") ei_add_test(cxx11_eventcount "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
ei_add_test(cxx11_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}") ei_add_test(cxx11_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
ei_add_test(cxx11_non_blocking_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}") ei_add_test(cxx11_non_blocking_thread_pool "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
@ -201,7 +205,6 @@ if(EIGEN_TEST_CXX11)
ei_add_test(cxx11_tensor_index_list) ei_add_test(cxx11_tensor_index_list)
ei_add_test(cxx11_tensor_mixed_indices) ei_add_test(cxx11_tensor_mixed_indices)
ei_add_test(cxx11_tensor_contraction) ei_add_test(cxx11_tensor_contraction)
ei_add_test(cxx11_tensor_contraction_mkldnn)
ei_add_test(cxx11_tensor_convolution) ei_add_test(cxx11_tensor_convolution)
ei_add_test(cxx11_tensor_expr) ei_add_test(cxx11_tensor_expr)
ei_add_test(cxx11_tensor_fixed_size) ei_add_test(cxx11_tensor_fixed_size)

View File

@ -9,15 +9,8 @@
#include "main.h" #include "main.h"
// Nothing to test here if we do not have mkldnn enabled.
#if defined(EIGEN_USE_MKLDNN)
#include <Eigen/CXX11/Tensor> #include <Eigen/CXX11/Tensor>
using Eigen::array;
using Eigen::ColMajor;
using Eigen::Tensor;
using Eigen::Index;
using Eigen::internal::blas_data_mapper; using Eigen::internal::blas_data_mapper;
using Eigen::internal::mkldnn_gemm_kernel; using Eigen::internal::mkldnn_gemm_kernel;
using Eigen::internal::mkldnn_gemm_pack; using Eigen::internal::mkldnn_gemm_pack;
@ -136,6 +129,3 @@ EIGEN_DECLARE_TEST(cxx11_tensor_contraction_mkldnn) {
CALL_SUBTEST(test_mkldnn_gemm_pack<float>()); CALL_SUBTEST(test_mkldnn_gemm_pack<float>());
CALL_SUBTEST(test_mkldnn_gemm_kernel<float>()); CALL_SUBTEST(test_mkldnn_gemm_kernel<float>());
} }
#else
EIGEN_DECLARE_TEST(cxx11_tensor_contraction_mkldnn) {}
#endif // EIGEN_USE_MKLDNN