<commit_before>/*******************************************************
 * Copyright (c) 2014, ArrayFire
 * All rights reserved.
 *
 * This file is distributed under 3-clause BSD license.
 * The complete license agreement can be obtained at:
 * http://arrayfire.com/licenses/BSD-3-Clause
 ********************************************************/

#if CPLX
#define sabs(in) ((in.x)*(in.x) + (in.y)*(in.y))
#else
#define sabs(in) in
#endif

#ifdef MIN_OP
void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
{
    if ((*lhs > rhs) ||
        (*lhs == rhs && *lidx < ridx)) {
        *lhs = rhs;
        *lidx = ridx;
    }
}
#endif

#ifdef MAX_OP
void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
{
    if ((*lhs < rhs) ||
        (*lhs == rhs && *lidx > ridx)) {
        *lhs = rhs;
        *lidx = ridx;
    }
}
#endif<commit_msg>BUGFIX: Fix indexed reductions with complex types in OpenCL backend<commit_after>/*******************************************************
 * Copyright (c) 2014, ArrayFire
 * All rights reserved.
 *
 * This file is distributed under 3-clause BSD license.
 * The complete license agreement can be obtained at:
 * http://arrayfire.com/licenses/BSD-3-Clause
 ********************************************************/

#if CPLX
#define sabs(in) ((in.x)*(in.x) + (in.y)*(in.y))
#ifdef MIN_OP
void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
{
    if ((sabs(lhs[0]) > sabs(rhs)) ||
        (sabs(lhs[0]) == sabs(rhs) && *lidx < ridx)) {
        *lhs = rhs;
        *lidx = ridx;
    }
}
#endif

#ifdef MAX_OP
void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
{
    if ((sabs(lhs[0]) < sabs(rhs)) ||
        (sabs(lhs[0]) == sabs(rhs) && *lidx > ridx)) {
        *lhs = rhs;
        *lidx = ridx;
    }
}
#endif
#else
#define sabs(in) in
#ifdef MIN_OP
void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
{
    if ((*lhs > rhs) ||
        (*lhs == rhs && *lidx < ridx)) {
        *lhs = rhs;
        *lidx = ridx;
    }
}
#endif

#ifdef MAX_OP
void binOp(T *lhs, uint *lidx, T rhs, uint ridx)
{
    if ((*lhs < rhs) ||
        (*lhs == rhs && *lidx > ridx)) {
        *lhs = rhs;
        *lidx = ridx;
    }
}
#endif
#endif
{'fraction_non_alphanumeric': 0.26357677902621723, 'fraction_numerical': 0.00749063670411985, 'mean_word_length': 2.9283088235294117, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7299855', 'n_tokens_mistral': 819, 'n_tokens_neox': 801, 'n_words': 218}