diff --git a/hebench/api_bridge/cpp/workload_params.hpp b/hebench/api_bridge/cpp/workload_params.hpp index 9230ff8..e2318b6 100644 --- a/hebench/api_bridge/cpp/workload_params.hpp +++ b/hebench/api_bridge/cpp/workload_params.hpp @@ -532,23 +532,25 @@ class SimpleSetIntersection : public Common Index_N, Index_M, Index_K, + Index_A, + Index_B, MinRequiredParameters }; /** - * @brief Number of elements in set A. + * @brief Number of elements in set X. */ std::uint64_t n() const { return get(Index_N); } /** - * @brief Number of elements in set A. + * @brief Number of elements in set X. */ std::uint64_t &n() { return m_w_params.at(Index_N).u_param; } /** - * @brief Number of elements in set B. + * @brief Number of elements in set Y. */ std::uint64_t m() const { return get(Index_M); } /** - * @brief Number of elements in set B. + * @brief Number of elements in set Y. */ std::uint64_t &m() { return m_w_params.at(Index_M).u_param; } /** @@ -559,21 +561,41 @@ class SimpleSetIntersection : public Common * @brief Number of items per element. */ std::uint64_t &k() { return m_w_params.at(Index_K).u_param; } + /** + * @brief The elements' value is at least a. + */ + std::int64_t a() const { return get(Index_A); } + /** + * @brief The elements' value is at least a. + */ + std::int64_t &a() { return reinterpret_cast(m_w_params.at(Index_A).u_param); } + /** + * @brief The elements' value is at most b. + */ + std::int64_t b() const { return get(Index_A); } + /** + * @brief The elements' value is at most b. + */ + std::int64_t &b() { return reinterpret_cast(m_w_params.at(Index_B).u_param); } public: /** * @brief Initializes a new object to represent workload parameters for simple * set intersection. - * @param[in] _n Number of elements in set A. - * @param[in] _m Number of elements in set B. + * @param[in] _n Number of elements in set X. + * @param[in] _m Number of elements in set Y. * @param[in] _k Number of items per element. + * @param[in] _a The elements' value is at least a. + * @param[in] _b The elements' value is at most b. */ - SimpleSetIntersection(std::uint64_t _n = 0, std::uint64_t _m = 0, std::uint64_t _k = 1) : + SimpleSetIntersection(std::uint64_t _n = 0, std::uint64_t _m = 0, std::uint64_t _k = 1, std::int64_t _a = -16384, std::int64_t _b = 16384) : Common(MinRequiredParameters) { this->set(Index_N, _n, "n"); this->set(Index_M, _m, "m"); this->set(Index_K, _k, "k"); + this->set(Index_A, _a, "a"); + this->set(Index_B, _b, "b"); } /** @@ -617,8 +639,8 @@ class SimpleSetIntersection : public Common if (m_w_params.size() < MinRequiredParameters) throw std::out_of_range("Workload requires, at least, " + std::to_string(MinRequiredParameters) + " parameters."); for (std::size_t i = 0; i < MinRequiredParameters; ++i) - if (m_w_params[i].data_type != hebench::APIBridge::WorkloadParamType::UInt64) - throw std::logic_error("Data type for workload parameter " + std::to_string(i) + " must be WorkloadParamType::UInt64."); + if (m_w_params[i].data_type != hebench::APIBridge::WorkloadParamType::UInt64 && m_w_params[i].data_type != hebench::APIBridge::WorkloadParamType::Int64) + throw std::logic_error("Data type for workload parameter " + std::to_string(i) + " must be WorkloadParamType::(U)Int64."); } }; diff --git a/hebench/api_bridge/types.h b/hebench/api_bridge/types.h index c2a9f21..2865111 100644 --- a/hebench/api_bridge/types.h +++ b/hebench/api_bridge/types.h @@ -251,6 +251,8 @@ enum Workload * - 0: `uint64` - Size of dataset `X` (number of items in set): `n`. * - 1: `uint64` - Size of dataset `Y` (number of items in set): `m`. * - 2: `uint64` - Number of elements in an item of a dataset. Must be greater than `0`: `k`. + * - 3: `int64` - The elements within an item are at least `a`. + * - 4: `int64` - The elements within an item are at most `b`. * * Operation Params: `X`, `Y` * @@ -261,7 +263,7 @@ enum Workload * * - 0: `Z` - set containing, at most, `min(n, m)` items. * @code - * `Z` = {`z_0`, ..., `z_n`, where `z_i` in `X` and `z_i` in `Y`} + * `Z` = {`z_0`, ..., `z_n`, where a <= `z_i` <= b, `z_i` in `X` and `z_i` in `Y`} * @endcode * * For details see \ref simple_set_intersection .*/