<commit_before>//=======================================================================
// Copyright (c) 2014-2017 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

#ifdef ETL_VECTORIZE_IMPL
#ifdef __AVX__
#define TEST_VEC
#elif defined(__SSE3__)
#define TEST_VEC
#endif
#endif

#ifdef ETL_CUDNN_MODE
#define TEST_CUDNN
#endif

#define CONV_FUNCTOR(name, ...)                                                                                   \
    struct name {                                                                                                 \
        template <size_t S1 = 1, size_t S2 = 1, size_t P1 = 0, size_t P2 = 0, typename A, typename B, typename C> \
        static void apply(A&& a, B&& b, C&& c) {                                                                  \
            __VA_ARGS__;                                                                                          \
        }                                                                                                         \
    };

#define DYN_CONV_FUNCTOR(name, ...)                                                                          \
    struct name {                                                                                            \
        template <typename A, typename B, typename C>                                                        \
        static void apply(A&& a, B&& b, C&& c, size_t s1 = 1, size_t s2 = 1, size_t p1 = 0, size_t p2 = 0) { \
            __VA_ARGS__;                                                                                     \
        }                                                                                                    \
    };

CONV_FUNCTOR(default_conv1_full, c = etl::conv_1d_full(a, b))
CONV_FUNCTOR(std_conv1_full, c = selected_helper(etl::conv_impl::STD, etl::conv_1d_full(a, b)))
CONV_FUNCTOR(fft_std_conv1_full, c = selected_helper(etl::conv_impl::FFT_STD, etl::conv_1d_full(a, b)))

CONV_FUNCTOR(default_conv1_same, c = etl::conv_1d_same(a, b))
CONV_FUNCTOR(std_conv1_same, c = selected_helper(etl::conv_impl::STD, etl::conv_1d_same(a, b)))

CONV_FUNCTOR(default_conv1_valid, c = etl::conv_1d_valid(a, b))
CONV_FUNCTOR(std_conv1_valid, c = selected_helper(etl::conv_impl::STD, etl::conv_1d_valid(a, b)))

CONV_FUNCTOR(default_conv2_full, c = etl::conv_2d_full(a, b))
CONV_FUNCTOR(std_conv2_full, c = selected_helper(etl::conv_impl::STD, etl::conv_2d_full(a, b)))
CONV_FUNCTOR(fft_std_conv2_full, c = selected_helper(etl::conv_impl::FFT_STD, etl::conv_2d_full(a, b)))

CONV_FUNCTOR(default_conv2_full_flipped, c = etl::conv_2d_full_flipped(a, b))
CONV_FUNCTOR(std_conv2_full_flipped, etl::impl::standard::conv2_full_flipped(a, b, c))
CONV_FUNCTOR(fft_std_conv2_full_flipped, c = selected_helper(etl::conv_impl::FFT_STD, etl::conv_2d_full_flipped(a, b)))

CONV_FUNCTOR(default_conv2_same, c = etl::conv_2d_same(a, b))
CONV_FUNCTOR(std_conv2_same, etl::impl::standard::conv2_same(a, b, c))

CONV_FUNCTOR(default_conv2_same_flipped, c = etl::conv_2d_same_flipped(a, b))
CONV_FUNCTOR(std_conv2_same_flipped, etl::impl::standard::conv2_same_flipped(a, b, c))

CONV_FUNCTOR(default_conv2_same_multi, c = etl::conv_2d_same_multi(a, b))
CONV_FUNCTOR(std_conv2_same_multi, etl::impl::standard::conv2_same_multi(a, b, c))

CONV_FUNCTOR(default_conv2_same_multi_flipped, c = etl::conv_2d_same_multi_flipped(a, b))
CONV_FUNCTOR(std_conv2_same_multi_flipped, etl::impl::standard::conv2_same_multi_flipped(a, b, c))

CONV_FUNCTOR(default_conv2_valid, c = etl::conv_2d_valid<S1, S2, P1, P2>(a, b))
CONV_FUNCTOR(std_conv2_valid, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid<S1, S2, P1, P2>(a, b))))

