|
| 1 | +//***************************************************************************** |
| 2 | +// Copyright (c) 2016-2020, Intel Corporation |
| 3 | +// All rights reserved. |
| 4 | +// |
| 5 | +// Redistribution and use in source and binary forms, with or without |
| 6 | +// modification, are permitted provided that the following conditions are met: |
| 7 | +// - Redistributions of source code must retain the above copyright notice, |
| 8 | +// this list of conditions and the following disclaimer. |
| 9 | +// - Redistributions in binary form must reproduce the above copyright notice, |
| 10 | +// this list of conditions and the following disclaimer in the documentation |
| 11 | +// and/or other materials provided with the distribution. |
| 12 | +// |
| 13 | +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 14 | +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 16 | +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 17 | +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 | +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 | +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 | +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 | +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 | +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 | +// THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | +//***************************************************************************** |
| 25 | + |
| 26 | +/* |
| 27 | + * This header file contains internal function declarations related to FPTR interface. |
| 28 | + * It should not contains public declarations |
| 29 | + */ |
| 30 | + |
| 31 | +#pragma once |
| 32 | +#ifndef BACKEND_FPTR_H // Cython compatibility |
| 33 | +#define BACKEND_FPTR_H |
| 34 | + |
| 35 | +#include <map> |
| 36 | + |
| 37 | +#include <backend_iface_fptr.hpp> |
| 38 | + |
| 39 | + |
| 40 | +/** |
| 41 | + * Data storage type of the FPTR interface |
| 42 | + * |
| 43 | + * map[FunctionName][InputType2][InputType2] |
| 44 | + * |
| 45 | + * Function name is enum DPNPFuncName |
| 46 | + * InputTypes are presented as enum DPNPFuncType |
| 47 | + * |
| 48 | + * contains structure with kernel information |
| 49 | + * |
| 50 | + * if the kernel requires only one input type - use same type for both parameters |
| 51 | + * |
| 52 | + */ |
| 53 | +typedef std::map<DPNPFuncType, DPNPFuncData_t> map_2p_t; |
| 54 | +typedef std::map<DPNPFuncType, map_2p_t> map_1p_t; |
| 55 | +typedef std::map<DPNPFuncName, map_1p_t> func_map_t; |
| 56 | + |
| 57 | +/** |
| 58 | + * Internal shortcuts for Data type enum values |
| 59 | + */ |
| 60 | +const DPNPFuncType eft_INT = DPNPFuncType::DPNP_FT_INT; |
| 61 | +const DPNPFuncType eft_LNG = DPNPFuncType::DPNP_FT_LONG; |
| 62 | +const DPNPFuncType eft_FLT = DPNPFuncType::DPNP_FT_FLOAT; |
| 63 | +const DPNPFuncType eft_DBL = DPNPFuncType::DPNP_FT_DOUBLE; |
| 64 | + |
| 65 | +/** |
| 66 | + * FPTR interface initialization functions |
| 67 | + */ |
| 68 | +void func_map_init_manipulation(func_map_t &fmap); |
| 69 | + |
| 70 | +#endif // BACKEND_FPTR_H |
0 commit comments