xref: /aosp_15_r20/external/executorch/kernels/test/op_asin_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 class OpAsinOutTest
18     : public torch::executor::testing::UnaryUfuncRealHBBF16ToFloatHBF16Test {
19  protected:
op_out(const Tensor & self,Tensor & out)20   Tensor& op_out(const Tensor& self, Tensor& out) override {
21     return torch::executor::aten::asin_outf(context_, self, out);
22   }
23 
op_reference(double x) const24   double op_reference(double x) const override {
25     return std::asin(x);
26   }
27 
28   torch::executor::testing::SupportedFeatures* get_supported_features()
29       const override;
30 };
31 
32 IMPLEMENT_UNARY_UFUNC_REALHB_TO_FLOATH_TEST(OpAsinOutTest)
33