Tensor Tiling Library
 
Loading...
Searching...
No Matches
TTL_double_scheme_template.h
Go to the documentation of this file.
1/*
2 * TTL_double_scheme_template.h
3 *
4 * Copyright (c) 2025 Mobileye
5 *
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19// clang-format off
20/**
21 * @file
22 *
23 * TTL_double_buffering pipelines a duplex import or export transaction using two
24 * internal buffers.
25 *
26 * The following table draws the pipelined actions performed in double buffering.
27 * It specifies which tile is processed in each iteration:
28 *
29 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
30 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
31 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
32 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
33 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
34 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
35 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
36 *
37 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
38 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
39 *
40 * @example TTL_double_buffering.cl
41 */
42// clang-format on
43
44// This file presumes that the following have been pre included.
45// this is not done here for path reasons.
46// #include "TTL_core.h"
47// #include "TTL_import_export.h"
48// #include TTL_IMPORT_EXPORT_INCLUDE_H
49
50/**
51 * @def The structs used for this buffering type
52 */
53/**
54 * @brief Data required to perform double buffer pipelining.
55 *
56 * @see TTL_start_import_double_buffering and
57 * TTL_start_export_double_buffering for a description of double buffer
58 * pipelining.
59 */
60typedef struct {
61 struct {
62 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
63 0->1->0->1... etc */
64 __local void *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
65 TTL_const_ext_void_tensor_t ext_tensor_in; /*!< The external tensor being input */
66 TTL_const_ext_void_tensor_t ext_tensor_out; /*!< The external tensor being output */
67 } common; ///< The information that is common to all pipeline schemes
68 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
69 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
71
72/**
73 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
74 *
75 * @param int_base1 A pointer to the 1st local buffer
76 * @param int_base2 A pointer to the 2nd local buffer
77 * @param ext_tensor A tensor describing the input in global memory
78 * @param event A pointer to the event to use for the inward (external to
79 * internal) transfer completion
80 * @param first_tile The first tile to fetch for the scheme
81 *
82 * @return The TTL_import_double_buffering_t created from the input parameters.
83 *
84 * Example:
85 * @code
86 * TTL_event_t import_DB_e = TTL_get_event();
87 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
88 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
89 * @endcode
90 * \n
91 *
92 * This can be optimized and standardized using the TTL_step_buffering
93 * call.
94 *
95 * @startuml
96 *
97 * start
98 *
99 *
100 * stop
101 *
102 * @enduml
103 */
104static inline TTL_import_double_const_void_tensor_buffering_t __attribute__((overloadable))
105TTL_start_import_double_buffering(__local void *int_base1, __local void *int_base2,
106 TTL_const_ext_void_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
107static inline TTL_int_void_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
109
110static inline TTL_import_double_const_void_tensor_buffering_t __attribute__((overloadable))
111TTL_start_import_double_buffering(__local void *int_base1, __local void *int_base2,
112 TTL_const_ext_void_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
114
115 result.common.int_base[0] = int_base1;
116 result.common.int_base[1] = int_base2;
117
118 result.common.ext_tensor_in = ext_tensor;
119 result.event = event;
120 result.common.index = 0;
121
123
124 TTL_step_buffering(&result, first_tile);
125
126 return result;
127}
128
129// Clear up the mess we made!
130
131// #undef TTL_EXT_TENSOR_TYPE
132/*
133 * TTL_double_scheme_template.h
134 *
135 * Copyright (c) 2025 Mobileye
136 *
137 * Licensed under the Apache License, Version 2.0 (the License);
138 * you may not use this file except in compliance with the License.
139 * You may obtain a copy of the License at
140 *
141 * http://www.apache.org/licenses/LICENSE-2.0
142 *
143 * Unless required by applicable law or agreed to in writing, software
144 * distributed under the License is distributed on an AS IS BASIS,
145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146 * See the License for the specific language governing permissions and
147 * limitations under the License.
148 */
149
150// clang-format off
151/**
152 * @file
153 *
154 * TTL_double_buffering pipelines a duplex import or export transaction using two
155 * internal buffers.
156 *
157 * The following table draws the pipelined actions performed in double buffering.
158 * It specifies which tile is processed in each iteration:
159 *
160 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
161 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
162 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
163 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
164 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
165 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
166 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
167 *
168 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
169 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
170 *
171 * @example TTL_double_buffering.cl
172 */
173// clang-format on
174
175// This file presumes that the following have been pre included.
176// this is not done here for path reasons.
177// #include "TTL_core.h"
178// #include "TTL_import_export.h"
179// #include TTL_IMPORT_EXPORT_INCLUDE_H
180
181/**
182 * @def The structs used for this buffering type
183 */
184/**
185 * @brief Data required to perform double buffer pipelining.
186 *
187 * @see TTL_start_import_double_buffering and
188 * TTL_start_export_double_buffering for a description of double buffer
189 * pipelining.
190 */
191typedef struct {
192 struct {
193 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
194 0->1->0->1... etc */
195 __local void *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
196 TTL_ext_void_tensor_t ext_tensor_in; /*!< The external tensor being input */
197 TTL_ext_void_tensor_t ext_tensor_out; /*!< The external tensor being output */
198 } common; ///< The information that is common to all pipeline schemes
199 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
200 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
202/**
203 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
204 *
205 * @param int_base1 A pointer to the 1st local buffer
206 * @param int_base2 A pointer to the 2nd local buffer
207 * @param ext_tensor A tensor describing the output in global memory
208 * @param event A pointer to the event to use for the inward and outward
209 * transfer completion
210 *
211 * Solid description of single buffering here.
212 *
213 * @return The TTL_export_double_buffering_t created from the input parameters.
214 *
215 * Example:
216 * @code
217 * TTL_event_t export_DB_e = TTL_get_event();
218 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
219 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
220 * @endcode
221 * \n
222 *
223 * This can be optimized and standardized using the TTL_step_buffering
224 * call.
225 *
226 * @startuml
227 *
228 * start
229 *
230 *
231 * stop
232 *
233 * @enduml
234 */
235static inline TTL_export_double_const_void_tensor_buffering_t __attribute__((overloadable))
236TTL_start_export_double_buffering(__local void *int_base1, __local void *int_base2, TTL_ext_void_tensor_t ext_tensor,
237 TTL_event_t *event);
238
239static inline TTL_int_void_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
241
242static inline TTL_export_double_const_void_tensor_buffering_t __attribute__((overloadable))
243TTL_start_export_double_buffering(__local void *int_base1, __local void *int_base2, TTL_ext_void_tensor_t ext_tensor,
244 TTL_event_t *event) {
246
247 result.common.int_base[0] = int_base1;
248 result.common.int_base[1] = int_base2;
249
250 result.common.ext_tensor_in = ext_tensor;
251 result.event = event;
252 result.common.index = 0;
253
255
256 return result;
257}
258
259// Clear up the mess we made!
260
261// #undef TTL_EXT_TENSOR_TYPE
262/*
263 * TTL_double_scheme_template.h
264 *
265 * Copyright (c) 2025 Mobileye
266 *
267 * Licensed under the Apache License, Version 2.0 (the License);
268 * you may not use this file except in compliance with the License.
269 * You may obtain a copy of the License at
270 *
271 * http://www.apache.org/licenses/LICENSE-2.0
272 *
273 * Unless required by applicable law or agreed to in writing, software
274 * distributed under the License is distributed on an AS IS BASIS,
275 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
276 * See the License for the specific language governing permissions and
277 * limitations under the License.
278 */
279
280// clang-format off
281/**
282 * @file
283 *
284 * TTL_double_buffering pipelines a duplex import or export transaction using two
285 * internal buffers.
286 *
287 * The following table draws the pipelined actions performed in double buffering.
288 * It specifies which tile is processed in each iteration:
289 *
290 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
291 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
292 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
293 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
294 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
295 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
296 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
297 *
298 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
299 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
300 *
301 * @example TTL_double_buffering.cl
302 */
303// clang-format on
304
305// This file presumes that the following have been pre included.
306// this is not done here for path reasons.
307// #include "TTL_core.h"
308// #include "TTL_import_export.h"
309// #include TTL_IMPORT_EXPORT_INCLUDE_H
310
311/**
312 * @def The structs used for this buffering type
313 */
314/**
315 * @brief Data required to perform double buffer pipelining.
316 *
317 * @see TTL_start_import_double_buffering and
318 * TTL_start_export_double_buffering for a description of double buffer
319 * pipelining.
320 */
321typedef struct {
322 struct {
323 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
324 0->1->0->1... etc */
325 __local char *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
326 TTL_const_ext_char_tensor_t ext_tensor_in; /*!< The external tensor being input */
327 TTL_const_ext_char_tensor_t ext_tensor_out; /*!< The external tensor being output */
328 } common; ///< The information that is common to all pipeline schemes
329 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
330 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
332
333/**
334 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
335 *
336 * @param int_base1 A pointer to the 1st local buffer
337 * @param int_base2 A pointer to the 2nd local buffer
338 * @param ext_tensor A tensor describing the input in global memory
339 * @param event A pointer to the event to use for the inward (external to
340 * internal) transfer completion
341 * @param first_tile The first tile to fetch for the scheme
342 *
343 * @return The TTL_import_double_buffering_t created from the input parameters.
344 *
345 * Example:
346 * @code
347 * TTL_event_t import_DB_e = TTL_get_event();
348 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
349 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
350 * @endcode
351 * \n
352 *
353 * This can be optimized and standardized using the TTL_step_buffering
354 * call.
355 *
356 * @startuml
357 *
358 * start
359 *
360 *
361 * stop
362 *
363 * @enduml
364 */
365static inline TTL_import_double_const_char_tensor_buffering_t __attribute__((overloadable))
366TTL_start_import_double_buffering(__local char *int_base1, __local char *int_base2,
367 TTL_const_ext_char_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
368static inline TTL_int_char_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
370
371static inline TTL_import_double_const_char_tensor_buffering_t __attribute__((overloadable))
372TTL_start_import_double_buffering(__local char *int_base1, __local char *int_base2,
373 TTL_const_ext_char_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
375
376 result.common.int_base[0] = int_base1;
377 result.common.int_base[1] = int_base2;
378
379 result.common.ext_tensor_in = ext_tensor;
380 result.event = event;
381 result.common.index = 0;
382
384
385 TTL_step_buffering(&result, first_tile);
386
387 return result;
388}
389
390// Clear up the mess we made!
391
392// #undef TTL_EXT_TENSOR_TYPE
393/*
394 * TTL_double_scheme_template.h
395 *
396 * Copyright (c) 2025 Mobileye
397 *
398 * Licensed under the Apache License, Version 2.0 (the License);
399 * you may not use this file except in compliance with the License.
400 * You may obtain a copy of the License at
401 *
402 * http://www.apache.org/licenses/LICENSE-2.0
403 *
404 * Unless required by applicable law or agreed to in writing, software
405 * distributed under the License is distributed on an AS IS BASIS,
406 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
407 * See the License for the specific language governing permissions and
408 * limitations under the License.
409 */
410
411// clang-format off
412/**
413 * @file
414 *
415 * TTL_double_buffering pipelines a duplex import or export transaction using two
416 * internal buffers.
417 *
418 * The following table draws the pipelined actions performed in double buffering.
419 * It specifies which tile is processed in each iteration:
420 *
421 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
422 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
423 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
424 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
425 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
426 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
427 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
428 *
429 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
430 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
431 *
432 * @example TTL_double_buffering.cl
433 */
434// clang-format on
435
436// This file presumes that the following have been pre included.
437// this is not done here for path reasons.
438// #include "TTL_core.h"
439// #include "TTL_import_export.h"
440// #include TTL_IMPORT_EXPORT_INCLUDE_H
441
442/**
443 * @def The structs used for this buffering type
444 */
445/**
446 * @brief Data required to perform double buffer pipelining.
447 *
448 * @see TTL_start_import_double_buffering and
449 * TTL_start_export_double_buffering for a description of double buffer
450 * pipelining.
451 */
452typedef struct {
453 struct {
454 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
455 0->1->0->1... etc */
456 __local char *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
457 TTL_ext_char_tensor_t ext_tensor_in; /*!< The external tensor being input */
458 TTL_ext_char_tensor_t ext_tensor_out; /*!< The external tensor being output */
459 } common; ///< The information that is common to all pipeline schemes
460 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
461 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
463/**
464 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
465 *
466 * @param int_base1 A pointer to the 1st local buffer
467 * @param int_base2 A pointer to the 2nd local buffer
468 * @param ext_tensor A tensor describing the output in global memory
469 * @param event A pointer to the event to use for the inward and outward
470 * transfer completion
471 *
472 * Solid description of single buffering here.
473 *
474 * @return The TTL_export_double_buffering_t created from the input parameters.
475 *
476 * Example:
477 * @code
478 * TTL_event_t export_DB_e = TTL_get_event();
479 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
480 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
481 * @endcode
482 * \n
483 *
484 * This can be optimized and standardized using the TTL_step_buffering
485 * call.
486 *
487 * @startuml
488 *
489 * start
490 *
491 *
492 * stop
493 *
494 * @enduml
495 */
496static inline TTL_export_double_const_char_tensor_buffering_t __attribute__((overloadable))
497TTL_start_export_double_buffering(__local char *int_base1, __local char *int_base2, TTL_ext_char_tensor_t ext_tensor,
498 TTL_event_t *event);
499
500static inline TTL_int_char_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
502
503static inline TTL_export_double_const_char_tensor_buffering_t __attribute__((overloadable))
504TTL_start_export_double_buffering(__local char *int_base1, __local char *int_base2, TTL_ext_char_tensor_t ext_tensor,
505 TTL_event_t *event) {
507
508 result.common.int_base[0] = int_base1;
509 result.common.int_base[1] = int_base2;
510
511 result.common.ext_tensor_in = ext_tensor;
512 result.event = event;
513 result.common.index = 0;
514
516
517 return result;
518}
519
520// Clear up the mess we made!
521
522// #undef TTL_EXT_TENSOR_TYPE
523/*
524 * TTL_double_scheme_template.h
525 *
526 * Copyright (c) 2025 Mobileye
527 *
528 * Licensed under the Apache License, Version 2.0 (the License);
529 * you may not use this file except in compliance with the License.
530 * You may obtain a copy of the License at
531 *
532 * http://www.apache.org/licenses/LICENSE-2.0
533 *
534 * Unless required by applicable law or agreed to in writing, software
535 * distributed under the License is distributed on an AS IS BASIS,
536 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
537 * See the License for the specific language governing permissions and
538 * limitations under the License.
539 */
540
541// clang-format off
542/**
543 * @file
544 *
545 * TTL_double_buffering pipelines a duplex import or export transaction using two
546 * internal buffers.
547 *
548 * The following table draws the pipelined actions performed in double buffering.
549 * It specifies which tile is processed in each iteration:
550 *
551 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
552 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
553 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
554 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
555 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
556 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
557 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
558 *
559 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
560 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
561 *
562 * @example TTL_double_buffering.cl
563 */
564// clang-format on
565
566// This file presumes that the following have been pre included.
567// this is not done here for path reasons.
568// #include "TTL_core.h"
569// #include "TTL_import_export.h"
570// #include TTL_IMPORT_EXPORT_INCLUDE_H
571
572/**
573 * @def The structs used for this buffering type
574 */
575/**
576 * @brief Data required to perform double buffer pipelining.
577 *
578 * @see TTL_start_import_double_buffering and
579 * TTL_start_export_double_buffering for a description of double buffer
580 * pipelining.
581 */
582typedef struct {
583 struct {
584 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
585 0->1->0->1... etc */
586 __local uchar *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
587 TTL_const_ext_uchar_tensor_t ext_tensor_in; /*!< The external tensor being input */
588 TTL_const_ext_uchar_tensor_t ext_tensor_out; /*!< The external tensor being output */
589 } common; ///< The information that is common to all pipeline schemes
590 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
591 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
593
594/**
595 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
596 *
597 * @param int_base1 A pointer to the 1st local buffer
598 * @param int_base2 A pointer to the 2nd local buffer
599 * @param ext_tensor A tensor describing the input in global memory
600 * @param event A pointer to the event to use for the inward (external to
601 * internal) transfer completion
602 * @param first_tile The first tile to fetch for the scheme
603 *
604 * @return The TTL_import_double_buffering_t created from the input parameters.
605 *
606 * Example:
607 * @code
608 * TTL_event_t import_DB_e = TTL_get_event();
609 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
610 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
611 * @endcode
612 * \n
613 *
614 * This can be optimized and standardized using the TTL_step_buffering
615 * call.
616 *
617 * @startuml
618 *
619 * start
620 *
621 *
622 * stop
623 *
624 * @enduml
625 */
626static inline TTL_import_double_const_uchar_tensor_buffering_t __attribute__((overloadable))
628 TTL_const_ext_uchar_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
629static inline TTL_int_uchar_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
631
632static inline TTL_import_double_const_uchar_tensor_buffering_t __attribute__((overloadable))
634 TTL_const_ext_uchar_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
636
637 result.common.int_base[0] = int_base1;
638 result.common.int_base[1] = int_base2;
639
640 result.common.ext_tensor_in = ext_tensor;
641 result.event = event;
642 result.common.index = 0;
643
645
646 TTL_step_buffering(&result, first_tile);
647
648 return result;
649}
650
651// Clear up the mess we made!
652
653// #undef TTL_EXT_TENSOR_TYPE
654/*
655 * TTL_double_scheme_template.h
656 *
657 * Copyright (c) 2025 Mobileye
658 *
659 * Licensed under the Apache License, Version 2.0 (the License);
660 * you may not use this file except in compliance with the License.
661 * You may obtain a copy of the License at
662 *
663 * http://www.apache.org/licenses/LICENSE-2.0
664 *
665 * Unless required by applicable law or agreed to in writing, software
666 * distributed under the License is distributed on an AS IS BASIS,
667 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
668 * See the License for the specific language governing permissions and
669 * limitations under the License.
670 */
671
672// clang-format off
673/**
674 * @file
675 *
676 * TTL_double_buffering pipelines a duplex import or export transaction using two
677 * internal buffers.
678 *
679 * The following table draws the pipelined actions performed in double buffering.
680 * It specifies which tile is processed in each iteration:
681 *
682 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
683 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
684 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
685 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
686 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
687 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
688 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
689 *
690 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
691 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
692 *
693 * @example TTL_double_buffering.cl
694 */
695// clang-format on
696
697// This file presumes that the following have been pre included.
698// this is not done here for path reasons.
699// #include "TTL_core.h"
700// #include "TTL_import_export.h"
701// #include TTL_IMPORT_EXPORT_INCLUDE_H
702
703/**
704 * @def The structs used for this buffering type
705 */
706/**
707 * @brief Data required to perform double buffer pipelining.
708 *
709 * @see TTL_start_import_double_buffering and
710 * TTL_start_export_double_buffering for a description of double buffer
711 * pipelining.
712 */
713typedef struct {
714 struct {
715 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
716 0->1->0->1... etc */
717 __local uchar *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
718 TTL_ext_uchar_tensor_t ext_tensor_in; /*!< The external tensor being input */
719 TTL_ext_uchar_tensor_t ext_tensor_out; /*!< The external tensor being output */
720 } common; ///< The information that is common to all pipeline schemes
721 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
722 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
724/**
725 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
726 *
727 * @param int_base1 A pointer to the 1st local buffer
728 * @param int_base2 A pointer to the 2nd local buffer
729 * @param ext_tensor A tensor describing the output in global memory
730 * @param event A pointer to the event to use for the inward and outward
731 * transfer completion
732 *
733 * Solid description of single buffering here.
734 *
735 * @return The TTL_export_double_buffering_t created from the input parameters.
736 *
737 * Example:
738 * @code
739 * TTL_event_t export_DB_e = TTL_get_event();
740 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
741 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
742 * @endcode
743 * \n
744 *
745 * This can be optimized and standardized using the TTL_step_buffering
746 * call.
747 *
748 * @startuml
749 *
750 * start
751 *
752 *
753 * stop
754 *
755 * @enduml
756 */
757static inline TTL_export_double_const_uchar_tensor_buffering_t __attribute__((overloadable))
759 TTL_event_t *event);
760
761static inline TTL_int_uchar_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
763
764static inline TTL_export_double_const_uchar_tensor_buffering_t __attribute__((overloadable))
766 TTL_event_t *event) {
768
769 result.common.int_base[0] = int_base1;
770 result.common.int_base[1] = int_base2;
771
772 result.common.ext_tensor_in = ext_tensor;
773 result.event = event;
774 result.common.index = 0;
775
777
778 return result;
779}
780
781// Clear up the mess we made!
782
783// #undef TTL_EXT_TENSOR_TYPE
784/*
785 * TTL_double_scheme_template.h
786 *
787 * Copyright (c) 2025 Mobileye
788 *
789 * Licensed under the Apache License, Version 2.0 (the License);
790 * you may not use this file except in compliance with the License.
791 * You may obtain a copy of the License at
792 *
793 * http://www.apache.org/licenses/LICENSE-2.0
794 *
795 * Unless required by applicable law or agreed to in writing, software
796 * distributed under the License is distributed on an AS IS BASIS,
797 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
798 * See the License for the specific language governing permissions and
799 * limitations under the License.
800 */
801
802// clang-format off
803/**
804 * @file
805 *
806 * TTL_double_buffering pipelines a duplex import or export transaction using two
807 * internal buffers.
808 *
809 * The following table draws the pipelined actions performed in double buffering.
810 * It specifies which tile is processed in each iteration:
811 *
812 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
813 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
814 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
815 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
816 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
817 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
818 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
819 *
820 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
821 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
822 *
823 * @example TTL_double_buffering.cl
824 */
825// clang-format on
826
827// This file presumes that the following have been pre included.
828// this is not done here for path reasons.
829// #include "TTL_core.h"
830// #include "TTL_import_export.h"
831// #include TTL_IMPORT_EXPORT_INCLUDE_H
832
833/**
834 * @def The structs used for this buffering type
835 */
836/**
837 * @brief Data required to perform double buffer pipelining.
838 *
839 * @see TTL_start_import_double_buffering and
840 * TTL_start_export_double_buffering for a description of double buffer
841 * pipelining.
842 */
843typedef struct {
844 struct {
845 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
846 0->1->0->1... etc */
847 __local int *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
848 TTL_const_ext_int_tensor_t ext_tensor_in; /*!< The external tensor being input */
849 TTL_const_ext_int_tensor_t ext_tensor_out; /*!< The external tensor being output */
850 } common; ///< The information that is common to all pipeline schemes
851 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
852 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
854
855/**
856 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
857 *
858 * @param int_base1 A pointer to the 1st local buffer
859 * @param int_base2 A pointer to the 2nd local buffer
860 * @param ext_tensor A tensor describing the input in global memory
861 * @param event A pointer to the event to use for the inward (external to
862 * internal) transfer completion
863 * @param first_tile The first tile to fetch for the scheme
864 *
865 * @return The TTL_import_double_buffering_t created from the input parameters.
866 *
867 * Example:
868 * @code
869 * TTL_event_t import_DB_e = TTL_get_event();
870 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
871 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
872 * @endcode
873 * \n
874 *
875 * This can be optimized and standardized using the TTL_step_buffering
876 * call.
877 *
878 * @startuml
879 *
880 * start
881 *
882 *
883 * stop
884 *
885 * @enduml
886 */
887static inline TTL_import_double_const_int_tensor_buffering_t __attribute__((overloadable))
888TTL_start_import_double_buffering(__local int *int_base1, __local int *int_base2, TTL_const_ext_int_tensor_t ext_tensor,
889 TTL_event_t *event, TTL_tile_t first_tile);
890static inline TTL_int_int_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
892
893static inline TTL_import_double_const_int_tensor_buffering_t __attribute__((overloadable))
895 TTL_event_t *event, TTL_tile_t first_tile) {
897
898 result.common.int_base[0] = int_base1;
899 result.common.int_base[1] = int_base2;
900
901 result.common.ext_tensor_in = ext_tensor;
902 result.event = event;
903 result.common.index = 0;
904
906
907 TTL_step_buffering(&result, first_tile);
908
909 return result;
910}
911
912// Clear up the mess we made!
913
914// #undef TTL_EXT_TENSOR_TYPE
915/*
916 * TTL_double_scheme_template.h
917 *
918 * Copyright (c) 2025 Mobileye
919 *
920 * Licensed under the Apache License, Version 2.0 (the License);
921 * you may not use this file except in compliance with the License.
922 * You may obtain a copy of the License at
923 *
924 * http://www.apache.org/licenses/LICENSE-2.0
925 *
926 * Unless required by applicable law or agreed to in writing, software
927 * distributed under the License is distributed on an AS IS BASIS,
928 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
929 * See the License for the specific language governing permissions and
930 * limitations under the License.
931 */
932
933// clang-format off
934/**
935 * @file
936 *
937 * TTL_double_buffering pipelines a duplex import or export transaction using two
938 * internal buffers.
939 *
940 * The following table draws the pipelined actions performed in double buffering.
941 * It specifies which tile is processed in each iteration:
942 *
943 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
944 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
945 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
946 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
947 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
948 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
949 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
950 *
951 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
952 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
953 *
954 * @example TTL_double_buffering.cl
955 */
956// clang-format on
957
958// This file presumes that the following have been pre included.
959// this is not done here for path reasons.
960// #include "TTL_core.h"
961// #include "TTL_import_export.h"
962// #include TTL_IMPORT_EXPORT_INCLUDE_H
963
964/**
965 * @def The structs used for this buffering type
966 */
967/**
968 * @brief Data required to perform double buffer pipelining.
969 *
970 * @see TTL_start_import_double_buffering and
971 * TTL_start_export_double_buffering for a description of double buffer
972 * pipelining.
973 */
974typedef struct {
975 struct {
976 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
977 0->1->0->1... etc */
978 __local int *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
979 TTL_ext_int_tensor_t ext_tensor_in; /*!< The external tensor being input */
980 TTL_ext_int_tensor_t ext_tensor_out; /*!< The external tensor being output */
981 } common; ///< The information that is common to all pipeline schemes
982 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
983 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
985/**
986 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
987 *
988 * @param int_base1 A pointer to the 1st local buffer
989 * @param int_base2 A pointer to the 2nd local buffer
990 * @param ext_tensor A tensor describing the output in global memory
991 * @param event A pointer to the event to use for the inward and outward
992 * transfer completion
993 *
994 * Solid description of single buffering here.
995 *
996 * @return The TTL_export_double_buffering_t created from the input parameters.
997 *
998 * Example:
999 * @code
1000 * TTL_event_t export_DB_e = TTL_get_event();
1001 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
1002 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
1003 * @endcode
1004 * \n
1005 *
1006 * This can be optimized and standardized using the TTL_step_buffering
1007 * call.
1008 *
1009 * @startuml
1010 *
1011 * start
1012 *
1013 *
1014 * stop
1015 *
1016 * @enduml
1017 */
1018static inline TTL_export_double_const_int_tensor_buffering_t __attribute__((overloadable))
1019TTL_start_export_double_buffering(__local int *int_base1, __local int *int_base2, TTL_ext_int_tensor_t ext_tensor,
1020 TTL_event_t *event);
1021
1022static inline TTL_int_int_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1024
1025static inline TTL_export_double_const_int_tensor_buffering_t __attribute__((overloadable))
1027 TTL_event_t *event) {
1029
1030 result.common.int_base[0] = int_base1;
1031 result.common.int_base[1] = int_base2;
1032
1033 result.common.ext_tensor_in = ext_tensor;
1034 result.event = event;
1035 result.common.index = 0;
1036
1038
1039 return result;
1040}
1041
1042// Clear up the mess we made!
1043
1044// #undef TTL_EXT_TENSOR_TYPE
1045/*
1046 * TTL_double_scheme_template.h
1047 *
1048 * Copyright (c) 2025 Mobileye
1049 *
1050 * Licensed under the Apache License, Version 2.0 (the License);
1051 * you may not use this file except in compliance with the License.
1052 * You may obtain a copy of the License at
1053 *
1054 * http://www.apache.org/licenses/LICENSE-2.0
1055 *
1056 * Unless required by applicable law or agreed to in writing, software
1057 * distributed under the License is distributed on an AS IS BASIS,
1058 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1059 * See the License for the specific language governing permissions and
1060 * limitations under the License.
1061 */
1062
1063// clang-format off
1064/**
1065 * @file
1066 *
1067 * TTL_double_buffering pipelines a duplex import or export transaction using two
1068 * internal buffers.
1069 *
1070 * The following table draws the pipelined actions performed in double buffering.
1071 * It specifies which tile is processed in each iteration:
1072 *
1073 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1074 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1075 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1076 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1077 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1078 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1079 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1080 *
1081 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1082 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1083 *
1084 * @example TTL_double_buffering.cl
1085 */
1086// clang-format on
1087
1088// This file presumes that the following have been pre included.
1089// this is not done here for path reasons.
1090// #include "TTL_core.h"
1091// #include "TTL_import_export.h"
1092// #include TTL_IMPORT_EXPORT_INCLUDE_H
1093
1094/**
1095 * @def The structs used for this buffering type
1096 */
1097/**
1098 * @brief Data required to perform double buffer pipelining.
1099 *
1100 * @see TTL_start_import_double_buffering and
1101 * TTL_start_export_double_buffering for a description of double buffer
1102 * pipelining.
1103 */
1104typedef struct {
1105 struct {
1106 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
1107 0->1->0->1... etc */
1108 __local uint *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
1109 TTL_const_ext_uint_tensor_t ext_tensor_in; /*!< The external tensor being input */
1110 TTL_const_ext_uint_tensor_t ext_tensor_out; /*!< The external tensor being output */
1111 } common; ///< The information that is common to all pipeline schemes
1112 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
1113 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
1115
1116/**
1117 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
1118 *
1119 * @param int_base1 A pointer to the 1st local buffer
1120 * @param int_base2 A pointer to the 2nd local buffer
1121 * @param ext_tensor A tensor describing the input in global memory
1122 * @param event A pointer to the event to use for the inward (external to
1123 * internal) transfer completion
1124 * @param first_tile The first tile to fetch for the scheme
1125 *
1126 * @return The TTL_import_double_buffering_t created from the input parameters.
1127 *
1128 * Example:
1129 * @code
1130 * TTL_event_t import_DB_e = TTL_get_event();
1131 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
1132 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
1133 * @endcode
1134 * \n
1135 *
1136 * This can be optimized and standardized using the TTL_step_buffering
1137 * call.
1138 *
1139 * @startuml
1140 *
1141 * start
1142 *
1143 *
1144 * stop
1145 *
1146 * @enduml
1147 */
1148static inline TTL_import_double_const_uint_tensor_buffering_t __attribute__((overloadable))
1150 TTL_const_ext_uint_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
1151static inline TTL_int_uint_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1153
1154static inline TTL_import_double_const_uint_tensor_buffering_t __attribute__((overloadable))
1156 TTL_const_ext_uint_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
1158
1159 result.common.int_base[0] = int_base1;
1160 result.common.int_base[1] = int_base2;
1161
1162 result.common.ext_tensor_in = ext_tensor;
1163 result.event = event;
1164 result.common.index = 0;
1165
1167
1168 TTL_step_buffering(&result, first_tile);
1169
1170 return result;
1171}
1172
1173// Clear up the mess we made!
1174
1175// #undef TTL_EXT_TENSOR_TYPE
1176/*
1177 * TTL_double_scheme_template.h
1178 *
1179 * Copyright (c) 2025 Mobileye
1180 *
1181 * Licensed under the Apache License, Version 2.0 (the License);
1182 * you may not use this file except in compliance with the License.
1183 * You may obtain a copy of the License at
1184 *
1185 * http://www.apache.org/licenses/LICENSE-2.0
1186 *
1187 * Unless required by applicable law or agreed to in writing, software
1188 * distributed under the License is distributed on an AS IS BASIS,
1189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1190 * See the License for the specific language governing permissions and
1191 * limitations under the License.
1192 */
1193
1194// clang-format off
1195/**
1196 * @file
1197 *
1198 * TTL_double_buffering pipelines a duplex import or export transaction using two
1199 * internal buffers.
1200 *
1201 * The following table draws the pipelined actions performed in double buffering.
1202 * It specifies which tile is processed in each iteration:
1203 *
1204 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1205 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1206 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1207 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1208 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1209 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1210 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1211 *
1212 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1213 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1214 *
1215 * @example TTL_double_buffering.cl
1216 */
1217// clang-format on
1218
1219// This file presumes that the following have been pre included.
1220// this is not done here for path reasons.
1221// #include "TTL_core.h"
1222// #include "TTL_import_export.h"
1223// #include TTL_IMPORT_EXPORT_INCLUDE_H
1224
1225/**
1226 * @def The structs used for this buffering type
1227 */
1228/**
1229 * @brief Data required to perform double buffer pipelining.
1230 *
1231 * @see TTL_start_import_double_buffering and
1232 * TTL_start_export_double_buffering for a description of double buffer
1233 * pipelining.
1234 */
1235typedef struct {
1236 struct {
1237 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
1238 0->1->0->1... etc */
1239 __local uint *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
1240 TTL_ext_uint_tensor_t ext_tensor_in; /*!< The external tensor being input */
1241 TTL_ext_uint_tensor_t ext_tensor_out; /*!< The external tensor being output */
1242 } common; ///< The information that is common to all pipeline schemes
1243 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
1244 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
1246/**
1247 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
1248 *
1249 * @param int_base1 A pointer to the 1st local buffer
1250 * @param int_base2 A pointer to the 2nd local buffer
1251 * @param ext_tensor A tensor describing the output in global memory
1252 * @param event A pointer to the event to use for the inward and outward
1253 * transfer completion
1254 *
1255 * Solid description of single buffering here.
1256 *
1257 * @return The TTL_export_double_buffering_t created from the input parameters.
1258 *
1259 * Example:
1260 * @code
1261 * TTL_event_t export_DB_e = TTL_get_event();
1262 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
1263 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
1264 * @endcode
1265 * \n
1266 *
1267 * This can be optimized and standardized using the TTL_step_buffering
1268 * call.
1269 *
1270 * @startuml
1271 *
1272 * start
1273 *
1274 *
1275 * stop
1276 *
1277 * @enduml
1278 */
1279static inline TTL_export_double_const_uint_tensor_buffering_t __attribute__((overloadable))
1281 TTL_event_t *event);
1282
1283static inline TTL_int_uint_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1285
1286static inline TTL_export_double_const_uint_tensor_buffering_t __attribute__((overloadable))
1288 TTL_event_t *event) {
1290
1291 result.common.int_base[0] = int_base1;
1292 result.common.int_base[1] = int_base2;
1293
1294 result.common.ext_tensor_in = ext_tensor;
1295 result.event = event;
1296 result.common.index = 0;
1297
1299
1300 return result;
1301}
1302
1303// Clear up the mess we made!
1304
1305// #undef TTL_EXT_TENSOR_TYPE
1306/*
1307 * TTL_double_scheme_template.h
1308 *
1309 * Copyright (c) 2025 Mobileye
1310 *
1311 * Licensed under the Apache License, Version 2.0 (the License);
1312 * you may not use this file except in compliance with the License.
1313 * You may obtain a copy of the License at
1314 *
1315 * http://www.apache.org/licenses/LICENSE-2.0
1316 *
1317 * Unless required by applicable law or agreed to in writing, software
1318 * distributed under the License is distributed on an AS IS BASIS,
1319 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320 * See the License for the specific language governing permissions and
1321 * limitations under the License.
1322 */
1323
1324// clang-format off
1325/**
1326 * @file
1327 *
1328 * TTL_double_buffering pipelines a duplex import or export transaction using two
1329 * internal buffers.
1330 *
1331 * The following table draws the pipelined actions performed in double buffering.
1332 * It specifies which tile is processed in each iteration:
1333 *
1334 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1335 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1336 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1337 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1338 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1339 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1340 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1341 *
1342 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1343 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1344 *
1345 * @example TTL_double_buffering.cl
1346 */
1347// clang-format on
1348
1349// This file presumes that the following have been pre included.
1350// this is not done here for path reasons.
1351// #include "TTL_core.h"
1352// #include "TTL_import_export.h"
1353// #include TTL_IMPORT_EXPORT_INCLUDE_H
1354
1355/**
1356 * @def The structs used for this buffering type
1357 */
1358/**
1359 * @brief Data required to perform double buffer pipelining.
1360 *
1361 * @see TTL_start_import_double_buffering and
1362 * TTL_start_export_double_buffering for a description of double buffer
1363 * pipelining.
1364 */
1365typedef struct {
1366 struct {
1367 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
1368 0->1->0->1... etc */
1369 __local short *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
1370 TTL_const_ext_short_tensor_t ext_tensor_in; /*!< The external tensor being input */
1371 TTL_const_ext_short_tensor_t ext_tensor_out; /*!< The external tensor being output */
1372 } common; ///< The information that is common to all pipeline schemes
1373 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
1374 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
1376
1377/**
1378 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
1379 *
1380 * @param int_base1 A pointer to the 1st local buffer
1381 * @param int_base2 A pointer to the 2nd local buffer
1382 * @param ext_tensor A tensor describing the input in global memory
1383 * @param event A pointer to the event to use for the inward (external to
1384 * internal) transfer completion
1385 * @param first_tile The first tile to fetch for the scheme
1386 *
1387 * @return The TTL_import_double_buffering_t created from the input parameters.
1388 *
1389 * Example:
1390 * @code
1391 * TTL_event_t import_DB_e = TTL_get_event();
1392 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
1393 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
1394 * @endcode
1395 * \n
1396 *
1397 * This can be optimized and standardized using the TTL_step_buffering
1398 * call.
1399 *
1400 * @startuml
1401 *
1402 * start
1403 *
1404 *
1405 * stop
1406 *
1407 * @enduml
1408 */
1409static inline TTL_import_double_const_short_tensor_buffering_t __attribute__((overloadable))
1410TTL_start_import_double_buffering(__local short *int_base1, __local short *int_base2,
1411 TTL_const_ext_short_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
1412static inline TTL_int_short_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1414
1415static inline TTL_import_double_const_short_tensor_buffering_t __attribute__((overloadable))
1416TTL_start_import_double_buffering(__local short *int_base1, __local short *int_base2,
1417 TTL_const_ext_short_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
1419
1420 result.common.int_base[0] = int_base1;
1421 result.common.int_base[1] = int_base2;
1422
1423 result.common.ext_tensor_in = ext_tensor;
1424 result.event = event;
1425 result.common.index = 0;
1426
1428
1429 TTL_step_buffering(&result, first_tile);
1430
1431 return result;
1432}
1433
1434// Clear up the mess we made!
1435
1436// #undef TTL_EXT_TENSOR_TYPE
1437/*
1438 * TTL_double_scheme_template.h
1439 *
1440 * Copyright (c) 2025 Mobileye
1441 *
1442 * Licensed under the Apache License, Version 2.0 (the License);
1443 * you may not use this file except in compliance with the License.
1444 * You may obtain a copy of the License at
1445 *
1446 * http://www.apache.org/licenses/LICENSE-2.0
1447 *
1448 * Unless required by applicable law or agreed to in writing, software
1449 * distributed under the License is distributed on an AS IS BASIS,
1450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1451 * See the License for the specific language governing permissions and
1452 * limitations under the License.
1453 */
1454
1455// clang-format off
1456/**
1457 * @file
1458 *
1459 * TTL_double_buffering pipelines a duplex import or export transaction using two
1460 * internal buffers.
1461 *
1462 * The following table draws the pipelined actions performed in double buffering.
1463 * It specifies which tile is processed in each iteration:
1464 *
1465 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1466 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1467 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1468 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1469 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1470 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1471 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1472 *
1473 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1474 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1475 *
1476 * @example TTL_double_buffering.cl
1477 */
1478// clang-format on
1479
1480// This file presumes that the following have been pre included.
1481// this is not done here for path reasons.
1482// #include "TTL_core.h"
1483// #include "TTL_import_export.h"
1484// #include TTL_IMPORT_EXPORT_INCLUDE_H
1485
1486/**
1487 * @def The structs used for this buffering type
1488 */
1489/**
1490 * @brief Data required to perform double buffer pipelining.
1491 *
1492 * @see TTL_start_import_double_buffering and
1493 * TTL_start_export_double_buffering for a description of double buffer
1494 * pipelining.
1495 */
1496typedef struct {
1497 struct {
1498 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
1499 0->1->0->1... etc */
1500 __local short *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
1501 TTL_ext_short_tensor_t ext_tensor_in; /*!< The external tensor being input */
1502 TTL_ext_short_tensor_t ext_tensor_out; /*!< The external tensor being output */
1503 } common; ///< The information that is common to all pipeline schemes
1504 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
1505 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
1507/**
1508 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
1509 *
1510 * @param int_base1 A pointer to the 1st local buffer
1511 * @param int_base2 A pointer to the 2nd local buffer
1512 * @param ext_tensor A tensor describing the output in global memory
1513 * @param event A pointer to the event to use for the inward and outward
1514 * transfer completion
1515 *
1516 * Solid description of single buffering here.
1517 *
1518 * @return The TTL_export_double_buffering_t created from the input parameters.
1519 *
1520 * Example:
1521 * @code
1522 * TTL_event_t export_DB_e = TTL_get_event();
1523 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
1524 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
1525 * @endcode
1526 * \n
1527 *
1528 * This can be optimized and standardized using the TTL_step_buffering
1529 * call.
1530 *
1531 * @startuml
1532 *
1533 * start
1534 *
1535 *
1536 * stop
1537 *
1538 * @enduml
1539 */
1540static inline TTL_export_double_const_short_tensor_buffering_t __attribute__((overloadable))
1541TTL_start_export_double_buffering(__local short *int_base1, __local short *int_base2, TTL_ext_short_tensor_t ext_tensor,
1542 TTL_event_t *event);
1543
1544static inline TTL_int_short_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1546
1547static inline TTL_export_double_const_short_tensor_buffering_t __attribute__((overloadable))
1548TTL_start_export_double_buffering(__local short *int_base1, __local short *int_base2, TTL_ext_short_tensor_t ext_tensor,
1549 TTL_event_t *event) {
1551
1552 result.common.int_base[0] = int_base1;
1553 result.common.int_base[1] = int_base2;
1554
1555 result.common.ext_tensor_in = ext_tensor;
1556 result.event = event;
1557 result.common.index = 0;
1558
1560
1561 return result;
1562}
1563
1564// Clear up the mess we made!
1565
1566// #undef TTL_EXT_TENSOR_TYPE
1567/*
1568 * TTL_double_scheme_template.h
1569 *
1570 * Copyright (c) 2025 Mobileye
1571 *
1572 * Licensed under the Apache License, Version 2.0 (the License);
1573 * you may not use this file except in compliance with the License.
1574 * You may obtain a copy of the License at
1575 *
1576 * http://www.apache.org/licenses/LICENSE-2.0
1577 *
1578 * Unless required by applicable law or agreed to in writing, software
1579 * distributed under the License is distributed on an AS IS BASIS,
1580 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1581 * See the License for the specific language governing permissions and
1582 * limitations under the License.
1583 */
1584
1585// clang-format off
1586/**
1587 * @file
1588 *
1589 * TTL_double_buffering pipelines a duplex import or export transaction using two
1590 * internal buffers.
1591 *
1592 * The following table draws the pipelined actions performed in double buffering.
1593 * It specifies which tile is processed in each iteration:
1594 *
1595 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1596 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1597 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1598 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1599 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1600 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1601 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1602 *
1603 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1604 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1605 *
1606 * @example TTL_double_buffering.cl
1607 */
1608// clang-format on
1609
1610// This file presumes that the following have been pre included.
1611// this is not done here for path reasons.
1612// #include "TTL_core.h"
1613// #include "TTL_import_export.h"
1614// #include TTL_IMPORT_EXPORT_INCLUDE_H
1615
1616/**
1617 * @def The structs used for this buffering type
1618 */
1619/**
1620 * @brief Data required to perform double buffer pipelining.
1621 *
1622 * @see TTL_start_import_double_buffering and
1623 * TTL_start_export_double_buffering for a description of double buffer
1624 * pipelining.
1625 */
1626typedef struct {
1627 struct {
1628 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
1629 0->1->0->1... etc */
1630 __local ushort *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
1631 TTL_const_ext_ushort_tensor_t ext_tensor_in; /*!< The external tensor being input */
1632 TTL_const_ext_ushort_tensor_t ext_tensor_out; /*!< The external tensor being output */
1633 } common; ///< The information that is common to all pipeline schemes
1634 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
1635 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
1637
1638/**
1639 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
1640 *
1641 * @param int_base1 A pointer to the 1st local buffer
1642 * @param int_base2 A pointer to the 2nd local buffer
1643 * @param ext_tensor A tensor describing the input in global memory
1644 * @param event A pointer to the event to use for the inward (external to
1645 * internal) transfer completion
1646 * @param first_tile The first tile to fetch for the scheme
1647 *
1648 * @return The TTL_import_double_buffering_t created from the input parameters.
1649 *
1650 * Example:
1651 * @code
1652 * TTL_event_t import_DB_e = TTL_get_event();
1653 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
1654 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
1655 * @endcode
1656 * \n
1657 *
1658 * This can be optimized and standardized using the TTL_step_buffering
1659 * call.
1660 *
1661 * @startuml
1662 *
1663 * start
1664 *
1665 *
1666 * stop
1667 *
1668 * @enduml
1669 */
1670static inline TTL_import_double_const_ushort_tensor_buffering_t __attribute__((overloadable))
1672 TTL_const_ext_ushort_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
1673static inline TTL_int_ushort_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1675
1676static inline TTL_import_double_const_ushort_tensor_buffering_t __attribute__((overloadable))
1678 TTL_const_ext_ushort_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
1680
1681 result.common.int_base[0] = int_base1;
1682 result.common.int_base[1] = int_base2;
1683
1684 result.common.ext_tensor_in = ext_tensor;
1685 result.event = event;
1686 result.common.index = 0;
1687
1689
1690 TTL_step_buffering(&result, first_tile);
1691
1692 return result;
1693}
1694
1695// Clear up the mess we made!
1696
1697// #undef TTL_EXT_TENSOR_TYPE
1698/*
1699 * TTL_double_scheme_template.h
1700 *
1701 * Copyright (c) 2025 Mobileye
1702 *
1703 * Licensed under the Apache License, Version 2.0 (the License);
1704 * you may not use this file except in compliance with the License.
1705 * You may obtain a copy of the License at
1706 *
1707 * http://www.apache.org/licenses/LICENSE-2.0
1708 *
1709 * Unless required by applicable law or agreed to in writing, software
1710 * distributed under the License is distributed on an AS IS BASIS,
1711 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1712 * See the License for the specific language governing permissions and
1713 * limitations under the License.
1714 */
1715
1716// clang-format off
1717/**
1718 * @file
1719 *
1720 * TTL_double_buffering pipelines a duplex import or export transaction using two
1721 * internal buffers.
1722 *
1723 * The following table draws the pipelined actions performed in double buffering.
1724 * It specifies which tile is processed in each iteration:
1725 *
1726 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1727 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1728 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1729 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1730 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1731 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1732 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1733 *
1734 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1735 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1736 *
1737 * @example TTL_double_buffering.cl
1738 */
1739// clang-format on
1740
1741// This file presumes that the following have been pre included.
1742// this is not done here for path reasons.
1743// #include "TTL_core.h"
1744// #include "TTL_import_export.h"
1745// #include TTL_IMPORT_EXPORT_INCLUDE_H
1746
1747/**
1748 * @def The structs used for this buffering type
1749 */
1750/**
1751 * @brief Data required to perform double buffer pipelining.
1752 *
1753 * @see TTL_start_import_double_buffering and
1754 * TTL_start_export_double_buffering for a description of double buffer
1755 * pipelining.
1756 */
1757typedef struct {
1758 struct {
1759 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
1760 0->1->0->1... etc */
1761 __local ushort *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
1762 TTL_ext_ushort_tensor_t ext_tensor_in; /*!< The external tensor being input */
1763 TTL_ext_ushort_tensor_t ext_tensor_out; /*!< The external tensor being output */
1764 } common; ///< The information that is common to all pipeline schemes
1765 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
1766 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
1768/**
1769 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
1770 *
1771 * @param int_base1 A pointer to the 1st local buffer
1772 * @param int_base2 A pointer to the 2nd local buffer
1773 * @param ext_tensor A tensor describing the output in global memory
1774 * @param event A pointer to the event to use for the inward and outward
1775 * transfer completion
1776 *
1777 * Solid description of single buffering here.
1778 *
1779 * @return The TTL_export_double_buffering_t created from the input parameters.
1780 *
1781 * Example:
1782 * @code
1783 * TTL_event_t export_DB_e = TTL_get_event();
1784 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
1785 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
1786 * @endcode
1787 * \n
1788 *
1789 * This can be optimized and standardized using the TTL_step_buffering
1790 * call.
1791 *
1792 * @startuml
1793 *
1794 * start
1795 *
1796 *
1797 * stop
1798 *
1799 * @enduml
1800 */
1801static inline TTL_export_double_const_ushort_tensor_buffering_t __attribute__((overloadable))
1803 TTL_ext_ushort_tensor_t ext_tensor, TTL_event_t *event);
1804
1805static inline TTL_int_ushort_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1807
1808static inline TTL_export_double_const_ushort_tensor_buffering_t __attribute__((overloadable))
1810 TTL_ext_ushort_tensor_t ext_tensor, TTL_event_t *event) {
1812
1813 result.common.int_base[0] = int_base1;
1814 result.common.int_base[1] = int_base2;
1815
1816 result.common.ext_tensor_in = ext_tensor;
1817 result.event = event;
1818 result.common.index = 0;
1819
1821
1822 return result;
1823}
1824
1825// Clear up the mess we made!
1826
1827// #undef TTL_EXT_TENSOR_TYPE
1828/*
1829 * TTL_double_scheme_template.h
1830 *
1831 * Copyright (c) 2025 Mobileye
1832 *
1833 * Licensed under the Apache License, Version 2.0 (the License);
1834 * you may not use this file except in compliance with the License.
1835 * You may obtain a copy of the License at
1836 *
1837 * http://www.apache.org/licenses/LICENSE-2.0
1838 *
1839 * Unless required by applicable law or agreed to in writing, software
1840 * distributed under the License is distributed on an AS IS BASIS,
1841 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1842 * See the License for the specific language governing permissions and
1843 * limitations under the License.
1844 */
1845
1846// clang-format off
1847/**
1848 * @file
1849 *
1850 * TTL_double_buffering pipelines a duplex import or export transaction using two
1851 * internal buffers.
1852 *
1853 * The following table draws the pipelined actions performed in double buffering.
1854 * It specifies which tile is processed in each iteration:
1855 *
1856 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1857 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1858 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1859 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1860 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1861 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1862 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1863 *
1864 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1865 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1866 *
1867 * @example TTL_double_buffering.cl
1868 */
1869// clang-format on
1870
1871// This file presumes that the following have been pre included.
1872// this is not done here for path reasons.
1873// #include "TTL_core.h"
1874// #include "TTL_import_export.h"
1875// #include TTL_IMPORT_EXPORT_INCLUDE_H
1876
1877/**
1878 * @def The structs used for this buffering type
1879 */
1880/**
1881 * @brief Data required to perform double buffer pipelining.
1882 *
1883 * @see TTL_start_import_double_buffering and
1884 * TTL_start_export_double_buffering for a description of double buffer
1885 * pipelining.
1886 */
1887typedef struct {
1888 struct {
1889 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
1890 0->1->0->1... etc */
1891 __local long *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
1892 TTL_const_ext_long_tensor_t ext_tensor_in; /*!< The external tensor being input */
1893 TTL_const_ext_long_tensor_t ext_tensor_out; /*!< The external tensor being output */
1894 } common; ///< The information that is common to all pipeline schemes
1895 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
1896 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
1898
1899/**
1900 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
1901 *
1902 * @param int_base1 A pointer to the 1st local buffer
1903 * @param int_base2 A pointer to the 2nd local buffer
1904 * @param ext_tensor A tensor describing the input in global memory
1905 * @param event A pointer to the event to use for the inward (external to
1906 * internal) transfer completion
1907 * @param first_tile The first tile to fetch for the scheme
1908 *
1909 * @return The TTL_import_double_buffering_t created from the input parameters.
1910 *
1911 * Example:
1912 * @code
1913 * TTL_event_t import_DB_e = TTL_get_event();
1914 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
1915 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
1916 * @endcode
1917 * \n
1918 *
1919 * This can be optimized and standardized using the TTL_step_buffering
1920 * call.
1921 *
1922 * @startuml
1923 *
1924 * start
1925 *
1926 *
1927 * stop
1928 *
1929 * @enduml
1930 */
1931static inline TTL_import_double_const_long_tensor_buffering_t __attribute__((overloadable))
1932TTL_start_import_double_buffering(__local long *int_base1, __local long *int_base2,
1933 TTL_const_ext_long_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
1934static inline TTL_int_long_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
1936
1937static inline TTL_import_double_const_long_tensor_buffering_t __attribute__((overloadable))
1938TTL_start_import_double_buffering(__local long *int_base1, __local long *int_base2,
1939 TTL_const_ext_long_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
1941
1942 result.common.int_base[0] = int_base1;
1943 result.common.int_base[1] = int_base2;
1944
1945 result.common.ext_tensor_in = ext_tensor;
1946 result.event = event;
1947 result.common.index = 0;
1948
1950
1951 TTL_step_buffering(&result, first_tile);
1952
1953 return result;
1954}
1955
1956// Clear up the mess we made!
1957
1958// #undef TTL_EXT_TENSOR_TYPE
1959/*
1960 * TTL_double_scheme_template.h
1961 *
1962 * Copyright (c) 2025 Mobileye
1963 *
1964 * Licensed under the Apache License, Version 2.0 (the License);
1965 * you may not use this file except in compliance with the License.
1966 * You may obtain a copy of the License at
1967 *
1968 * http://www.apache.org/licenses/LICENSE-2.0
1969 *
1970 * Unless required by applicable law or agreed to in writing, software
1971 * distributed under the License is distributed on an AS IS BASIS,
1972 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1973 * See the License for the specific language governing permissions and
1974 * limitations under the License.
1975 */
1976
1977// clang-format off
1978/**
1979 * @file
1980 *
1981 * TTL_double_buffering pipelines a duplex import or export transaction using two
1982 * internal buffers.
1983 *
1984 * The following table draws the pipelined actions performed in double buffering.
1985 * It specifies which tile is processed in each iteration:
1986 *
1987 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
1988 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
1989 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1990 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
1991 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
1992 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
1993 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
1994 *
1995 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
1996 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
1997 *
1998 * @example TTL_double_buffering.cl
1999 */
2000// clang-format on
2001
2002// This file presumes that the following have been pre included.
2003// this is not done here for path reasons.
2004// #include "TTL_core.h"
2005// #include "TTL_import_export.h"
2006// #include TTL_IMPORT_EXPORT_INCLUDE_H
2007
2008/**
2009 * @def The structs used for this buffering type
2010 */
2011/**
2012 * @brief Data required to perform double buffer pipelining.
2013 *
2014 * @see TTL_start_import_double_buffering and
2015 * TTL_start_export_double_buffering for a description of double buffer
2016 * pipelining.
2017 */
2018typedef struct {
2019 struct {
2020 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
2021 0->1->0->1... etc */
2022 __local long *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
2023 TTL_ext_long_tensor_t ext_tensor_in; /*!< The external tensor being input */
2024 TTL_ext_long_tensor_t ext_tensor_out; /*!< The external tensor being output */
2025 } common; ///< The information that is common to all pipeline schemes
2026 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
2027 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
2029/**
2030 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
2031 *
2032 * @param int_base1 A pointer to the 1st local buffer
2033 * @param int_base2 A pointer to the 2nd local buffer
2034 * @param ext_tensor A tensor describing the output in global memory
2035 * @param event A pointer to the event to use for the inward and outward
2036 * transfer completion
2037 *
2038 * Solid description of single buffering here.
2039 *
2040 * @return The TTL_export_double_buffering_t created from the input parameters.
2041 *
2042 * Example:
2043 * @code
2044 * TTL_event_t export_DB_e = TTL_get_event();
2045 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
2046 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
2047 * @endcode
2048 * \n
2049 *
2050 * This can be optimized and standardized using the TTL_step_buffering
2051 * call.
2052 *
2053 * @startuml
2054 *
2055 * start
2056 *
2057 *
2058 * stop
2059 *
2060 * @enduml
2061 */
2062static inline TTL_export_double_const_long_tensor_buffering_t __attribute__((overloadable))
2063TTL_start_export_double_buffering(__local long *int_base1, __local long *int_base2, TTL_ext_long_tensor_t ext_tensor,
2064 TTL_event_t *event);
2065
2066static inline TTL_int_long_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
2068
2069static inline TTL_export_double_const_long_tensor_buffering_t __attribute__((overloadable))
2070TTL_start_export_double_buffering(__local long *int_base1, __local long *int_base2, TTL_ext_long_tensor_t ext_tensor,
2071 TTL_event_t *event) {
2073
2074 result.common.int_base[0] = int_base1;
2075 result.common.int_base[1] = int_base2;
2076
2077 result.common.ext_tensor_in = ext_tensor;
2078 result.event = event;
2079 result.common.index = 0;
2080
2082
2083 return result;
2084}
2085
2086// Clear up the mess we made!
2087
2088// #undef TTL_EXT_TENSOR_TYPE
2089/*
2090 * TTL_double_scheme_template.h
2091 *
2092 * Copyright (c) 2025 Mobileye
2093 *
2094 * Licensed under the Apache License, Version 2.0 (the License);
2095 * you may not use this file except in compliance with the License.
2096 * You may obtain a copy of the License at
2097 *
2098 * http://www.apache.org/licenses/LICENSE-2.0
2099 *
2100 * Unless required by applicable law or agreed to in writing, software
2101 * distributed under the License is distributed on an AS IS BASIS,
2102 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2103 * See the License for the specific language governing permissions and
2104 * limitations under the License.
2105 */
2106
2107// clang-format off
2108/**
2109 * @file
2110 *
2111 * TTL_double_buffering pipelines a duplex import or export transaction using two
2112 * internal buffers.
2113 *
2114 * The following table draws the pipelined actions performed in double buffering.
2115 * It specifies which tile is processed in each iteration:
2116 *
2117 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
2118 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
2119 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
2120 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
2121 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
2122 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
2123 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
2124 *
2125 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
2126 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
2127 *
2128 * @example TTL_double_buffering.cl
2129 */
2130// clang-format on
2131
2132// This file presumes that the following have been pre included.
2133// this is not done here for path reasons.
2134// #include "TTL_core.h"
2135// #include "TTL_import_export.h"
2136// #include TTL_IMPORT_EXPORT_INCLUDE_H
2137
2138/**
2139 * @def The structs used for this buffering type
2140 */
2141/**
2142 * @brief Data required to perform double buffer pipelining.
2143 *
2144 * @see TTL_start_import_double_buffering and
2145 * TTL_start_export_double_buffering for a description of double buffer
2146 * pipelining.
2147 */
2148typedef struct {
2149 struct {
2150 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
2151 0->1->0->1... etc */
2152 __local ulong *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
2153 TTL_const_ext_ulong_tensor_t ext_tensor_in; /*!< The external tensor being input */
2154 TTL_const_ext_ulong_tensor_t ext_tensor_out; /*!< The external tensor being output */
2155 } common; ///< The information that is common to all pipeline schemes
2156 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
2157 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
2159
2160/**
2161 * @brief Create a TTL_import_double_buffering_t and begin the buffering process
2162 *
2163 * @param int_base1 A pointer to the 1st local buffer
2164 * @param int_base2 A pointer to the 2nd local buffer
2165 * @param ext_tensor A tensor describing the input in global memory
2166 * @param event A pointer to the event to use for the inward (external to
2167 * internal) transfer completion
2168 * @param first_tile The first tile to fetch for the scheme
2169 *
2170 * @return The TTL_import_double_buffering_t created from the input parameters.
2171 *
2172 * Example:
2173 * @code
2174 * TTL_event_t import_DB_e = TTL_get_event();
2175 * TTL_import_double_buffering_t import_db = TTL_start_import_double_buffering(
2176 * l_in1, l_in2, ext_base_in, ext_layout_in, &import_DB_e);
2177 * @endcode
2178 * \n
2179 *
2180 * This can be optimized and standardized using the TTL_step_buffering
2181 * call.
2182 *
2183 * @startuml
2184 *
2185 * start
2186 *
2187 *
2188 * stop
2189 *
2190 * @enduml
2191 */
2192static inline TTL_import_double_const_ulong_tensor_buffering_t __attribute__((overloadable))
2194 TTL_const_ext_ulong_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile);
2195static inline TTL_int_ulong_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
2197
2198static inline TTL_import_double_const_ulong_tensor_buffering_t __attribute__((overloadable))
2200 TTL_const_ext_ulong_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile) {
2202
2203 result.common.int_base[0] = int_base1;
2204 result.common.int_base[1] = int_base2;
2205
2206 result.common.ext_tensor_in = ext_tensor;
2207 result.event = event;
2208 result.common.index = 0;
2209
2211
2212 TTL_step_buffering(&result, first_tile);
2213
2214 return result;
2215}
2216
2217// Clear up the mess we made!
2218
2219// #undef TTL_EXT_TENSOR_TYPE
2220/*
2221 * TTL_double_scheme_template.h
2222 *
2223 * Copyright (c) 2025 Mobileye
2224 *
2225 * Licensed under the Apache License, Version 2.0 (the License);
2226 * you may not use this file except in compliance with the License.
2227 * You may obtain a copy of the License at
2228 *
2229 * http://www.apache.org/licenses/LICENSE-2.0
2230 *
2231 * Unless required by applicable law or agreed to in writing, software
2232 * distributed under the License is distributed on an AS IS BASIS,
2233 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2234 * See the License for the specific language governing permissions and
2235 * limitations under the License.
2236 */
2237
2238// clang-format off
2239/**
2240 * @file
2241 *
2242 * TTL_double_buffering pipelines a duplex import or export transaction using two
2243 * internal buffers.
2244 *
2245 * The following table draws the pipelined actions performed in double buffering.
2246 * It specifies which tile is processed in each iteration:
2247 *
2248 * | Action\\Iteration | \#-1 | \#0 | \#1 | \#2 | \#i (2:NumOfTiles-2) | \#NumOfTiles-1 | \#NumOfTiles | \#NumOfTiles+1 |
2249 * |-------------------|------|-----|-----|-----|----------------------|----------------|--------------|----------------|
2250 * | **Wait Import** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
2251 * | **Import** | 0 | 1 | 2 | 3 | i+1 | | | |
2252 * | **WaitExport** | | | | 0 | i-2 | NumOfTiles-3 | NumOfTiles-2 | NumOfTiles-1 |
2253 * | **Export** | | | 0 | 1 | i-1 | NumOfTiles-2 | NumOfTiles-1 | |
2254 * | **Compute** | | 0 | 1 | 2 | i | NumOfTiles-1 | | |
2255 *
2256 * Notice the prolog (at iteration number -1) and the 2 epilogs (at iterations
2257 * number NumOfTiles and NumOfTiles+1) which add in total 3 extra iterations.
2258 *
2259 * @example TTL_double_buffering.cl
2260 */
2261// clang-format on
2262
2263// This file presumes that the following have been pre included.
2264// this is not done here for path reasons.
2265// #include "TTL_core.h"
2266// #include "TTL_import_export.h"
2267// #include TTL_IMPORT_EXPORT_INCLUDE_H
2268
2269/**
2270 * @def The structs used for this buffering type
2271 */
2272/**
2273 * @brief Data required to perform double buffer pipelining.
2274 *
2275 * @see TTL_start_import_double_buffering and
2276 * TTL_start_export_double_buffering for a description of double buffer
2277 * pipelining.
2278 */
2279typedef struct {
2280 struct {
2281 int index; /*!< Describes the current buffer index when pipelining. For single 0->1->0, for double
2282 0->1->0->1... etc */
2283 __local ulong *int_base[2]; /*!< The internal base addresses of the pipelined tiles. */
2284 TTL_ext_ulong_tensor_t ext_tensor_in; /*!< The external tensor being input */
2285 TTL_ext_ulong_tensor_t ext_tensor_out; /*!< The external tensor being output */
2286 } common; ///< The information that is common to all pipeline schemes
2287 TTL_event_t *event; ///< A pointer to the event that is used to track the progress of the transfer
2288 TTL_tile_t prev_tile; ///< Store of the previous imported/exported tile */
2290/**
2291 * @brief Create a TTL_export_double_buffering_t and begin the buffering process
2292 *
2293 * @param int_base1 A pointer to the 1st local buffer
2294 * @param int_base2 A pointer to the 2nd local buffer
2295 * @param ext_tensor A tensor describing the output in global memory
2296 * @param event A pointer to the event to use for the inward and outward
2297 * transfer completion
2298 *
2299 * Solid description of single buffering here.
2300 *
2301 * @return The TTL_export_double_buffering_t created from the input parameters.
2302 *
2303 * Example:
2304 * @code
2305 * TTL_event_t export_DB_e = TTL_get_event();
2306 * TTL_export_double_buffering_t import_db = TTL_start_export_double_buffering(
2307 * l_in1, l_in2, ext_base_in, ext_layout_in, &export_DB_e);
2308 * @endcode
2309 * \n
2310 *
2311 * This can be optimized and standardized using the TTL_step_buffering
2312 * call.
2313 *
2314 * @startuml
2315 *
2316 * start
2317 *
2318 *
2319 * stop
2320 *
2321 * @enduml
2322 */
2323static inline TTL_export_double_const_ulong_tensor_buffering_t __attribute__((overloadable))
2325 TTL_event_t *event);
2326
2327static inline TTL_int_ulong_sub_tensor_t __attribute__((overloadable)) TTL_step_buffering(
2329
2330static inline TTL_export_double_const_ulong_tensor_buffering_t __attribute__((overloadable))
2332 TTL_event_t *event) {
2334
2335 result.common.int_base[0] = int_base1;
2336 result.common.int_base[1] = int_base2;
2337
2338 result.common.ext_tensor_in = ext_tensor;
2339 result.event = event;
2340 result.common.index = 0;
2341
2343
2344 return result;
2345}
2346
2347// Clear up the mess we made!
2348
2349// #undef TTL_EXT_TENSOR_TYPE
static TTL_tile_t TTL_create_empty_tile()
Create an empty tile. Empty means it has all dimensions set to zero.
event_t TTL_event_t
TTL_event_t is a pseudonym for OpenCL event_t.
#define __local
The opencl __local namespace is not supported in C.
unsigned char uchar
OpenCL supports uchar so provide the same in c.
unsigned long ulong
OpenCL supports ulong so provide the same in c.
unsigned int uint
OpenCL supports uint so provide the same in c.
unsigned short ushort
OpenCL supports ushort so provide the same in c.
static TTL_int_void_sub_tensor_t TTL_step_buffering(TTL_import_double_const_void_tensor_buffering_t *const db, const TTL_tile_t next_tile)
static TTL_export_double_const_void_tensor_buffering_t TTL_start_export_double_buffering(__local void *int_base1, __local void *int_base2, TTL_ext_void_tensor_t ext_tensor, TTL_event_t *event)
Create a TTL_export_double_buffering_t and begin the buffering process.
static TTL_import_double_const_void_tensor_buffering_t TTL_start_import_double_buffering(__local void *int_base1, __local void *int_base2, TTL_const_ext_void_tensor_t ext_tensor, TTL_event_t *event, TTL_tile_t first_tile)
Create a TTL_import_double_buffering_t and begin the buffering process.
Data required to perform double buffer pipelining.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
struct TTL_export_double_const_char_tensor_buffering_t::@274355142300042323220351027036255335000157333351 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
Data required to perform double buffer pipelining.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
struct TTL_export_double_const_int_tensor_buffering_t::@201053010162333126374142011357113240113116033225 common
The information that is common to all pipeline schemes.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
struct TTL_export_double_const_long_tensor_buffering_t::@005074011370370157314371364162274314132051367153 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
struct TTL_export_double_const_short_tensor_buffering_t::@151112112132037235363116055376313053015031007272 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
Data required to perform double buffer pipelining.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
struct TTL_export_double_const_uchar_tensor_buffering_t::@146206160033365347321226335257227057216355112141 common
The information that is common to all pipeline schemes.
Data required to perform double buffer pipelining.
struct TTL_export_double_const_uint_tensor_buffering_t::@072221004067031204067361370243135174075155141003 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
struct TTL_export_double_const_ulong_tensor_buffering_t::@317120211145000333144173354157327200154147076062 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
Data required to perform double buffer pipelining.
struct TTL_export_double_const_ushort_tensor_buffering_t::@162146030345210151311024242355307055127046271067 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
struct TTL_export_double_const_void_tensor_buffering_t::@077300321125076312104133171107053050256251275040 common
The information that is common to all pipeline schemes.
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
const and non-const tensors in the appropriate address space
Data required to perform double buffer pipelining.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
struct TTL_import_double_const_char_tensor_buffering_t::@014225366035165023266107157236354004070025146251 common
The information that is common to all pipeline schemes.
Data required to perform double buffer pipelining.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
struct TTL_import_double_const_int_tensor_buffering_t::@342121165014150220125310047363122143237222032022 common
The information that is common to all pipeline schemes.
Data required to perform double buffer pipelining.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
struct TTL_import_double_const_long_tensor_buffering_t::@101210355153160070060252330233134333011142064012 common
The information that is common to all pipeline schemes.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
struct TTL_import_double_const_short_tensor_buffering_t::@300166365271240164107203313231136071175120132135 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
Data required to perform double buffer pipelining.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
struct TTL_import_double_const_uchar_tensor_buffering_t::@154303371245223061065173352010166177167170320106 common
The information that is common to all pipeline schemes.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
struct TTL_import_double_const_uint_tensor_buffering_t::@014342223077327371317116316217346175335053230223 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
struct TTL_import_double_const_ulong_tensor_buffering_t::@130354344111232155336035325047340131106012304105 common
The information that is common to all pipeline schemes.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
struct TTL_import_double_const_ushort_tensor_buffering_t::@243027237343176125126055055123170221241315003330 common
The information that is common to all pipeline schemes.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
Data required to perform double buffer pipelining.
struct TTL_import_double_const_void_tensor_buffering_t::@054344304176377222125365063235230170352257247333 common
The information that is common to all pipeline schemes.
TTL_tile_t prev_tile
Store of the previous imported/exported tile *‍/.
TTL_event_t * event
A pointer to the event that is used to track the progress of the transfer.
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space
const and non-const sub tensors in the appropriate address space