/*!
 * \file
 * \brief   Build configuration file.
 *
 * \author
 *    Christos Choutouridis AEM:8997
 *    <cchoutou@ece.auth.gr>
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#include <cstdint>

/*
 * Versioning:
 * - RC1:
 */
static constexpr char version[] = "0.0";

/*
 * Defines for different version of the exercise
 */
#define  V0        (0)
#define  V1        (1)
#define  V2        (2)

// Fail-safe version selection
#if !defined CODE_VERSION
#define CODE_VERSION   V2
#endif

// Default Data size (in case -q <N> is not present)
static constexpr size_t DEFAULT_DATA_SIZE   = 1 << 16;

static constexpr size_t THREADS_PER_BLOCK   = 8;
static constexpr size_t IN_BLOCK_THRESHOLD  = 4;

/*!
 * Value and Buffer type selection
 *
 * We support the following compiler types or the <cstdint> that translate to them:
 *  char       -  unsigned char
 *  short      -  unsigned short
 *  int        -  unsigned int
 *  long       -  unsigned long
 *  long long  -  unsigned long long
 *  float
 *  double
 */
using Value_t = uint8_t;
using Data_t  = std::vector<Value_t>;

/*!
 * Session option for each invocation of the executable.
 *
 * @note
 *  The values of the members are set from the command line.
 */
struct config_t {
    size_t  arraySize{DEFAULT_DATA_SIZE};   //!< The array size of the local data to sort.
    bool    exchangeOpt{false};             //!< Flag to request the exchange optimization
    size_t  pipeline{1UL};                  //!< Pipeline stages (1 to disable)
    bool    validation{false};              //!< Request a full validation at the end, performed by process rank 0.
    bool    ndebug{false};                  //!< Skips debug trap on DEBUG builds.
    size_t  perf{1};                        //!< Enable performance timing measurements and prints and repeat
                                            //!< the sorting <perf> times.
    bool    verbose{false};                 //!< Flag to enable verbose output to stdout.
};

/*
 * Exported data types
 */
extern config_t config;


#endif /* CONFIG_H_ */
