Skip to content

Commit 0c85351

Browse files
authored
Remove clang::optnone attribute for IgammaFunctor (#2351)
This "clang::optnone" attribute was added by commit c303e58, which may be a work-around to solve compiler issue at that time. Now we don't need it anymore.
1 parent 549347d commit 0c85351

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/ATen/native/xpu/sycl/IGammaKernel.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@ namespace at::native::xpu {
99

1010
template <typename scalar_t>
1111
struct IgammaFunctor {
12-
IgammaFunctor(bool calc_igammac) : calc_igammac_(calc_igammac) {}
13-
bool calc_igammac_;
14-
[[clang::optnone]] scalar_t operator()(scalar_t a, scalar_t b) const {
15-
if (calc_igammac_) {
16-
return calc_igammac<scalar_t>(a, b);
17-
} else {
18-
return calc_igamma<scalar_t>(a, b);
19-
}
12+
scalar_t operator()(scalar_t a, scalar_t b) const {
13+
return calc_igamma<scalar_t>(a, b);
14+
}
15+
};
16+
17+
template <typename scalar_t>
18+
struct IgammacFunctor {
19+
scalar_t operator()(scalar_t a, scalar_t b) const {
20+
return calc_igammac<scalar_t>(a, b);
2021
}
2122
};
2223

2324
void igamma_kernel(TensorIteratorBase& iter) {
2425
AT_DISPATCH_FLOATING_TYPES(iter.common_dtype(), "igamma_xpu", [&]() {
25-
gpu_kernel(iter, IgammaFunctor<scalar_t>(false));
26+
gpu_kernel(iter, IgammaFunctor<scalar_t>());
2627
});
2728
}
2829

2930
void igammac_kernel(TensorIteratorBase& iter) {
3031
AT_DISPATCH_FLOATING_TYPES(iter.common_dtype(), "igammac_xpu", [&]() {
31-
gpu_kernel(iter, IgammaFunctor<scalar_t>(true));
32+
gpu_kernel(iter, IgammacFunctor<scalar_t>());
3233
});
3334
}
3435

0 commit comments

Comments
 (0)