CONV_FUNCTOR(default_conv2_valid_flipped, c = etl::conv_2d_valid_flipped<S1, S2, P1, P2>(a, b))
CONV_FUNCTOR(std_conv2_valid_flipped, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid_flipped<S1, S2, P1, P2>(a, b))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid, c = etl::conv_2d_valid(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid(a, b, s1, s2, p1, p2))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid_flipped, c = etl::conv_2d_valid_flipped(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid_flipped, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid_flipped(a, b, s1, s2, p1, p2))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid_multi, c = etl::conv_2d_valid_multi(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid_multi, c = selected_helper(etl::conv_multi_impl::STD, (etl::conv_2d_valid_multi(a, b, s1, s2, p1, p2))))
DYN_CONV_FUNCTOR(blas_dyn_conv2_valid_multi, c = selected_helper(etl::conv_multi_impl::BLAS, (etl::conv_2d_valid_multi(a, b, s1, s2, p1, p2))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid_multi_flipped, c = etl::conv_2d_valid_multi_flipped(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid_multi_flipped, c = selected_helper(etl::conv_multi_impl::STD, (etl::conv_2d_valid_multi_flipped(a, b, s1, s2, p1, p2))))
DYN_CONV_FUNCTOR(blas_dyn_conv2_valid_multi_flipped, c = selected_helper(etl::conv_multi_impl::BLAS, (etl::conv_2d_valid_multi_flipped(a, b, s1, s2, p1, p2))))


CONV_FUNCTOR(default_conv4_valid, c = (etl::conv_4d_valid<S1,S2,P1,P2>(a, b)))
CONV_FUNCTOR(std_conv4_valid, c = selected_helper(etl::conv4_impl::STD, (etl::conv_4d_valid<S1,S2,P1,P2>(a, b))))
CONV_FUNCTOR(blas_conv4_valid, c = selected_helper(etl::conv4_impl::BLAS, (etl::conv_4d_valid<S1,S2,P1,P2>(a, b))))

CONV_FUNCTOR(default_conv4_valid_flipped, c = (etl::conv_4d_valid_flipped<S1,S2,P1,P2>(a, b)))
CONV_FUNCTOR(std_conv4_valid_flipped, c = selected_helper(etl::conv4_impl::STD, (etl::conv_4d_valid_flipped<S1,S2,P1,P2>(a, b))))
CONV_FUNCTOR(blas_conv4_valid_flipped, c = selected_helper(etl::conv4_impl::BLAS, (etl::conv_4d_valid_flipped<S1,S2,P1,P2>(a, b))))

CONV_FUNCTOR(default_conv4_valid_filter, c = (etl::conv_4d_valid_filter<S1, S2, P1, P2>(a, b)))
CONV_FUNCTOR(std_conv4_valid_filter, c = selected_helper(etl::conv4_impl::STD, (etl::conv_4d_valid_filter<S1, S2, P1, P2>(a, b))))
CONV_FUNCTOR(blas_conv4_valid_filter, c = selected_helper(etl::conv4_impl::BLAS, (etl::conv_4d_valid_filter<S1, S2, P1, P2>(a, b))))
<commit_msg>Clean<commit_after>//=======================================================================
// Copyright (c) 2014-2017 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

#ifdef ETL_VECTORIZE_IMPL
#ifdef __AVX__
#define TEST_VEC
#elif defined(__SSE3__)
#define TEST_VEC
#endif
#endif

#ifdef ETL_CUDNN_MODE
#define TEST_CUDNN
#endif

#define CONV_FUNCTOR(name, ...)                                                                                   \
    struct name {                                                                                                 \
        template <size_t S1 = 1, size_t S2 = 1, size_t P1 = 0, size_t P2 = 0, typename A, typename B, typename C> \
        static void apply(A&& a, B&& b, C&& c) {                                                                  \
            __VA_ARGS__;                                                                                          \
        }                                                                                                         \
    };

#define DYN_CONV_FUNCTOR(name, ...)                                                                          \
    struct name {                                                                                            \
        template <typename A, typename B, typename C>                                                        \
        static void apply(A&& a, B&& b, C&& c, size_t s1 = 1, size_t s2 = 1, size_t p1 = 0, size_t p2 = 0) { \
            __VA_ARGS__;                                                                                     \
        }                                                                                                    \
    };

CONV_FUNCTOR(default_conv1_full, c = etl::conv_1d_full(a, b))
CONV_FUNCTOR(std_conv1_full, c = selected_helper(etl::conv_impl::STD, etl::conv_1d_full(a, b)))
CONV_FUNCTOR(fft_std_conv1_full, c = selected_helper(etl::conv_impl::FFT_STD, etl::conv_1d_full(a, b)))

CONV_FUNCTOR(default_conv1_same, c = etl::conv_1d_same(a, b))
CONV_FUNCTOR(std_conv1_same, c = selected_helper(etl::conv_impl::STD, etl::conv_1d_same(a, b)))

CONV_FUNCTOR(default_conv1_valid, c = etl::conv_1d_valid(a, b))
CONV_FUNCTOR(std_conv1_valid, c = selected_helper(etl::conv_impl::STD, etl::conv_1d_valid(a, b)))

CONV_FUNCTOR(default_conv2_full, c = etl::conv_2d_full(a, b))
CONV_FUNCTOR(std_conv2_full, c = selected_helper(etl::conv_impl::STD, etl::conv_2d_full(a, b)))
CONV_FUNCTOR(fft_std_conv2_full, c = selected_helper(etl::conv_impl::FFT_STD, etl::conv_2d_full(a, b)))

CONV_FUNCTOR(default_conv2_full_flipped, c = etl::conv_2d_full_flipped(a, b))
CONV_FUNCTOR(std_conv2_full_flipped, etl::impl::standard::conv2_full_flipped(a, b, c))
CONV_FUNCTOR(fft_std_conv2_full_flipped, c = selected_helper(etl::conv_impl::FFT_STD, etl::conv_2d_full_flipped(a, b)))

CONV_FUNCTOR(default_conv2_same, c = etl::conv_2d_same(a, b))
CONV_FUNCTOR(std_conv2_same, etl::impl::standard::conv2_same(a, b, c))

CONV_FUNCTOR(default_conv2_same_flipped, c = etl::conv_2d_same_flipped(a, b))
CONV_FUNCTOR(std_conv2_same_flipped, etl::impl::standard::conv2_same_flipped(a, b, c))

CONV_FUNCTOR(default_conv2_same_multi, c = etl::conv_2d_same_multi(a, b))
CONV_FUNCTOR(std_conv2_same_multi, etl::impl::standard::conv2_same_multi(a, b, c))

CONV_FUNCTOR(default_conv2_same_multi_flipped, c = etl::conv_2d_same_multi_flipped(a, b))
CONV_FUNCTOR(std_conv2_same_multi_flipped, etl::impl::standard::conv2_same_multi_flipped(a, b, c))

CONV_FUNCTOR(default_conv2_valid, c = etl::conv_2d_valid<S1, S2, P1, P2>(a, b))
CONV_FUNCTOR(std_conv2_valid, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid<S1, S2, P1, P2>(a, b))))

