1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-18 16:15:21 +00:00

Always have a space between // and comment

This commit is contained in:
Carles Fernandez
2019-08-19 01:29:04 +02:00
parent d4bb6e5731
commit 9d0c00132d
62 changed files with 899 additions and 909 deletions

View File

@@ -620,7 +620,7 @@ insertTwiddleKernel(string &kernelString, int Nr, int numIter, int Nprev, int le
for (k = 1; k < Nr; k++)
{
int ind = z * Nr + k;
//float fac = (float) (2.0 * M_PI * (double) k / (double) len);
// float fac = (float) (2.0 * M_PI * (double) k / (double) len);
kernelString += string(" ang = dir * ( 2.0f * M_PI * ") + num2str(k) + string(".0f / ") + num2str(len) + string(".0f )") + string(" * angf;\n");
kernelString += string(" w = (float2)(native_cos(ang), native_sin(ang));\n");
kernelString += string(" a[") + num2str(ind) + string("] = complexMul(a[") + num2str(ind) + string("], w);\n");

View File

@@ -179,7 +179,7 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.")
set(VERSION_INFO_MAJOR_VERSION 0)
set(VERSION_INFO_MINOR_VERSION 0)
set(VERSION_INFO_MAINT_VERSION 11)
set(VERSION_INFO_MAINT_VERSION 11.git)
include(VolkVersion) # setup version info

View File

@@ -71,4 +71,4 @@ private:
};
#endif //VOLK_GNSSSDR_OPTION_HELPERS_H
#endif // VOLK_GNSSSDR_OPTION_HELPERS_H

View File

@@ -295,7 +295,7 @@ void write_results(const std::vector<volk_gnsssdr_test_results_t> *results, bool
std::cout << "Updating " << path << " ..." << std::endl;
config.open(path.c_str(), std::ofstream::app);
if (!config.is_open())
{ //either we don't have write access or we don't have the dir yet
{ // either we don't have write access or we don't have the dir yet
std::cout << "Error opening file " << path << std::endl;
}
}
@@ -304,7 +304,7 @@ void write_results(const std::vector<volk_gnsssdr_test_results_t> *results, bool
std::cout << "Writing " << path << " ..." << std::endl;
config.open(path.c_str());
if (!config.is_open())
{ //either we don't have write access or we don't have the dir yet
{ // either we don't have write access or we don't have the dir yet
std::cout << "Error opening file " << path << std::endl;
}

View File

@@ -32,9 +32,9 @@ __VOLK_DECL_BEGIN
typedef struct volk_gnsssdr_arch_pref
{
char name[128]; //name of the kernel
char impl_a[128]; //best aligned impl
char impl_u[128]; //best unaligned impl
char name[128]; // name of the kernel
char impl_a[128]; // best aligned impl
char impl_u[128]; // best unaligned impl
} volk_gnsssdr_arch_pref_t;
////////////////////////////////////////////////////////////////////////

View File

@@ -93,7 +93,7 @@ void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n)
((uint8_t *)data)[i] = (uint8_t)scaled_rand;
break;
default:
throw "load_random_data: no support for data size > 8 or < 1"; //no shenanigans here
throw "load_random_data: no support for data size > 8 or < 1"; // no shenanigans here
}
}
}
@@ -144,24 +144,24 @@ volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name)
throw std::string("name too short to be a datatype");
}
//is it a scalar?
// is it a scalar?
if (name[0] == 's')
{
type.is_scalar = true;
name = name.substr(1, name.size() - 1);
}
//get the data size
// get the data size
size_t last_size_pos = name.find_last_of("0123456789");
if (last_size_pos == std::string::npos)
{
throw std::string("no size spec in type ").append(name);
}
//will throw if malformed
// will throw if malformed
int size = volk_lexical_cast<int>(name.substr(0, last_size_pos + 1));
assert(((size % 8) == 0) && (size <= 64) && (size != 0));
type.size = size / 8; //in bytes
type.size = size / 8; // in bytes
for (size_t i = last_size_pos + 1; i < name.size(); i++)
{
@@ -238,7 +238,7 @@ static void get_signatures_from_name(std::vector<volk_gnsssdr_type_t> &inputsig,
try
{
type = volk_gnsssdr_type_from_string(token);
if (side == SIDE_NAME) side = SIDE_OUTPUT; //if this is the first one after the name...
if (side == SIDE_NAME) side = SIDE_OUTPUT; // if this is the first one after the name...
if (side == SIDE_INPUT)
inputsig.push_back(type);
@@ -264,18 +264,18 @@ static void get_signatures_from_name(std::vector<volk_gnsssdr_type_t> &inputsig,
}
else if (side == SIDE_INPUT)
{ //it's the function name, at least it better be
{ // it's the function name, at least it better be
side = SIDE_NAME;
fn_name.append("_");
fn_name.append(token);
}
else if (side == SIDE_OUTPUT)
{
if (token != toked.back()) throw; //the last token in the name is the alignment
if (token != toked.back()) throw; // the last token in the name is the alignment
}
}
}
//we don't need an output signature (some fn's operate on the input data, "in place"), but we do need at least one input!
// we don't need an output signature (some fn's operate on the input data, "in place"), but we do need at least one input!
assert(inputsig.size() != 0);
}
@@ -534,7 +534,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
const float tol_f = tol;
const unsigned int tol_i = static_cast<unsigned int>(tol);
//first let's get a list of available architectures for the test
// first let's get a list of available architectures for the test
std::vector<std::string> arch_list = get_arch_list(desc);
if ((!benchmark_mode) && (arch_list.size() < 2))
@@ -543,10 +543,10 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
return false;
}
//something that can hang onto memory and cleanup when this function exits
// something that can hang onto memory and cleanup when this function exits
volk_gnsssdr_qa_aligned_mem_pool mem_pool;
//now we have to get a function signature by parsing the name
// now we have to get a function signature by parsing the name
std::vector<volk_gnsssdr_type_t> inputsig, outputsig;
try
{
@@ -564,7 +564,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
return false;
}
//pull the input scalars into their own vector
// pull the input scalars into their own vector
std::vector<volk_gnsssdr_type_t> inputsc;
for (size_t i = 0; i < inputsig.size(); i++)
{
@@ -579,7 +579,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
for (unsigned int inputsig_index = 0; inputsig_index < inputsig.size(); ++inputsig_index)
{
volk_gnsssdr_type_t sig = inputsig[inputsig_index];
if (!sig.is_scalar) //we don't make buffers for scalars
if (!sig.is_scalar) // we don't make buffers for scalars
inbuffs.push_back(mem_pool.get_new(vlen * sig.size * (sig.is_complex ? 2 : 1)));
}
for (size_t i = 0; i < inbuffs.size(); i++)
@@ -587,7 +587,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
load_random_data(inbuffs[i], inputsig[i], vlen);
}
//ok let's make a vector of vector of void buffers, which holds the input/output vectors for each arch
// ok let's make a vector of vector of void buffers, which holds the input/output vectors for each arch
std::vector<std::vector<void *> > test_data;
for (size_t i = 0; i < arch_list.size(); i++)
{
@@ -609,7 +609,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
both_sigs.insert(both_sigs.end(), outputsig.begin(), outputsig.end());
both_sigs.insert(both_sigs.end(), inputsig.begin(), inputsig.end());
//now run the test
// now run the test
vlen = vlen - vlen_twiddle;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::vector<double> profile_times;
@@ -635,7 +635,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
run_cast_test1_s32f((volk_gnsssdr_fn_1arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]);
}
}
//ADDED BY GNSS-SDR. START
// ADDED BY GNSS-SDR. START
else if (inputsc.size() == 1 && !inputsc[0].is_float)
{
if (inputsc[0].is_complex)
@@ -654,7 +654,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
run_cast_test1_s8i((volk_gnsssdr_fn_1arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]);
}
}
//ADDED BY GNSS-SDR. END
// ADDED BY GNSS-SDR. END
else
throw "unsupported 1 arg function >1 scalars";
break;
@@ -674,7 +674,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
run_cast_test2_s32f((volk_gnsssdr_fn_2arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]);
}
}
//ADDED BY GNSS-SDR. START
// ADDED BY GNSS-SDR. START
else if (inputsc.size() == 1 && !inputsc[0].is_float)
{
if (inputsc[0].is_complex)
@@ -693,7 +693,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
run_cast_test2_s8i((volk_gnsssdr_fn_2arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]);
}
}
//ADDED BY GNSS-SDR. END
// ADDED BY GNSS-SDR. END
else
throw "unsupported 2 arg function >1 scalars";
break;
@@ -713,7 +713,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
run_cast_test3_s32f((volk_gnsssdr_fn_3arg_s32f)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]);
}
}
//ADDED BY GNSS-SDR. START
// ADDED BY GNSS-SDR. START
else if (inputsc.size() == 1 && !inputsc[0].is_float)
{
if (inputsc[0].is_complex)
@@ -734,7 +734,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
run_cast_test3_s8i((volk_gnsssdr_fn_3arg_s8i)(manual_func), test_data[i], scalar.real(), vlen, iter, arch_list[i]);
}
}
//ADDED BY GNSS-SDR. END
// ADDED BY GNSS-SDR. END
else
throw "unsupported 3 arg function >1 scalars";
break;
@@ -760,8 +760,8 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
profile_times.push_back(arch_time);
}
//and now compare each output to the generic output
//first we have to know which output is the generic one, they aren't in order...
// and now compare each output to the generic output
// first we have to know which output is the generic one, they aren't in order...
size_t generic_offset = 0;
for (size_t i = 0; i < arch_list.size(); i++)
{
@@ -810,7 +810,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
}
else
{
//i could replace this whole switch statement with a memcmp if i wasn't interested in printing the outputs where they differ
// i could replace this whole switch statement with a memcmp if i wasn't interested in printing the outputs where they differ
switch (both_sigs[j].size)
{
case 8:

View File

@@ -155,28 +155,28 @@ bool run_volk_gnsssdr_tests(
}
#define VOLK_PROFILE(func, test_params, results) run_volk_gnsssdr_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), test_params, results, "NULL")
#define VOLK_PUPPET_PROFILE(func, puppet_master_func, test_params, results) run_volk_gnsssdr_tests(func##_get_func_desc(), (void (*)())func##_manual, std::string(#func), test_params, results, std::string(#puppet_master_func))
typedef void (*volk_gnsssdr_fn_1arg)(void *, unsigned int, const char *); //one input, operate in place
typedef void (*volk_gnsssdr_fn_1arg)(void *, unsigned int, const char *); // one input, operate in place
typedef void (*volk_gnsssdr_fn_2arg)(void *, void *, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_3arg)(void *, void *, void *, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_4arg)(void *, void *, void *, void *, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_1arg_s32f)(void *, float, unsigned int, const char *); //one input vector, one scalar float input
typedef void (*volk_gnsssdr_fn_1arg_s32f)(void *, float, unsigned int, const char *); // one input vector, one scalar float input
typedef void (*volk_gnsssdr_fn_2arg_s32f)(void *, void *, float, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_3arg_s32f)(void *, void *, void *, float, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_1arg_s32fc)(void *, lv_32fc_t, unsigned int, const char *); //one input vector, one scalar float input
typedef void (*volk_gnsssdr_fn_1arg_s32fc)(void *, lv_32fc_t, unsigned int, const char *); // one input vector, one scalar float input
typedef void (*volk_gnsssdr_fn_2arg_s32fc)(void *, void *, lv_32fc_t, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_3arg_s32fc)(void *, void *, void *, lv_32fc_t, unsigned int, const char *);
//ADDED BY GNSS-SDR. START
typedef void (*volk_gnsssdr_fn_1arg_s8i)(void *, char, unsigned int, const char *); //one input vector, one scalar char input
// ADDED BY GNSS-SDR. START
typedef void (*volk_gnsssdr_fn_1arg_s8i)(void *, char, unsigned int, const char *); // one input vector, one scalar char input
typedef void (*volk_gnsssdr_fn_2arg_s8i)(void *, void *, char, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_3arg_s8i)(void *, void *, void *, char, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_1arg_s8ic)(void *, lv_8sc_t, unsigned int, const char *); //one input vector, one scalar lv_8sc_t vector input
typedef void (*volk_gnsssdr_fn_1arg_s8ic)(void *, lv_8sc_t, unsigned int, const char *); // one input vector, one scalar lv_8sc_t vector input
typedef void (*volk_gnsssdr_fn_2arg_s8ic)(void *, void *, lv_8sc_t, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_3arg_s8ic)(void *, void *, void *, lv_8sc_t, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_1arg_s16ic)(void *, lv_16sc_t, unsigned int, const char *); //one input vector, one scalar lv_16sc_t vector input
typedef void (*volk_gnsssdr_fn_1arg_s16ic)(void *, lv_16sc_t, unsigned int, const char *); // one input vector, one scalar lv_16sc_t vector input
typedef void (*volk_gnsssdr_fn_2arg_s16ic)(void *, void *, lv_16sc_t, unsigned int, const char *);
typedef void (*volk_gnsssdr_fn_3arg_s16ic)(void *, void *, void *, lv_16sc_t, unsigned int, const char *);
//ADDED BY GNSS-SDR. END
// ADDED BY GNSS-SDR. END
#endif // GNSS_SDR_VOLK_QA_UTILS_H

View File

@@ -28,18 +28,18 @@ extern "C"
#endif
int volk_gnsssdr_get_index(
const char *impl_names[], //list of implementations by name
const size_t n_impls, //number of implementations available
const char *impl_name //the implementation name to find
const char *impl_names[], // list of implementations by name
const size_t n_impls, // number of implementations available
const char *impl_name // the implementation name to find
);
int volk_gnsssdr_rank_archs(
const char *kern_name, //name of the kernel to rank
const char *impl_names[], //list of implementations by name
const int *impl_deps, //requirement mask per implementation
const bool *alignment, //alignment status of each implementation
size_t n_impls, //number of implementations available
const bool align //if false, filter aligned implementations
const char *kern_name, // name of the kernel to rank
const char *impl_names[], // list of implementations by name
const int *impl_deps, // requirement mask per implementation
const bool *alignment, // alignment status of each implementation
size_t n_impls, // number of implementations available
const bool align // if false, filter aligned implementations
);
#ifdef __cplusplus

View File

@@ -42,20 +42,20 @@ struct volk_gnsssdr_machine volk_gnsssdr_machine_${this_machine.name} = {
<% make_arch_have_list = (' | '.join(['(1 << LV_%s)'%a.name.upper() for a in this_machine.archs])) %> ${make_arch_have_list},
<% this_machine_name = "\""+this_machine.name+"\"" %> ${this_machine_name},
${this_machine.alignment},
##//list all kernels
##// list all kernels
%for kern in kernels:
<% impls = kern.get_impls(arch_names) %>
##//kernel name
##// kernel name
<% kern_name = "\""+kern.name+"\"" %> ${kern_name},
##//list of kernel implementations by name
##// list of kernel implementations by name
<% make_impl_name_list = "{"+', '.join(['"%s"'%i.name for i in impls])+"}" %> ${make_impl_name_list},
##//list of arch dependencies per implementation
##// list of arch dependencies per implementation
<% make_impl_deps_list = "{"+', '.join([' | '.join(['(1 << LV_%s)'%d.upper() for d in i.deps]) for i in impls])+"}" %> ${make_impl_deps_list},
##//alignment required? for each implementation
##// alignment required? for each implementation
<% make_impl_align_list = "{"+', '.join(['true' if i.is_aligned else 'false' for i in impls])+"}" %> ${make_impl_align_list},
##//pointer to each implementation
##// pointer to each implementation
<% make_impl_fcn_list = "{"+', '.join(['%s_%s'%(kern.name, i.name) for i in impls])+"}" %> ${make_impl_fcn_list},
##//number of implementations listed here
##// number of implementations listed here
<% len_impls = len(impls) %> ${len_impls},
%endfor
};

View File

@@ -29,9 +29,9 @@ __VOLK_DECL_BEGIN
// clang-format off
struct volk_gnsssdr_machine {
const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format)
const unsigned int caps; // capabilities (i.e., archs compiled into this machine, in the volk_gnsssdr_get_lvarch format)
const char *name;
const size_t alignment; //the maximum byte alignment required for functions in this library
const size_t alignment; // the maximum byte alignment required for functions in this library
%for kern in kernels:
const char *${kern.name}_name;
const char *${kern.name}_impl_names[<%len_archs=len(archs)%>${len_archs}];
@@ -51,4 +51,4 @@ extern struct volk_gnsssdr_machine volk_gnsssdr_machine_${machine.name};
__VOLK_DECL_END
// clang-format on
#endif //INCLUDED_LIBVOLK_GNSSSDR_MACHINES_H
#endif // INCLUDED_LIBVOLK_GNSSSDR_MACHINES_H