<commit_before>/*******************************************************
 * Copyright (c) 2015, 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
 ********************************************************/

#include <af/defines.h>
#include <dispatch.hpp>
#include <err_cuda.hpp>
#include <debug_cuda.hpp>
#include <memory.hpp>
#include "ireduce.hpp"
#include "reduce.hpp"
#include "sort.hpp"

#include <cfloat>

#include <iostream>

namespace cuda
{

namespace kernel
{

template<typename T>
__device__ T sq(T a)
{
    return a * a;
}

template<typename T>
struct EPS
{
    __device__ T eps() { return FLT_EPSILON; }
};

template<>
struct EPS<float>
{
    __device__ static float eps() { return FLT_EPSILON; }
};

template<>
struct EPS<double>
{
    __device__ static double eps() { return DBL_EPSILON; }
};

#define RANSACConfidence 0.99f
#define LMEDSConfidence 0.99f
#define LMEDSOutlierRatio 0.4f

extern __shared__ char sh[];

template<typename T>
__device__ void JacobiSVD(int m, int n)
{
    const int iterations = 30;

    int tid_x = threadIdx.x;
    int bsz_x = blockDim.x;
    int tid_y = threadIdx.y;
    int gid_y = blockIdx.y * blockDim.y + tid_y;

    __shared__ T acc1[256];
    __shared__ T acc2[256];

    __shared__ T d[16*9];

    T* s_V = (T*)sh;
    T* s_S = (T*)sh + 16*81;

    // Copy first 80 elements
    for (int i = 0; i <= 4; i++) {
        T t = s_S[tid_y*81 + tid_x+i*bsz_x];
        acc1[tid_y*bsz_x + tid_x] += t*t;
    }
    if (tid_x < 8)
        acc1[tid_y*16 + tid_x] += acc1[tid_y*16 + tid_x+8];
    __syncthreads();<commit_msg>Remove unused variable warning in homography cuda kernel<commit_after>/*******************************************************
 * Copyright (c) 2015, 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
 ********************************************************/

#include <af/defines.h>
#include <dispatch.hpp>
#include <err_cuda.hpp>
#include <debug_cuda.hpp>
#include <memory.hpp>
#include "ireduce.hpp"
#include "reduce.hpp"
#include "sort.hpp"

#include <cfloat>

#include <iostream>

namespace cuda
{

namespace kernel
{

template<typename T>
__device__ T sq(T a)
{
    return a * a;
}

template<typename T>
struct EPS
{
    __device__ T eps() { return FLT_EPSILON; }
};

template<>
struct EPS<float>
{
    __device__ static float eps() { return FLT_EPSILON; }
};

template<>
struct EPS<double>
{
    __device__ static double eps() { return DBL_EPSILON; }
};

#define RANSACConfidence 0.99f
#define LMEDSConfidence 0.99f
#define LMEDSOutlierRatio 0.4f

extern __shared__ char sh[];

template<typename T>
__device__ void JacobiSVD(int m, int n)
{
    const int iterations = 30;

    int tid_x = threadIdx.x;
    int bsz_x = blockDim.x;
    int tid_y = threadIdx.y;
    //int gid_y = blockIdx.y * blockDim.y + tid_y;

    __shared__ T acc1[256];
    __shared__ T acc2[256];

    __shared__ T d[16*9];

    T* s_V = (T*)sh;
    T* s_S = (T*)sh + 16*81;

    // Copy first 80 elements
    for (int i = 0; i <= 4; i++) {
        T t = s_S[tid_y*81 + tid_x+i*bsz_x];
        acc1[tid_y*bsz_x + tid_x] += t*t;
    }
    if (tid_x < 8)
        acc1[tid_y*16 + tid_x] += acc1[tid_y*16 + tid_x+8];
    __syncthreads();
{'fraction_non_alphanumeric': 0.18722912453048252, 'fraction_numerical': 0.026581912741982086, 'mean_word_length': 3.640750670241287, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 31, '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': '5986653', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1292, 'n_words': 338}