XeTLA v0.3.6
IntelĀ® Xe Templates for Linear Algebra - API Definition Document
 
Loading...
Searching...
No Matches
work_group.hpp
Go to the documentation of this file.
1
2/*******************************************************************************
3* Copyright (c) 2022-2023 Intel Corporation
4*
5* Licensed under the Apache License, Version 2.0 (the "License");
6* you may not use this file except in compliance with the License.
7* You may obtain a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*******************************************************************************/
17
20
21#pragma once
22
24
25namespace gpu::xetla {
26
29
33template <uint32_t size_>
35private:
36 uint32_t sg_id;
37
38public:
39 static constexpr uint32_t size = size_;
40 __XETLA_API constexpr uint32_t get_size() { return size; }
41 __XETLA_API uint32_t get_id() { return sg_id; }
42 __XETLA_API void init(uint32_t id) { sg_id = id; }
43 inline work_group_t(uint32_t id) : sg_id(id) {}
44 inline work_group_t() = default;
45 template <uint32_t scope_size>
48 wtile.init(sg_id % scope_size);
49 return wtile;
50 }
51};
53} // namespace gpu::xetla
#define __XETLA_API
Definition common.hpp:43
C++ API.
Definition arch_config.hpp:24
Define a workgroup scope for a specific problem shape.
Definition work_group.hpp:34
__XETLA_API work_group_t< scope_size > partition()
Definition work_group.hpp:46
static constexpr uint32_t size
Definition work_group.hpp:39
work_group_t(uint32_t id)
Definition work_group.hpp:43
__XETLA_API void init(uint32_t id)
Definition work_group.hpp:42
__XETLA_API constexpr uint32_t get_size()
Definition work_group.hpp:40
__XETLA_API uint32_t get_id()
Definition work_group.hpp:41