stream_config.hpp 1.18 KB
Newer Older
carlushuang's avatar
carlushuang committed
1
2
3
4
5
6
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include <hip/hip_runtime.h>
dummycoderfe's avatar
dummycoderfe committed
7
#include "device_memory.hpp"
carlushuang's avatar
carlushuang committed
8
9

namespace ck_tile {
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * construct this structure with behavior as:
 *
 *   // create stream config with default stream(NULL), and not timing the kernel
 *   stream_config s = stream_config{};
 *
 *   // create stream config with _some_stream_id_, and not timing the kernel
 *   stream_config s = stream_config{_some_stream_id_};
 *
 *   // create stream config with _some_stream_id_, and benchmark with warmup/repeat as default
 *   stream_config s = stream_config{_some_stream_id_, true};
 *
 *   // create stream config with _some_stream_id_, and benchmark using cpu timer
 *   stream_config s = stream_config{_some_stream_id_, true, 0, 3, 10, false};
 **/

carlushuang's avatar
carlushuang committed
26
27
28
29
30
31
32
struct stream_config
{
    hipStream_t stream_id_ = nullptr;
    bool time_kernel_      = false;
    int log_level_         = 0;
    int cold_niters_       = 3;
    int nrepeat_           = 10;
33
    bool is_gpu_timer_     = true; // keep compatible
dummycoderfe's avatar
dummycoderfe committed
34
35
36
    bool clear_cache = false;
    size_t buf_size = 0;
    DeviceMem cache_buf{buf_size};
carlushuang's avatar
carlushuang committed
37
38
};
} // namespace ck_tile