GPUart  1.01
Prototype of GPUart, an application-based limited preemptive GPU scheduler for embedded real-time systems
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
GPUart_Service_IF.h
Go to the documentation of this file.
1 //Copyright (c) 2017-2018 Christoph A. Hartmann, Ulrich Margull and Technische Hochschule Ingolstadt (THI)
2 //
3 //Permission is hereby granted, free of charge, to any person obtaining a copy of this
4 //software and associated documentation files (the "Software"), to deal in the Software
5 //without restriction, including without limitation the rights to use, copy, modify,
6 //merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7 //permit persons to whom the Software is furnished to do so, subject to the following
8 //conditions:
9 //
10 //The above copyright notice and this permission notice shall be included in all copies
11 //or substantial portions of the Software.
12 //
13 //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14 //INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15 //PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
16 //HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 //OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18 //SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 
20 /*
21 * File: GPUart_Service_IF.h
22 * Created by: Christoph Hartmann
23 * Institute: Technische Hochschule Ingolstadt
24 * Date: 03.04.2017 */
25 /********************************************************
26 * ___ ___ ___ ___ 3 ___ *
27 * | | | | | |\ /| | | | | | *
28 * |___ | | |___| | \/ | | | |___ | | *
29 * | | | |\ | | | | | | | *
30 * | |___| | \ | | |___| ___| | |___ *
31 * *
32 *********************************************************/
33 
34 
50 #ifndef GPUART_SERVICE_IF_H
51 #define GPUART_SERVICE_IF_H
52 
53 
54 /************************************************************************************************/
55 /* Include */
56 /************************************************************************************************/
57 #include "../GPUart_Common/GPUart_Common.h"
58 
59 
60 
61 /************************************************************************************************/
62 /* Function declaration */
63 /************************************************************************************************/
64 
65 /* @brief Initialize GPU data for the Sobel1 kernel.
66  *
67  * All kernel related constant memory data can be initialized by calling this function.
68  * Initialize global memory data here.
69  * This function must be called before launching the first kernel instance.
70  *
71  * @param void
72  * @return GPUART_SUCCESS
73  */
75 (
76  void
77 );
78 
79 /* @brief Instantiates a Sobel1 kernel instance and updates kernel related GPU data.
80  *
81  * Checks whether the scheduler is ready to enqueue a new instance of this kernel.
82  * Updates kernel related GPU data and then instantiates kernel instance.
83  *
84  * @param[in] sint32* sob1_matrix_in_s32_swc -> Sobel1 input matrix.
85  *
86  * @return GPUART_SUCCESS if data have been updated and kernel has been instantiated successfully.
87  * @return GPUART_ERROR_NOT_READY if kernel has already been instantiated.
88  * @return GPUART_ERROR_INVALID_ARGUMENT if one ore more global memory IDs (#device_global_memory_id_e)
89  * inside this function are invalid.
90  */
92 (
94 );
95 
96 /* @brief Query whether Sobel1 kernel instance has completed and get kernel output data.
97  *
98  * Calls the scheduling layer (GPUart_Scheduler.h) to get the completion status of the current kernel instance and updates
99  * the output data of this kernel.
100  *
101  * @param[out] sint32* sob1_matrix_out_s32_swc -> Sobel1 output matrix.
102  *
103  * @return GPUART_SUCCESS if kernel instance has completed and data have been updated successfully.
104  * @return GPUART_ERROR_NOT_READY if kernel instance is still active.
105  * @return GPUART_ERROR_INVALID_ARGUMENT if one ore more global memory IDs (#device_global_memory_id_e)
106  * inside this functionare invalid.
107  */
109 (
111 );
112 
113 /* @brief Initialize GPU data for the Sobel2 kernel.
114  *
115  * All kernel related constant memory data can be initialized by calling this function.
116  * Initialize global memory data here.
117  * This function must be called before launching the first kernel instance.
118  *
119  * @param void
120  * @return GPUART_SUCCESS
121  */
123 (
124  void
125 );
126 
127 
128 /* @brief Instantiates a Sobel2 kernel instance and updates kernel related GPU data.
129  *
130  * Checks whether the scheduler is ready to enqueue a new instance of this kernel.
131  * Updates kernel related GPU data and then instantiates kernel instance.
132  *
133  * @param[in] sint32* sob2_matrix_in_s32_swc -> Sobel2 input matrix.
134  *
135  * @return GPUART_SUCCESS if data have been updated and kernel has been instantiated successfully.
136  * @return GPUART_ERROR_NOT_READY if kernel has already been instantiated.
137  * @return GPUART_ERROR_INVALID_ARGUMENT if one ore more global memory IDs (#device_global_memory_id_e)
138  * inside this function are invalid.
139  */
141 (
143 );
144 
145 /* @brief Query whether Sobel2 kernel instance has completed and get kernel output data.
146  *
147  * Calls the scheduling layer (GPUart_Scheduler.h) to get the completion status of the current kernel instance and updates
148  * the output data of this kernel.
149  *
150  * @param[out] sint32* sob2_matrix_out_s32_swc -> Sobel2 output matrix.
151  *
152  * @return GPUART_SUCCESS if kernel instance has completed and data have been updated successfully.
153  * @return GPUART_ERROR_NOT_READY if kernel instance is still active.
154  * @return GPUART_ERROR_INVALID_ARGUMENT if one ore more global memory IDs (#device_global_memory_id_e)
155  * inside this functionare invalid.
156  */
158 (
160 );
161 
162 /* @brief Initialize GPU data for the MatrMul kernel.
163  *
164  * All kernel related constant memory data can be initialized by calling this function.
165  * Initialize global memory data here.
166  * This function must be called before launching the first kernel instance.
167  *
168  * @param void
169  * @return GPUART_SUCCESS
170  */
172 (
173  void
174 );
175 
176 
178 (
181 );
182 
183 /* @brief Query whether MatrMul kernel instance has completed and get kernel output data.
184  *
185  * Calls the scheduling layer (GPUart_Scheduler.h) to get the completion status of the current kernel instance and updates
186  * the output data of this kernel.
187  *
188  * @param[out] float32* mm_MatrixC_f32_swc -> Output matrix C of the MatrMul kernel (C = A x B).
189  *
190  * @return GPUART_SUCCESS if kernel instance has completed and data have been updated successfully.
191  * @return GPUART_ERROR_NOT_READY if kernel instance is still active.
192  * @return GPUART_ERROR_INVALID_ARGUMENT if one ore more global memory IDs (#device_global_memory_id_e)
193  * inside this function are invalid.
194  */
196 (
198 );
199 
200 #endif
GPUart_Retval gpuA_MM_query(float32 *mm_MatrixC_f32_swc)
Query whether MatrMul kernel instance has completed and get kernel output data.
Definition: GPUart_Abstraction.cpp:341
int sob2_matrix_in_s32_swc[C_SOB2_HEIGHT *C_SOB2_WIDTH]
Definition: SWC_Sobel2.cpp:49
GPUart_Retval gpuA_MM_call(float32 *mm_MatrixA_f32_swc, float32 *mm_MatrixB_f32_swc)
Instantiates a MatrMul kernel instance and updates kernel related GPU data.
Definition: GPUart_Abstraction.cpp:306
int sob1_matrix_in_s32_swc[C_SOB1_HEIGHT *C_SOB1_WIDTH]
Definition: SWC_Sobel1.cpp:49
GPUart_Retval gpuA_Sobel2_query(sint32 *sob2_matrix_out_s32_swc)
Query whether Sobel2 kernel instance has completed and get kernel output data.
Definition: GPUart_Abstraction.cpp:256
GPUart_Retval gpuA_Sobel1_query(sint32 *sob1_matrix_out_s32_swc)
Query whether Sobel1 kernel instance has completed and get kernel output data.
Definition: GPUart_Abstraction.cpp:172
GPUart_Retval gpuA_Sobel2_call(sint32 *sob2_matrix_in_s32_swc)
Instantiates a Sobel2 kernel instance and updates kernel related GPU data.
Definition: GPUart_Abstraction.cpp:220
float float32
Definition: GPUart_Common.h:91
int sob2_matrix_out_s32_swc[C_SOB2_HEIGHT *C_SOB2_WIDTH]
Definition: SWC_Sobel2.cpp:50
GPUart_Retval gpuA_Sobel2_init(void)
Initialize GPU data for the Sobel2 kernel.
Definition: GPUart_Abstraction.cpp:200
float mm_MatrixB_f32_swc[C_MM_MATRIX_N *C_MM_MATRIX_N]
Definition: SWC_MM.cpp:49
int sob1_matrix_out_s32_swc[C_SOB1_HEIGHT *C_SOB1_WIDTH]
Definition: SWC_Sobel1.cpp:50
signed int sint32
Definition: GPUart_Common.h:79
float mm_MatrixA_f32_swc[C_MM_MATRIX_N *C_MM_MATRIX_N]
Definition: SWC_MM.cpp:48
GPUart_Retval gpuA_MM_init(void)
Initialize GPU data for the MatrMul kernel.
Definition: GPUart_Abstraction.cpp:285
float mm_MatrixC_f32_swc[C_MM_MATRIX_N *C_MM_MATRIX_N]
Definition: SWC_MM.cpp:50
GPUart_Retval gpuA_Sobel1_call(sint32 *sob1_matrix_in_s32_swc)
Instantiates a Sobel1 kernel instance and updates kernel related GPU data.
Definition: GPUart_Abstraction.cpp:140
GPUart_Retval gpuA_Sobel1_init(void)
Initialize GPU data for the Sobel1 kernel.
Definition: GPUart_Abstraction.cpp:121
signed int GPUart_Retval
The standard return type of functions in GPUart, representing an error code.
Definition: GPUart_Common.h:99