<commit_before>/**
* \file
* Copyright 2014-2015 <NAME>
*
* This file is part of alpaka.
*
* alpaka is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* alpaka is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with alpaka.
* If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <boost/predef.h>   // BOOST_XXX

#if BOOST_OS_WINDOWS || BOOST_OS_CYGWIN
    #ifndef NOMINMAX
        #define NOMINMAX
    #endif
    #ifndef WIN32_LEAN_AND_MEAN
        #define WIN32_LEAN_AND_MEAN
    #endif
    // We could use some more macros to reduce the number of sub-headers included, but this would restrict user code.
    #include <windows.h>
#elif BOOST_OS_UNIX
    #include <cstdint>          // std::uint64_t, std::uin32_t
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/param.h>
    #if BOOST_OS_BSD
        #include <sys/sysctl.h>
    #endif
#endif

#if BOOST_OS_LINUX
    #include <fstream>
#endif

#include <cstring>          // std::memcpy
#include <string>           // std::string

namespace alpaka
{
    namespace dev
    {
        namespace cpu
        {
#if BOOST_ARCH_X86
            namespace detail
            {
    #if BOOST_COMP_GNUC || BOOST_COMP_CLANG
        #include <cpuid.h>
                //-----------------------------------------------------------------------------
                //!
                //-----------------------------------------------------------------------------
                inline auto cpuid(std::uint32_t const level, std::uint32_t const subfunction, std::uint32_t ex[4])
                -> void
                {
                    __cpuid_count(level, subfunction, ex[0], ex[1], ex[2], ex[3]);
                }

    #elif BOOST_COMP_MSVC || BOOST_COMP_INTEL
        #include <intrin.h>
                //-----------------------------------------------------------------------------
                //!
                //-----------------------------------------------------------------------------<commit_msg>fix Intel compiler cpuid<commit_after>/**
* \file
* Copyright 2014-2015 <NAME>
*
* This file is part of alpaka.
*
* alpaka is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* alpaka is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with alpaka.
* If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <boost/predef.h>   // BOOST_XXX

#if BOOST_OS_WINDOWS || BOOST_OS_CYGWIN
    #ifndef NOMINMAX
        #define NOMINMAX
    #endif
    #ifndef WIN32_LEAN_AND_MEAN
        #define WIN32_LEAN_AND_MEAN
    #endif
    // We could use some more macros to reduce the number of sub-headers included, but this would restrict user code.
    #include <windows.h>
#elif BOOST_OS_UNIX
    #include <cstdint>          // std::uint64_t, std::uin32_t
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/param.h>
    #if BOOST_OS_BSD
        #include <sys/sysctl.h>
    #endif
#endif

#if BOOST_OS_LINUX
    #include <fstream>
#endif

#include <cstring>          // std::memcpy
#include <string>           // std::string

namespace alpaka
{
    namespace dev
    {
        namespace cpu
        {
#if BOOST_ARCH_X86
            namespace detail
            {
    #if BOOST_COMP_GNUC || BOOST_COMP_CLANG || (BOOST_COMP_INTEL && BOOST_COMP_GNUC_EMULATED)
        #include <cpuid.h>
                //-----------------------------------------------------------------------------
                //!
                //-----------------------------------------------------------------------------
                inline auto cpuid(std::uint32_t const level, std::uint32_t const subfunction, std::uint32_t ex[4])
                -> void
                {
                    __cpuid_count(level, subfunction, ex[0], ex[1], ex[2], ex[3]);
                }

    #elif BOOST_COMP_MSVC || (BOOST_COMP_INTEL && BOOST_COMP_MSVC_EMULATED)
        #include <intrin.h>
                //-----------------------------------------------------------------------------
                //!
                //-----------------------------------------------------------------------------
{'fraction_non_alphanumeric': 0.20412247348409046, 'fraction_numerical': 0.012007204322593557, 'mean_word_length': 1.5344827586206897, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2212365', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1335, 'n_words': 436}