CONV_FUNCTOR(default_conv2_valid_flipped, c = etl::conv_2d_valid_flipped<S1, S2, P1, P2>(a, b))
CONV_FUNCTOR(std_conv2_valid_flipped, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid_flipped<S1, S2, P1, P2>(a, b))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid, c = etl::conv_2d_valid(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid(a, b, s1, s2, p1, p2))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid_flipped, c = etl::conv_2d_valid_flipped(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid_flipped, c = selected_helper(etl::conv_impl::STD, (etl::conv_2d_valid_flipped(a, b, s1, s2, p1, p2))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid_multi, c = etl::conv_2d_valid_multi(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid_multi, c = selected_helper(etl::conv_multi_impl::STD, (etl::conv_2d_valid_multi(a, b, s1, s2, p1, p2))))
DYN_CONV_FUNCTOR(blas_dyn_conv2_valid_multi, c = selected_helper(etl::conv_multi_impl::BLAS, (etl::conv_2d_valid_multi(a, b, s1, s2, p1, p2))))

DYN_CONV_FUNCTOR(default_dyn_conv2_valid_multi_flipped, c = etl::conv_2d_valid_multi_flipped(a, b, s1, s2, p1, p2))
DYN_CONV_FUNCTOR(std_dyn_conv2_valid_multi_flipped, c = selected_helper(etl::conv_multi_impl::STD, (etl::conv_2d_valid_multi_flipped(a, b, s1, s2, p1, p2))))
DYN_CONV_FUNCTOR(blas_dyn_conv2_valid_multi_flipped, c = selected_helper(etl::conv_multi_impl::BLAS, (etl::conv_2d_valid_multi_flipped(a, b, s1, s2, p1, p2))))

CONV_FUNCTOR(default_conv4_valid, c = (etl::conv_4d_valid<S1,S2,P1,P2>(a, b)))
CONV_FUNCTOR(std_conv4_valid, c = selected_helper(etl::conv4_impl::STD, (etl::conv_4d_valid<S1,S2,P1,P2>(a, b))))
CONV_FUNCTOR(blas_conv4_valid, c = selected_helper(etl::conv4_impl::BLAS, (etl::conv_4d_valid<S1,S2,P1,P2>(a, b))))

CONV_FUNCTOR(default_conv4_valid_flipped, c = (etl::conv_4d_valid_flipped<S1,S2,P1,P2>(a, b)))
CONV_FUNCTOR(std_conv4_valid_flipped, c = selected_helper(etl::conv4_impl::STD, (etl::conv_4d_valid_flipped<S1,S2,P1,P2>(a, b))))
CONV_FUNCTOR(blas_conv4_valid_flipped, c = selected_helper(etl::conv4_impl::BLAS, (etl::conv_4d_valid_flipped<S1,S2,P1,P2>(a, b))))

CONV_FUNCTOR(default_conv4_valid_filter, c = (etl::conv_4d_valid_filter<S1, S2, P1, P2>(a, b)))
CONV_FUNCTOR(std_conv4_valid_filter, c = selected_helper(etl::conv4_impl::STD, (etl::conv_4d_valid_filter<S1, S2, P1, P2>(a, b))))
CONV_FUNCTOR(blas_conv4_valid_filter, c = selected_helper(etl::conv4_impl::BLAS, (etl::conv_4d_valid_filter<S1, S2, P1, P2>(a, b))))

{'fraction_non_alphanumeric': 0.15110555512149387, 'fraction_numerical': 0.03297132588483475, 'mean_word_length': 3.5038705137227306, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 70, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3190608', 'n_tokens_mistral': 5102, 'n_tokens_neox': 5074, 'n_words': 720}