mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-19 22:39:03 +00:00
[CK_TILE] Add pooling to ckTileEngine part2
This commit is contained in:
@@ -187,7 +187,8 @@ python gemm_instance_builder.py \
|
||||
--datatype fp16 \
|
||||
--layout rcr \
|
||||
--config_json configs/user_provided_config.json \
|
||||
--gen_all_individual
|
||||
--gen_all_individual \
|
||||
--gpu_target gfx942
|
||||
```
|
||||
|
||||
#### gemm_instance_builder_parallel.py
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
|
||||
#include "ck_tile/host/device_prop.hpp"
|
||||
#include "ck_tile/ops/pooling.hpp"
|
||||
#include "pool_benchmark.hpp"
|
||||
|
||||
class PoolProfiler
|
||||
{
|
||||
public:
|
||||
static PoolProfiler& instance(Settings settings)
|
||||
{
|
||||
static PoolProfiler instance{settings};
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Overload for single kernel benchmarking
|
||||
void benchmark(PoolProblem& pool_problem,
|
||||
std::function<float(const ck_tile::PoolHostArgs&, const ck_tile::stream_config&)>
|
||||
kernel_func)
|
||||
{
|
||||
// Create a vector with a single callable that returns both name and time
|
||||
std::vector<std::function<std::tuple<std::string, float>(ck_tile::PoolHostArgs&,
|
||||
const ck_tile::stream_config&)>>
|
||||
callables;
|
||||
|
||||
callables.push_back(
|
||||
[kernel_func](ck_tile::PoolHostArgs& args, const ck_tile::stream_config& stream) {
|
||||
float time = kernel_func(args, stream);
|
||||
return std::make_tuple(std::string(KERNEL_NAME), time);
|
||||
});
|
||||
|
||||
benchmark(pool_problem, callables);
|
||||
}
|
||||
////
|
||||
|
||||
|
||||
|
||||
////
|
||||
PoolProfiler(const PoolProfiler&) = delete;
|
||||
PoolProfiler& operator=(const PoolProfiler&) = delete;
|
||||
|
||||
private:
|
||||
~PoolProfiler() { kernel_instances_.clear(); }
|
||||
PoolProfiler(Settings settings) : settings_(settings) {}
|
||||
|
||||
Settings settings_;
|
||||
|
||||
std::vector<KernelInstance> kernel_instances_;
|
||||
}
|
||||
Reference in New Issue
Block a user