Grok 12.0.1
skeleton.h
Go to the documentation of this file.
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// Platform-specific definitions used for declaring an interface, independent of
23// the SIMD instruction set.
24#include "hwy/base.h" // HWY_RESTRICT
25
26namespace skeleton {
27
28// Computes base-2 logarithm by converting to float. Supports dynamic dispatch.
29HWY_DLLEXPORT void CallFloorLog2(const uint8_t* HWY_RESTRICT in, size_t count,
30 uint8_t* HWY_RESTRICT out);
31
32// Same, but uses HWY_DYNAMIC_POINTER to save a function pointer and call it.
34 size_t count, uint8_t* HWY_RESTRICT out);
35
36} // namespace skeleton
37
38#endif // HIGHWAY_HWY_EXAMPLES_SKELETON_H_
#define HWY_RESTRICT
Definition base.h:95
#define HWY_DLLEXPORT
Definition highway_export.h:13
Definition skeleton-inl.h:36
HWY_DLLEXPORT void CallFloorLog2(const uint8_t *HWY_RESTRICT in, size_t count, uint8_t *HWY_RESTRICT out)
HWY_DLLEXPORT void SavedCallFloorLog2(const uint8_t *HWY_RESTRICT in, size_t count, uint8_t *HWY_RESTRICT out)