/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/host/check_err.hpp File Reference

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/host/check_err.hpp File Reference#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/host/check_err.hpp File Reference
check_err.hpp File Reference
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <limits>
#include <type_traits>
#include <vector>
#include "ck_tile/core.hpp"
#include "ck_tile/host/ranges.hpp"

Go to the source code of this file.

Namespaces

 ck_tile
 

Typedefs

using ck_tile::F8 = ck_tile::fp8_t
 8-bit floating point type More...
 
using ck_tile::BF8 = ck_tile::bf8_t
 8-bit brain floating point type More...
 
using ck_tile::F16 = ck_tile::half_t
 16-bit floating point (half precision) type More...
 
using ck_tile::BF16 = ck_tile::bf16_t
 16-bit brain floating point type More...
 
using ck_tile::F32 = float
 32-bit floating point (single precision) type More...
 
using ck_tile::I8 = int8_t
 8-bit signed integer type More...
 
using ck_tile::I32 = int32_t
 32-bit signed integer type More...
 

Functions

template<typename ComputeDataType , typename OutDataType , typename AccDataType = ComputeDataType>
CK_TILE_HOST double ck_tile::get_relative_threshold (const int number_of_accumulations=1)
 Calculate relative error threshold for numerical comparisons. More...
 
template<typename ComputeDataType , typename OutDataType , typename AccDataType = ComputeDataType>
CK_TILE_HOST double ck_tile::get_absolute_threshold (const double max_possible_num, const int number_of_accumulations=1)
 Calculate absolute error threshold for numerical comparisons. More...
 
template<typename T >
std::ostream & ck_tile::operator<< (std::ostream &os, const std::vector< T > &v)
 Stream operator overload for vector output. More...
 
template<typename Range , typename RefRange >
CK_TILE_HOST bool ck_tile::check_size_mismatch (const Range &out, const RefRange &ref, const std::string &msg="Error: Incorrect results!")
 Check for size mismatch between output and reference ranges. More...
 
CK_TILE_HOST void ck_tile::report_error_stats (int err_count, double max_err, std::size_t total_size)
 Report error statistics for numerical comparisons. More...
 
template<typename Range , typename RefRange >
std::enable_if< std::is_same_v< ranges::range_value_t< Range >, ranges::range_value_t< RefRange > > &&std::is_floating_point_v< ranges::range_value_t< Range > > &&!std::is_same_v< ranges::range_value_t< Range >, half_t >, bool >::type CK_TILE_HOST ck_tile::check_err (const Range &out, const RefRange &ref, const std::string &msg="Error: Incorrect results!", double rtol=1e-5, double atol=3e-6, bool allow_infinity_ref=false)
 Check errors between floating point ranges using the specified tolerances. More...
 
template<typename Range , typename RefRange >
std::enable_if< std::is_same_v< ranges::range_value_t< Range >, ranges::range_value_t< RefRange > > &&std::is_same_v< ranges::range_value_t< Range >, bf16_t >, bool >::type CK_TILE_HOST ck_tile::check_err (const Range &out, const RefRange &ref, const std::string &msg="Error: Incorrect results!", double rtol=1e-3, double atol=1e-3, bool allow_infinity_ref=false)
 Check errors between floating point ranges using the specified tolerances. More...
 
template<typename Range , typename RefRange >
std::enable_if< std::is_same_v< ranges::range_value_t< Range >, ranges::range_value_t< RefRange > > &&std::is_same_v< ranges::range_value_t< Range >, half_t >, bool >::type CK_TILE_HOST ck_tile::check_err (const Range &out, const RefRange &ref, const std::string &msg="Error: Incorrect results!", double rtol=1e-3, double atol=1e-3, bool allow_infinity_ref=false)
 Check errors between half precision floating point ranges. More...
 
template<typename Range , typename RefRange >
std::enable_if_t<(std::is_same_v< ranges::range_value_t< Range >, ranges::range_value_t< RefRange >> &&std::is_integral_v< ranges::range_value_t< Range >> &&!std::is_same_v< ranges::range_value_t< Range >, bf16_t >), bool > CK_TILE_HOST ck_tile::check_err (const Range &out, const RefRange &ref, const std::string &msg="Error: Incorrect results!", double=0, double atol=0)
 Check errors between integer ranges. More...
 
template<typename Range , typename RefRange >
std::enable_if_t<(std::is_same_v< ranges::range_value_t< Range >, ranges::range_value_t< RefRange >> &&std::is_same_v< ranges::range_value_t< Range >, fp8_t >), bool > CK_TILE_HOST ck_tile::check_err (const Range &out, const RefRange &ref, const std::string &msg="Error: Incorrect results!", unsigned max_rounding_point_distance=1, double atol=1e-1, bool allow_infinity_ref=false)
 Check errors between FP8 ranges. More...
 
template<typename Range , typename RefRange >
std::enable_if_t<(std::is_same_v< ranges::range_value_t< Range >, ranges::range_value_t< RefRange >> &&std::is_same_v< ranges::range_value_t< Range >, bf8_t >), bool > CK_TILE_HOST ck_tile::check_err (const Range &out, const RefRange &ref, const std::string &msg="Error: Incorrect results!", double rtol=1e-3, double atol=1e-3, bool allow_infinity_ref=false)
 Check errors between BF8 ranges. More...
 

Variables

constexpr int ck_tile::ERROR_DETAIL_LIMIT = 5
 Maximum number of error values to display when checking errors. More...