print.hpp Source File# Composable Kernel: print.hpp Source File includeck_tilecoreutility print.hpp Go to the documentation of this file. 1// SPDX-License-Identifier: MIT 2// Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved. 3 4#pragma once 5 6#include "ck_tile/core/config.hpp" 7 8namespace ck_tile { 9 12template <typename T> 13CK_TILE_HOST_DEVICE void print(const T&) 14{ 15 static_assert(sizeof(T) == 0, 16 "No print implementation available for this type. Please specialize " 17 "ck_tile::print for your type."); 18} 19 21template <> 22CK_TILE_HOST_DEVICE void print(const int& value) 23{ 24 printf("%d", value); 25} 26 28template <> 29CK_TILE_HOST_DEVICE void print(const float& value) 30{ 31 printf("%f", value); 32} 33 35template <> 36CK_TILE_HOST_DEVICE void print(const double& value) 37{ 38 printf("%f", value); 39} 40 42template <> 43CK_TILE_HOST_DEVICE void print(const long& value) 44{ 45 printf("%ld", value); 46} 47 49template <> 50CK_TILE_HOST_DEVICE void print(const unsigned int& value) 51{ 52 printf("%u", value); 53} 54 56template <> 57CK_TILE_HOST_DEVICE void print(const char& value) 58{ 59 printf("%c", value); 60} 61 63template <typename T, size_t N> 64CK_TILE_HOST_DEVICE void print(const T (&value)[N]) 65{ 66 printf("["); 67 for(size_t i = 0; i < N; ++i) 68 { 69 if(i > 0) 70 printf(", "); 71 print(value[i]); // Recursively call print for each element 72 } 73 printf("]"); 74} 75 76} // 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 valueconst GenericPointer< typename T::ValueType > T2 valueDefinition pointer.h:1697