Skip to content

Commit

Permalink
fix build warnings
Browse files Browse the repository at this point in the history
removed double std namespaces
fix underlines
  • Loading branch information
parbenc committed Dec 12, 2023
1 parent 53d687b commit 28fe756
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ _templates/
_toc.yml
docBin/
_doxygen/
.venv
2 changes: 1 addition & 1 deletion docs/Contributors_Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The hipTensor repository follows a workflow which dictates a /master branch wher
the compute bound limit or memory bound limit.

Style Guide
==========
===========

This project follows the `CPP Core
guidelines <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md>`__,
Expand Down
24 changes: 12 additions & 12 deletions docs/Programmers_Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,72 +17,72 @@ The `library` directory
^^^^^^^^^^^^^^^^^^^^^^^

`library/include/hiptensor/`
'''''''''''''''''''''''''''
''''''''''''''''''''''''''''

Contains C++ include files for the hipTensor API. These files also contain Doxygen
comments that document the API.

`library/include/hiptensor/internal`
''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''

Internal include files for:

- Utility Code
- Generate Tensor Utility

`library/src/`
''''''''''''
''''''''''''''

Contains logger, device and performance functions.

`library/src/contraction/`
''''''''''''''''''''''''
''''''''''''''''''''''''''

Contains hipTensor core composable kernel header functions and contraction initialization functions.

`library/src/contraction/device`
''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''

Contains hipTensor Bilinear and Scale instance functions

The `samples` directory
^^^^^^^^^^^^^^^^^^^^^^^
`01_contraction/simple_bilinear_contraction_f32.cpp`
''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''

sample code for calling bilinear contraction for :code:`fp32` input, output and compute types


`01_contraction/simple_scale_contraction_f32.cpp`
'''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''

sample code for calling scale contraction for :code:`fp32` input, output and compute types

The `test` directory
^^^^^^^^^^^^^^^^^^^^^^^

`00_unit/logger`
''''''''''''''
''''''''''''''''

Test code for testing logger API Functions of hipTensor

`01_contraction/bilinear_contraction_f32`
'''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''

Test code for testing the bilinear contraction functionality and log metrics for F32 types.

`01_contraction/bilinear_contraction_f64`
'''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''

Test code for testing the bilinear contraction functionality and log metrics for F64 types.

`01_contraction/scale_contraction_f32`
''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''

Test code for testing the scale contraction functionality and log metrics for F32 types.

`01_contraction/scale_contraction_f64`
''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''

Test code for testing the scale contraction functionality and log metrics for F64 types.

Expand Down
9 changes: 9 additions & 0 deletions library/include/hiptensor/internal/hiptensor-version.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
#define HIPTENSOR_PATCH_VERSION @hiptensor_VERSION_PATCH@
// clang-format on

/**
* \brief Returns the version number of hipTensor
*
* \details Return the version with three least significant digits for patch version,
* the next three digits for minor version, and the most significant digits for major version.
*
* \returns The version number.
*/

inline size_t hiptensorGetVersion()
{
return HIPTENSOR_MAJOR_VERSION * 1e6 + HIPTENSOR_MINOR_VERSION * 1e3 + HIPTENSOR_PATCH_VERSION;
Expand Down
63 changes: 63 additions & 0 deletions library/include/hiptensor/internal/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace std
/////////// std::numeric_limits<float16_t> //////////////
///////////////////////////////////////////////////////////

#ifndef DOXYGEN_SHOULD_SKIP_THIS
template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::float16_t
numeric_limits<hiptensor::float16_t>::epsilon() noexcept
Expand Down Expand Up @@ -270,6 +271,68 @@ namespace std
hiptensor::detail::Fp16Bits eps(static_cast<uint16_t>(0x7FC0));
return eps.b16;
}

///////////////////////////////////////////////////////////
/////////// std::numeric_limits<xfloat32_t> //////////////
///////////////////////////////////////////////////////////

template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::xfloat32_t
numeric_limits<hiptensor::xfloat32_t>::epsilon() noexcept
{
hiptensor::detail::Fp32Bits eps(static_cast<float>(FLT_EPSILON));
return eps.xf32;
}

template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::xfloat32_t
numeric_limits<hiptensor::xfloat32_t>::infinity() noexcept
{
hiptensor::detail::Fp32Bits eps(static_cast<float>(HUGE_VALF));
return eps.xf32;
}

template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::xfloat32_t
numeric_limits<hiptensor::xfloat32_t>::lowest() noexcept
{
hiptensor::detail::Fp32Bits eps(static_cast<float>(-FLT_MAX));
return eps.xf32;
}

template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::xfloat32_t
numeric_limits<hiptensor::xfloat32_t>::max() noexcept
{
hiptensor::detail::Fp32Bits eps(static_cast<float>(FLT_MAX));
return eps.xf32;
}

template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::xfloat32_t
numeric_limits<hiptensor::xfloat32_t>::min() noexcept
{
hiptensor::detail::Fp32Bits eps(static_cast<float>(FLT_MIN));
return eps.xf32;
}

template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::xfloat32_t
numeric_limits<hiptensor::xfloat32_t>::quiet_NaN() noexcept
{
hiptensor::detail::Fp32Bits eps(static_cast<uint32_t>(0x7FF80000));
return eps.xf32;
}

template <>
HIPTENSOR_HOST_DEVICE constexpr hiptensor::xfloat32_t
numeric_limits<hiptensor::xfloat32_t>::signaling_NaN() noexcept
{
hiptensor::detail::Fp32Bits eps(static_cast<uint32_t>(0x7FF00000));
return eps.xf32;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
// @endcond
} // namespace std

namespace hiptensor
Expand Down
6 changes: 3 additions & 3 deletions library/src/contraction/contraction_solution_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
namespace std
{
template <>
struct std::hash<hiptensor::ContractionSolution>
struct hash<hiptensor::ContractionSolution>
{
std::size_t operator()(hiptensor::ContractionSolution const& s) const noexcept
size_t operator()(hiptensor::ContractionSolution const& s) const noexcept
{
return std::hash<hiptensor::ContractionSolutionParams>{}(*s.params());
return hash<hiptensor::ContractionSolutionParams>{}(*s.params());
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions library/src/contraction/contraction_solution_params_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
namespace std
{
template <>
struct std::hash<hiptensor::ContractionSolutionParams>
struct hash<hiptensor::ContractionSolutionParams>
{
std::size_t operator()(hiptensor::ContractionSolutionParams const& s) const noexcept
size_t operator()(hiptensor::ContractionSolutionParams const& s) const noexcept
{
return hiptensor::Hash{}(s.dimsM(),
s.dimsN(),
Expand Down

0 comments on commit 28fe756

Please sign in to comment.