Commit 598cfd77 authored by Andriy Roshchenko's avatar Andriy Roshchenko
Browse files

Merge branch 'origin/gfx950' into 'andriy/lwpck-2243'.

parents 79a4b17f 87ea11d0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved. // Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "profiler/profile_pool3d_fwd_impl.hpp" #include "profiler/profile_pool3d_fwd_impl.hpp"
...@@ -16,10 +16,20 @@ class TestMaxPool3dFwd : public ::testing::Test ...@@ -16,10 +16,20 @@ class TestMaxPool3dFwd : public ::testing::Test
std::vector<PoolingParam> params; std::vector<PoolingParam> params;
ck::profiler::PoolFwdInputParams in_params_max_pool{true, 2, false, false, false, 0};
ck::profiler::PoolFwdInputParams in_params_max_pool_indexed{true, 2, false, false, true, 0};
void Run() void Run()
{ {
for(auto param : params) for(auto param : params)
{ {
ck::profiler::PoolFwdKernelParams kernel_params{param.length_,
param.window_spatial_lengths_,
param.window_strides_,
param.window_dilations_,
param.input_left_pads_,
param.input_right_pads_};
// max pool // max pool
bool success = bool success =
ck::profiler::profile_pool3d_fwd_impl<InDataType, ck::profiler::profile_pool3d_fwd_impl<InDataType,
...@@ -30,16 +40,7 @@ class TestMaxPool3dFwd : public ::testing::Test ...@@ -30,16 +40,7 @@ class TestMaxPool3dFwd : public ::testing::Test
ck::tensor_layout::convolution::NDHWC, ck::tensor_layout::convolution::NDHWC,
ck::ReduceTensorOp::MAX, ck::ReduceTensorOp::MAX,
false, false,
false>(true, false>(in_params_max_pool, kernel_params);
2,
false,
false,
param.length_,
param.window_spatial_lengths_,
param.window_strides_,
param.window_dilations_,
param.input_left_pads_,
param.input_right_pads_);
EXPECT_TRUE(success); EXPECT_TRUE(success);
// max pool + index // max pool + index
...@@ -51,27 +52,18 @@ class TestMaxPool3dFwd : public ::testing::Test ...@@ -51,27 +52,18 @@ class TestMaxPool3dFwd : public ::testing::Test
ck::tensor_layout::convolution::NDHWC, ck::tensor_layout::convolution::NDHWC,
ck::ReduceTensorOp::MAX, ck::ReduceTensorOp::MAX,
false, false,
true>(true, true>(in_params_max_pool_indexed,
2, kernel_params);
false,
false,
param.length_,
param.window_spatial_lengths_,
param.window_strides_,
param.window_dilations_,
param.input_left_pads_,
param.input_right_pads_);
EXPECT_TRUE(success); EXPECT_TRUE(success);
} }
} }
}; };
#ifdef CK_ENABLE_FP16 using KernelTypes = ::testing::Types<std::tuple<I8, I8, I8, I32>,
using KernelTypes = std::tuple<F8, F8, F8, I32>,
::testing::Types<std::tuple<F16, F16, F32, I32>, std::tuple<F32, F32, F32, I32>>; std::tuple<F16, F16, F16, I32>,
#else std::tuple<BF16, BF16, BF16, I32>,
using KernelTypes = ::testing::Types<std::tuple<F32, F32, F32, I32>>; std::tuple<F32, F32, F32, I32>>;
#endif
TYPED_TEST_SUITE(TestMaxPool3dFwd, KernelTypes); TYPED_TEST_SUITE(TestMaxPool3dFwd, KernelTypes);
TYPED_TEST(TestMaxPool3dFwd, Test_Pool) TYPED_TEST(TestMaxPool3dFwd, Test_Pool)
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved. // Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "ck/ck.hpp" #include "ck/ck.hpp"
using I8 = int8_t;
using F8 = ck::f8_t;
using F16 = ck::half_t; using F16 = ck::half_t;
using BF16 = ck::bhalf_t; using BF16 = ck::bhalf_t;
using F32 = float; using F32 = float;
using I32 = int32_t; using I32 = int32_t;
using I8 = int8_t;
using F8 = ck::f8_t;
using ck::index_t; using ck::index_t;
using NDHWC = ck::tensor_layout::convolution::NDHWC; using NDHWC = ck::tensor_layout::convolution::NDHWC;
using NHWC = ck::tensor_layout::convolution::NHWC;
struct PoolingParam struct PoolingParam
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment