-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathgcd.cc
More file actions
26 lines (20 loc) · 728 Bytes
/
gcd.cc
File metadata and controls
26 lines (20 loc) · 728 Bytes
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
#include "infinicore/ops/gcd.hpp"
#include "../../utils.hpp"
namespace infinicore::op {
common::OpDispatcher<Gcd::schema> &Gcd::dispatcher() {
static common::OpDispatcher<Gcd::schema> dispatcher_;
return dispatcher_;
};
void Gcd::execute(Tensor input, Tensor other, Tensor output) {
infinicore::context::setDevice(input->device());
dispatcher().lookup(input->device().getType())(input, other, output);
}
Tensor gcd(Tensor input, Tensor other) {
auto output = Tensor::empty(input->shape(), input->dtype(), input->device());
gcd_(input, other, output);
return output;
}
void gcd_(Tensor input, Tensor other, Tensor output) {
Gcd::execute(input, other, output);
}
} // namespace infinicore::op