xref: /aosp_15_r20/external/executorch/kernels/test/op_acosh_test.cpp (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #include <executorch/kernels/test/FunctionHeaderWrapper.h> // Declares the operator
10 #include <executorch/kernels/test/UnaryUfuncRealHBBF16ToFloatHBF16Test.h>
11 
12 #include <gtest/gtest.h>
13 
14 #include <cmath>
15 
16 using exec_aten::Tensor;
17 
18 class OpAcoshOutTest
19     : public torch::executor::testing::UnaryUfuncRealHBBF16ToFloatHBF16Test {
20  protected:
op_out(const Tensor & self,Tensor & out)21   Tensor& op_out(const Tensor& self, Tensor& out) override {
22     return torch::executor::aten::acosh_outf(context_, self, out);
23   }
24 
op_reference(double x) const25   double op_reference(double x) const override {
26     return std::acosh(x);
27   }
28 
29   torch::executor::testing::SupportedFeatures* get_supported_features()
30       const override;
31 };
32 
33 IMPLEMENT_UNARY_UFUNC_REALHB_TO_FLOATH_TEST(OpAcoshOutTest)
34