| 1 | // Copyright 2020 Google LLC |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | // Demo interface to target-specific code in skeleton.cc |
| 17 | |
| 18 | // Normal header with include guard and namespace. |
| 19 | #ifndef HIGHWAY_HWY_EXAMPLES_SKELETON_H_ |
| 20 | #define HIGHWAY_HWY_EXAMPLES_SKELETON_H_ |
| 21 | |
| 22 | #include <stddef.h> |
| 23 | |
| 24 | // Platform-specific definitions used for declaring an interface, independent of |
| 25 | // the SIMD instruction set. |
| 26 | #include "hwy/base.h" // HWY_RESTRICT |
| 27 | |
| 28 | namespace skeleton { |
| 29 | |
| 30 | // Computes base-2 logarithm by converting to float. Supports dynamic dispatch. |
| 31 | HWY_DLLEXPORT void CallFloorLog2(const uint8_t* HWY_RESTRICT in, |
| 32 | const size_t count, uint8_t* HWY_RESTRICT out); |
| 33 | |
| 34 | } // namespace skeleton |
| 35 | |
| 36 | #endif // HIGHWAY_HWY_EXAMPLES_SKELETON_H_ |