bit_cast.hpp Source File# Composable Kernel: bit_cast.hpp Source File includeck_tilecoreutility bit_cast.hpp Go to the documentation of this file. 1// SPDX-License-Identifier: MIT 2// Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved. 3 4#pragma once 5 6#include "ck_tile/core/config.hpp" 7 8namespace ck_tile { 9 10template <typename Y, typename X> 11CK_TILE_HOST_DEVICE constexpr Y bit_cast(const X& x) 12{ 13 static_assert(__has_builtin(__builtin_bit_cast), ""); 14 static_assert(sizeof(X) == sizeof(Y), "Do not support cast between different size of type"); 15 16 return __builtin_bit_cast(Y, x); 17} 18 19} // namespace ck_tile config.hpp CK_TILE_HOST_DEVICE#define CK_TILE_HOST_DEVICEDefinition config.hpp:42 ck_tileDefinition tile/core/algorithm/cluster_descriptor.hpp:13 ck_tile::bit_castCK_TILE_HOST_DEVICE constexpr Y bit_cast(const X &x)Definition bit_cast.hpp:11