type_convert.hpp File Reference

type_convert.hpp File Reference#

Composable Kernel: type_convert.hpp File Reference
type_convert.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  ck_tile

Macros

#define CK_TILE_TYPE_CONVERT(dtype_, dname_, stype_, sname_)
#define CK_TILE_SCALED_TYPE_CONVERT(dtype_, dname_, stype_, sname_)

Functions

template<typename Y, typename X, std::enable_if_t<!(std::is_const_v< Y >||std::is_const_v< X >), bool > = false>
CK_TILE_HOST_DEVICE constexpr Y ck_tile::type_convert (X x)
template<typename Y, typename X, std::enable_if_t< std::is_const_v< Y >||std::is_const_v< X >, bool > = false>
CK_TILE_HOST_DEVICE constexpr Y ck_tile::type_convert (X x)
template<typename Y, typename X>
CK_TILE_HOST_DEVICE constexpr Y ck_tile::scaled_type_convert (X x, float scale)

Macro Definition Documentation

◆ CK_TILE_SCALED_TYPE_CONVERT

#define CK_TILE_SCALED_TYPE_CONVERT ( dtype_,
dname_,
stype_,
sname_ )
Value:
template <> \
CK_TILE_HOST_DEVICE constexpr dtype_ scaled_type_convert<dtype_, stype_>(stype_ x, \
float scale) \
{ \
return sname_##_to_##dname_(x, scale); \
} \
template <> \
CK_TILE_HOST_DEVICE constexpr dtype_ type_convert<dtype_, stype_>(stype_ x) \
{ \
return sname_##_to_##dname_(x, 1.f); \
}
#define CK_TILE_HOST_DEVICE
Definition config.hpp:42

◆ CK_TILE_TYPE_CONVERT

#define CK_TILE_TYPE_CONVERT ( dtype_,
dname_,
stype_,
sname_ )
Value:
template <> \
CK_TILE_HOST_DEVICE constexpr dtype_ type_convert<dtype_, stype_>(stype_ x) \
{ \
return sname_##_to_##dname_(x); \
}