1 /******************************************************************************\r
2 * Copyright (c) 2015, Texas Instruments Incorporated - http://www.ti.com\r
3 * All rights reserved.\r
4 *\r
5 * Redistribution and use in source and binary forms, with or without\r
6 * modification, are permitted provided that the following conditions are met:\r
7 * * Redistributions of source code must retain the above copyright\r
8 * notice, this list of conditions and the following disclaimer.\r
9 * * Redistributions in binary form must reproduce the above copyright\r
10 * notice, this list of conditions and the following disclaimer in the\r
11 * documentation and/or other materials provided with the distribution.\r
12 * * Neither the name of Texas Instruments Incorporated nor the\r
13 * names of its contributors may be used to endorse or promote products\r
14 * derived from this software without specific prior written permission.\r
15 *\r
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r
26 * THE POSSIBILITY OF SUCH DAMAGE.\r
27 *****************************************************************************/\r
28 #ifndef _TICBLAS_H\r
29 #define _TICBLAS_H\r
30 \r
31 #include <stddef.h> \r
32 \r
33 /** @defgroup ti_cblas_api CBLAS API Extension for TI-DSP \r
34 * @{\r
35 */\r
36 /** @} */\r
37 \r
38 /** @addtogroup ti_cblas_api \r
39 * @{\r
40 * @name Error Return Codes\r
41 */\r
42 /*@{*/\r
43 #define TICBLAS_SUCCESS (0) /**< Success. No error. */\r
44 #define TICBLAS_ERROR (-1) /**< Failure. */ \r
45 /*@}*/\r
46 /** @} */\r
47 \r
48 /**\r
49 * @ingroup ti_cblas_api\r
50 * @brief Function tiCblasGetSizes() returns the required size of each of the\r
51 * memory types defined by the Library Architecture and Framework \r
52 * (LibArch)\r
53 *\r
54 * @param[out] smem_size_vfast size of very fast shared memory \r
55 * @param[out] smem_size_fast size of fast shared memory \r
56 * @param[out] smem_size_medium size of medium speed shared memory \r
57 * @param[out] smem_size_slow size of slow shared memory \r
58 *\r
59 */\r
60 void tiCblasGetSizes(size_t *smem_size_vfast, size_t *smem_size_fast, \r
61 size_t *smem_size_medium, size_t *smem_size_slow);\r
62 \r
63 /**\r
64 * @ingroup ti_cblas_api\r
65 * @brief Function tiCblasNew() creates an instance for CBLAS.\r
66 *\r
67 * @remarks tiCblasNew() MUST be called before tiCblasInit().\r
68 *\r
69 * @retval TICBLAS_SUCCESS @copydoc TICBLAS_SUCCESS\r
70 * @retval TICBLAS_ERROR @copydoc TICBLAS_ERROR\r
71 */\r
72 int tiCblasNew();\r
73 \r
74 /**\r
75 * @ingroup ti_cblas_api\r
76 * @brief Function tiCblasInit() performs heap initialization for CBLAS \r
77 * to do memory allocations.\r
78 * \r
79 * @remarks tiCblasInit() must NOT be called before tiCblasNew(). \r
80 *\r
81 * @param[in] mem_vfast_base base of very fast shared memory \r
82 * @param[in] mem_vfast_size size of very fast shared memory \r
83 * @param[in] mem_fast_base base of fast shared memory \r
84 * @param[in] mem_fast_size size of fast shared memory \r
85 * @param[in] mem_medium_base base of medium speed shared memory \r
86 * @param[in] mem_medium_size size of medium speed shared memory \r
87 * @param[in] mem_slow_base base of slow shared memory \r
88 * @param[in] mem_slow_size size of slow shared memory \r
89 *\r
90 * @retval TICBLAS_SUCCESS @copydoc TICBLAS_SUCCESS\r
91 * @retval TICBLAS_ERROR @copydoc TICBLAS_ERROR\r
92 */\r
93 int tiCblasInit(void * mem_vfast_base, size_t mem_vfast_size,\r
94 void * mem_fast_base, size_t mem_fast_size,\r
95 void * mem_medium_base, size_t mem_medium_size,\r
96 void * mem_slow_base, size_t mem_slow_size);\r
97 \r
98 /**\r
99 * @ingroup ti_cblas_api\r
100 * @brief Function tiCblasDelete() deletes the instance of CBLAS created by\r
101 * tiCblasNew(). \r
102 *\r
103 * @retval TICBLAS_SUCCESS @copydoc TICBLAS_SUCCESS\r
104 * @retval TICBLAS_ERROR @copydoc TICBLAS_ERROR\r
105 */\r
106 int tiCblasDelete();\r
107 \r
108 #endif /* _TICBLAS_H */\r