XeTLA v0.3.6
IntelĀ® Xe Templates for Linear Algebra - API Definition Document
 
Loading...
Searching...
No Matches
tensor_descriptor.hpp
Go to the documentation of this file.
1/*******************************************************************************
2* Copyright (c) 2022-2023 Intel Corporation
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*******************************************************************************/
16
19
20#pragma once
21
23
24namespace gpu::xetla {
25
26namespace detail {
28 xetla_tdescriptor_ref desc, uint64_t base_address) {
29 desc.xetla_format<uint64_t>().xetla_select<1, 1>(0) = base_address;
30}
32 xetla_tdescriptor_ref desc, uint32_t base_address) {
33 desc.xetla_format<uint32_t>().xetla_select<1, 1>(0) = base_address;
34}
36 return desc.xetla_format<uint64_t>().xetla_select<1, 1>(0)[0];
37}
38
40 xetla_tdescriptor_ref desc, uint32_t width_x) {
41 desc.xetla_format<uint32_t>().xetla_select<1, 1>(2) = width_x;
42}
44 return desc.xetla_format<uint32_t>().xetla_select<1, 1>(2)[0];
45}
46
48 xetla_tdescriptor_ref desc, uint32_t width_y) {
49 desc.xetla_format<uint32_t>().xetla_select<1, 1>(3) = width_y;
50}
52 return desc.xetla_format<uint32_t>().xetla_select<1, 1>(3)[0];
53}
54
56 xetla_tdescriptor_ref desc, uint32_t pitch_x) {
57 desc.xetla_format<uint32_t>().xetla_select<1, 1>(4) = pitch_x;
58}
60 return desc.xetla_format<uint32_t>().xetla_select<1, 1>(4)[0];
61}
62
64 xetla_tdescriptor_ref desc, int32_t offset_x) {
65 desc.xetla_format<int32_t>().xetla_select<1, 1>(5) = offset_x;
66}
68 return desc.xetla_format<int32_t>().xetla_select<1, 1>(5)[0];
69}
70
72 xetla_tdescriptor_ref desc, int32_t offset_y) {
73 desc.xetla_format<int32_t>().xetla_select<1, 1>(6) = offset_y;
74}
76 return desc.xetla_format<int32_t>().xetla_select<1, 1>(6)[0];
77}
78
80 xetla_tdescriptor_ref desc, uint32_t block_widthx_widthy_arrlen) {
81 desc.xetla_format<uint32_t>().xetla_select<1, 1>(7)
82 = block_widthx_widthy_arrlen;
83}
85 return desc.xetla_format<uint8_t>().xetla_select<1, 1>(28)[0];
86}
88 return desc.xetla_format<uint8_t>().xetla_select<1, 1>(29)[0];
89}
91 return desc.xetla_format<uint8_t>().xetla_select<1, 1>(30)[0];
92}
93} // namespace detail
94
95} // namespace gpu::xetla
C++ API.
#define __XETLA_API
Definition common.hpp:43
xetla_vector< uint32_t, 16 > xetla_tdescriptor
Description of nd tensor descriptor for load and store.
Definition base_types.hpp:155
#define xetla_tdescriptor_ref
Alias to xetla_vector<uint32_t, 16> reference.
Definition base_types.hpp:158
__XETLA_API void xetla_set_tensor_offset_y(xetla_tdescriptor_ref desc, int32_t offset_y)
Definition tensor_descriptor.hpp:71
__XETLA_API uint8_t xetla_get_block_array_len(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:90
__XETLA_API uint8_t xetla_get_block_width_x(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:84
__XETLA_API uint32_t xetla_get_tensor_width_y(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:51
__XETLA_API void xetla_set_tensor_width_x(xetla_tdescriptor_ref desc, uint32_t width_x)
Definition tensor_descriptor.hpp:39
__XETLA_API void xetla_set_tensor_width_y(xetla_tdescriptor_ref desc, uint32_t width_y)
Definition tensor_descriptor.hpp:47
__XETLA_API uint32_t xetla_get_tensor_width_x(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:43
__XETLA_API void xetla_set_tensor_base_address(xetla_tdescriptor_ref desc, uint64_t base_address)
Definition tensor_descriptor.hpp:27
__XETLA_API void xetla_set_tensor_offset_x(xetla_tdescriptor_ref desc, int32_t offset_x)
Definition tensor_descriptor.hpp:63
__XETLA_API uint8_t xetla_get_block_width_y(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:87
__XETLA_API void xetla_set_tensor_pitch_x(xetla_tdescriptor_ref desc, uint32_t pitch_x)
Definition tensor_descriptor.hpp:55
__XETLA_API void xetla_set_block_widthx_widthy_arrlen(xetla_tdescriptor_ref desc, uint32_t block_widthx_widthy_arrlen)
Definition tensor_descriptor.hpp:79
__XETLA_API int32_t xetla_get_tensor_offset_x(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:67
__XETLA_API uint64_t xetla_get_tensor_base_address(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:35
__XETLA_API uint32_t xetla_get_tensor_pitch_x(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:59
__XETLA_API int32_t xetla_get_tensor_offset_y(xetla_tdescriptor desc)
Definition tensor_descriptor.hpp:75
Definition arch_config.hpp:24