/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #ifdef EXECUTORCH_SELECTIVE_BUILD_DTYPE // include header generated by // executorch/codegen/tools/gen_selected_op_variants.py #include #else // dummy implementation inline constexpr bool should_include_kernel_dtype( const char* /*operator_name*/, exec_aten::ScalarType /*scalar_type*/ ) { return true; } #endif namespace torch { namespace executor { #define ET_INTERNAL_CHECK_SELECTIVE_BUILD(enum_type) \ do { \ if (!should_include_kernel_dtype(et_switch_name, enum_type)) { \ ET_LOG( \ Error, \ "dtype '%" PRId8 "' not selected for operator %s", \ static_cast(enum_type), \ et_switch_name); \ torch::executor::runtime_abort(); \ } \ } while (0) } // namespace executor } // namespace torch #include