cpp : fixed a few typos

This commit is contained in:
saundersp 2023-07-21 19:31:15 +02:00
parent e40bbb999f
commit c048b3ca90
2 changed files with 7 additions and 7 deletions

View File

@ -9,7 +9,7 @@ template <typename T>
bool unit_test_cpu_vs_gpu(const np::Array<T>& cpu, const np::Array<T>& gpu) noexcept { bool unit_test_cpu_vs_gpu(const np::Array<T>& cpu, const np::Array<T>& gpu) noexcept {
if (cpu.shape != gpu.shape) { if (cpu.shape != gpu.shape) {
#if __DEBUG #if __DEBUG
fprintf(stderr, "Inequal shape !\n"); fprintf(stderr, "Unequal shape !\n");
#endif #endif
return false; return false;
} }
@ -32,7 +32,7 @@ template <typename T>
bool unit_test_argsort_2d(const np::Array<T>& a, const np::Array<uint16_t>& indices) noexcept { bool unit_test_argsort_2d(const np::Array<T>& a, const np::Array<uint16_t>& indices) noexcept {
if (a.shape != indices.shape) { if (a.shape != indices.shape) {
#if __DEBUG #if __DEBUG
fprintf(stderr, "Inequal shape !\n"); fprintf(stderr, "Unequal shape !\n");
#endif #endif
return false; return false;
} }
@ -60,8 +60,8 @@ T benchmark_function(const char* step_name, const F& fnc, Args &&...args) noexce
#endif #endif
const std::chrono::system_clock::time_point start = perf_counter_ns(); const std::chrono::system_clock::time_point start = perf_counter_ns();
const T res = fnc(std::forward<Args>(args)...); const T res = fnc(std::forward<Args>(args)...);
const long long timespent = duration_ns(perf_counter_ns() - start); const long long time_spent = duration_ns(perf_counter_ns() - start);
printf("| %-49s | %18s | %-29s |\n", step_name, thousand_sep(timespent).c_str(), format_time_ns(timespent).c_str()); printf("| %-49s | %18s | %-29s |\n", step_name, thousand_sep(time_spent).c_str(), format_time_ns(time_spent).c_str());
return res; return res;
} }
@ -73,8 +73,8 @@ void benchmark_function_void(const char* step_name, const F& fnc, Args &&...args
#endif #endif
const std::chrono::system_clock::time_point start = perf_counter_ns(); const std::chrono::system_clock::time_point start = perf_counter_ns();
fnc(std::forward<Args>(args)...); fnc(std::forward<Args>(args)...);
const long long timespent = duration_ns(perf_counter_ns() - start); const long long time_spent = duration_ns(perf_counter_ns() - start);
printf("| %-49s | %18s | %-29s |\n", step_name, thousand_sep(timespent).c_str(), format_time_ns(timespent).c_str()); printf("| %-49s | %18s | %-29s |\n", step_name, thousand_sep(time_spent).c_str(), format_time_ns(time_spent).c_str());
} }
template <typename T, typename F, typename... Args> template <typename T, typename F, typename... Args>

View File

@ -534,7 +534,7 @@ namespace np {
// bool Array<T>::operator==(const Array& other) const noexcept { // bool Array<T>::operator==(const Array& other) const noexcept {
// if (shape != other.shape) // if (shape != other.shape)
// return false; // return false;
// const size_t lenght = np::prod(shape); // const size_t length = np::prod(shape);
// for(size_t i = 0; i < length; ++i) // for(size_t i = 0; i < length; ++i)
// if (data[i] != other[i]) // if (data[i] != other[i])
// return false; // return false;