// Copyright (c) Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #include #include "smoothquant.hpp" #include #pragma once using S = ck_tile::stream_config; using A = smoothquant_args; template using trait_ = smoothquant_traits_; template float smoothquant_(const S& s, A a) { using DataType = typename Traits_::DataType; using PipelineProblem = ck_tile::SmoothquantPipelineProblem< typename SmoothquantTypeConfig::XDataType, typename SmoothquantTypeConfig::SmoothScaleDataType, typename SmoothquantTypeConfig::ComputeDataType, typename SmoothquantTypeConfig::YScaleDataType, typename SmoothquantTypeConfig::QYDataType, typename Traits_::Shape, Traits_::kPadN, Traits_::kTwoPass>; using OnePassPipeline = ck_tile::SmoothquantPipelineOnePass; using TwoPassPipeline = ck_tile::SmoothquantPipelineTwoPass; using Pipeline = std::conditional_t; using Kernel = ck_tile::Smoothquant; const dim3 grids = Kernel::GridSize(a); const dim3 blocks = Kernel::BlockSize(); constexpr ck_tile::index_t kBlockPerCu = 1; auto kargs = Kernel::MakeKargs(a); if(s.log_level_ > 0) std::cout << ", " << Kernel::GetName() << std::flush; return ck_tile::launch_kernel( s, ck_tile::make_kernel(Kernel{}, grids, blocks, 0, kargs)); }