<commit_before>#ifndef OCLUTIL_DEVLIST_HPP
#define OCLUTIL_DEVLIST_HPP

/**
 * \file   devlist.hpp
 * \author <NAME> <<EMAIL>>
 * \brief  OpenCL device enumeration.
 */

#ifdef WIN32
#  pragma warning(disable : 4290 4715)
#  define NOMINMAX
#endif

#include <vector>
#include <string>
#include <CL/cl.hpp>

/// OpenCL convenience utilities.
namespace clu {

/// Device filters.
namespace Filter {
    /// Selects any device.
    struct All {
	bool operator()(const cl::Device &d) const {
	    return true;
	}
    };

    /// Selects devices whose platform vendor name match given value.
    struct Vendor {
	Vendor(const std::string &name) : vendor(name) {}

	bool operator()(const cl::Device &d) const {
	    return d.getInfo<CL_DEVICE_VENDOR>().find(vendor) != std::string::npos;
	}

	private:
	    const std::string &vendor;
    };

    /// Selects devices whose names match given value.
    struct Name {
	Name(const std::string &name) : devname(name) {}

	bool operator()(const cl::Device &d) const {<commit_msg>Platform filter<commit_after>#ifndef OCLUTIL_DEVLIST_HPP
#define OCLUTIL_DEVLIST_HPP

/**
 * \file   devlist.hpp
 * \author <NAME> <<EMAIL>>
 * \brief  OpenCL device enumeration.
 */

#ifdef WIN32
#  pragma warning(disable : 4290 4715)
#  define NOMINMAX
#endif

#include <vector>
#include <string>
#include <CL/cl.hpp>

/// OpenCL convenience utilities.
namespace clu {

/// Device filters.
namespace Filter {
    /// Selects any device.
    struct All {
	bool operator()(const cl::Device &d) const {
	    return true;
	}
    };

    /// Selects devices whose platform vendor name match given value.
    struct Vendor {
	Vendor(const std::string &name) : vendor(name) {}

	bool operator()(const cl::Device &d) const {
	    return d.getInfo<CL_DEVICE_VENDOR>().find(vendor) != std::string::npos;
	}

	private:
	    const std::string &vendor;
    };

    /// Selects devices whose platform name match given value.
    struct Platform {
	Platform(const std::string &name) : platform(name) {}

	bool operator()(const cl::Device &d) const {
	    return cl::Platform(d.getInfo<CL_DEVICE_PLATFORM>()).getInfo<CL_PLATFORM_NAME>().find(platform) != std::string::npos;
	}

	private:
	    const std::string &platform;
    };

    /// Selects devices whose names match given value.
    struct Name {
	Name(const std::string &name) : devname(name) {}

	bool operator()(const cl::Device &d) const {
{'fraction_non_alphanumeric': 0.13780183180682765, 'fraction_numerical': 0.00832639467110741, 'mean_word_length': 3.5511363636363638, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2314877', 'n_tokens_mistral': 821, 'n_tokens_neox': 779, 'n_words': 215}