forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirect_command_buffer.h
51 lines (42 loc) · 1.58 KB
/
direct_command_buffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2021 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef IREE_HAL_ROCM_DIRECT_COMMAND_BUFFER_H_
#define IREE_HAL_ROCM_DIRECT_COMMAND_BUFFER_H_
#include "experimental/rocm/context_wrapper.h"
#include "experimental/rocm/dynamic_symbols.h"
#include "experimental/rocm/rocm_headers.h"
#include "iree/base/api.h"
#include "iree/hal/api.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
typedef struct iree_arena_block_pool_t iree_arena_block_pool_t;
// ROCM Kernel Information Structure
typedef struct {
hipFunction_t func;
unsigned int gridDimX;
unsigned int gridDimY;
unsigned int gridDimZ;
unsigned int blockDimX;
unsigned int blockDimY;
unsigned int blockDimZ;
void** kernelParams;
} hip_launch_params;
// Creates a rocm direct command buffer.
iree_status_t iree_hal_rocm_direct_command_buffer_create(
iree_hal_device_t* device, iree_hal_rocm_context_wrapper_t* context,
iree_hal_command_buffer_mode_t mode,
iree_hal_command_category_t command_categories,
iree_hal_queue_affinity_t queue_affinity, iree_host_size_t binding_capacity,
iree_arena_block_pool_t* block_pool,
iree_hal_command_buffer_t** out_command_buffer);
// Returns true if |command_buffer| is a ROCM command buffer.
bool iree_hal_rocm_direct_command_buffer_isa(
iree_hal_command_buffer_t* command_buffer);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // IREE_HAL_ROCM_DIRECT_COMMAND_BUFFER_H_