<commit_before>/* ************************************************************************
 * Copyright 2015 Advanced Micro Devices, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ************************************************************************/

#include <gtest/gtest.h>
#include<math.h>

#include "test_constants.h"
#include "fftw_transform.h"
#include "cl_transform.h"
#include "typedefs.h"
#include "accuracy_test_common.h"
#include <stdexcept>
#include <vector>

/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
class accuracy_test_precallback_single : public ::testing::Test {
protected:
	accuracy_test_precallback_single(){}
	virtual ~accuracy_test_precallback_single(){}
	virtual void SetUp(){}
	virtual void TearDown(){
	}
};

class accuracy_test_precallback_double : public ::testing::Test {
protected:
	accuracy_test_precallback_double(){}
	virtual ~accuracy_test_precallback_double(){}
	virtual void SetUp(){}
	virtual void TearDown(){
	}
};

class mixed_radix_precallback : public ::testing::TestWithParam<size_t> {
	protected:
		mixed_radix_precallback(){}
		virtual ~mixed_radix_precallback(){}
		virtual void SetUp(){}
		virtual void TearDown(){}
};

class Supported_Fft_Sizes_precallback
{
public:
	std::vector<size_t> sizes;
	const size_t max_mixed_radices_to_test;

	Supported_Fft_Sizes_precallback()
	: max_mixed_radices_to_test( 4096 )
	{
		size_t i=0, j=0, k=0;
		size_t sum, sumi, sumj, sumk;

		sumi = 1; i = 0;
		while(1)
		{
			sumj = 1; j = 0;
			while(1)
			{
				sumk = 1; k = 0;
				while(1)
				{
					sum = (sumi*sumj*sumk);
					if( sum > max_mixed_radices_to_test ) break;

					sizes.push_back(sum);
					k++;
					sumk *= 2;
				}

				if(k == 0) break;
				j++;
				sumj *= 3;
			}

			if( (j == 0) && (k == 0) ) break;
			i++;
			sumi *= 5;
		}
	}
} supported_sizes_precallback;

INSTANTIATE_TEST_CASE_P(
	mixed_radices_precallback,
	mixed_radix_precallback,
	::testing::ValuesIn( supported_sizes_precallback.sizes )
);<commit_msg>Mixed radices with Radix 7 values tests for Pre-callback<commit_after>/* ************************************************************************
 * Copyright 2015 Advanced Micro Devices, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ************************************************************************/

#include <gtest/gtest.h>
#include<math.h>

#include "test_constants.h"
#include "fftw_transform.h"
#include "cl_transform.h"
#include "typedefs.h"
#include "accuracy_test_common.h"
#include <stdexcept>
#include <vector>

/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
class accuracy_test_precallback_single : public ::testing::Test {
protected:
	accuracy_test_precallback_single(){}
	virtual ~accuracy_test_precallback_single(){}
	virtual void SetUp(){}
	virtual void TearDown(){
	}
};

class accuracy_test_precallback_double : public ::testing::Test {
protected:
	accuracy_test_precallback_double(){}
	virtual ~accuracy_test_precallback_double(){}
	virtual void SetUp(){}
	virtual void TearDown(){
	}
};

class mixed_radix_precallback : public ::testing::TestWithParam<size_t> {
	protected:
		mixed_radix_precallback(){}
		virtual ~mixed_radix_precallback(){}
		virtual void SetUp(){}
		virtual void TearDown(){}
};

class Supported_Fft_Sizes_precallback
{
public:
	std::vector<size_t> sizes;
	const size_t max_mixed_radices_to_test;

	Supported_Fft_Sizes_precallback()
	: max_mixed_radices_to_test( 4096 )
	{
		size_t i=0, j=0, k=0, l=0;
		size_t sum, sumi, sumj, sumk, suml;

		sumi = 1; i = 0;
		while(1)
		{
			sumj = 1; j = 0;
			while(1)
			{
				sumk = 1; k = 0;
				while(1)
				{
					suml = 1; l = 0;
					while(1)
					{
						sum = (sumi*sumj*sumk*suml);
						if( sum > max_mixed_radices_to_test ) break;

						sizes.push_back(sum);
						l++;
						suml *= 2;
					}

					if(l == 0) break;
					k++;
					sumk *= 3;
				}

				if( (k == 0) && (l == 0) ) break;
				j++;
				sumj *= 5;
			}

			if( (j == 0) && (k == 0) && (l == 0) ) break;
			i++;
			sumi *= 7;
		}
	}
} supported_sizes_precallback;

INSTANTIATE_TEST_CASE_P(
	mixed_radices_precallback,
	mixed_radix_precallback,
	::testing::ValuesIn( supported_sizes_precallback.sizes )
);
{'fraction_non_alphanumeric': 0.2063372312334968, 'fraction_numerical': 0.013013956997359487, 'mean_word_length': 4.547071129707113, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1206666', 'n_tokens_mistral': 2073, 'n_tokens_neox': 1852, 'n_words': 446}