MLIR
21.0.0git
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
c
f
h
i
k
m
n
o
p
r
s
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
f
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
p
r
s
u
v
Related Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Variables
_
a
b
c
d
e
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
h
i
m
n
o
r
s
t
u
v
y
Enumerations
Enumerator
a
b
c
e
f
g
i
m
n
s
t
w
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
y
z
lib
Dialect
GPU
Utils
Utils.cpp
Go to the documentation of this file.
1
//===- Utils.cpp - GPU transforms utils -----------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// Implements GPU dialect transforms utils.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "
mlir/Dialect/GPU/Utils/GPUUtils.h
"
14
#include "llvm/Support/ErrorHandling.h"
15
16
namespace
mlir::gpu
{
17
18
vector::CombiningKind
convertReductionKind
(gpu::AllReduceOperation mode) {
19
switch
(mode) {
20
#define MAP_CASE(X) \
21
case gpu::AllReduceOperation::X: \
22
return vector::CombiningKind::X
23
24
MAP_CASE
(ADD);
25
MAP_CASE
(MUL);
26
MAP_CASE
(
MINUI
);
27
MAP_CASE
(MINSI);
28
MAP_CASE
(MINNUMF);
29
MAP_CASE
(MAXSI);
30
MAP_CASE
(MAXUI);
31
MAP_CASE
(MAXNUMF);
32
MAP_CASE
(AND);
33
MAP_CASE
(OR);
34
MAP_CASE
(XOR);
35
MAP_CASE
(MINIMUMF);
36
MAP_CASE
(MAXIMUMF);
37
38
#undef MAP_CASE
39
}
40
41
llvm_unreachable(
"Vector and GPU reduction kinds should match 1:1"
);
42
}
43
44
}
// namespace mlir::gpu
MAP_CASE
#define MAP_CASE(X)
GPUUtils.h
MINUI
#define MINUI(lhs, rhs)
Definition:
SparseTensorIterator.cpp:37
mlir::gpu
Definition:
GPUCommonPass.h:35
mlir::gpu::convertReductionKind
vector::CombiningKind convertReductionKind(gpu::AllReduceOperation mode)
Returns the matching vector combining kind.
Definition:
Utils.cpp:18
Generated on Mon May 19 2025 00:47:29 for MLIR by
1.9.1