xmos-ai-tools 1.3.2.dev303__py3-none-macosx_10_15_universal2.whl → 1.3.2.dev314__py3-none-macosx_10_15_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,11 @@
2
2
  #define __micro_thread_library_h__
3
3
 
4
4
  #include <stdint.h>
5
+ #ifdef __xcore__
6
+ #include <xcore/parallel.h>
7
+ #else
8
+ typedef unsigned synchronizer_t;
9
+ #endif
5
10
 
6
11
  #ifdef __cplusplus
7
12
  extern "C" {
@@ -21,8 +26,6 @@ typedef struct { // THIS STRUCT MUST BE IN SYNC WITH ASSEMBLY CODE.
21
26
  uint32_t id[4]; // Actual IDs
22
27
  } thread_ids; // ids of at most 4 threads - live during invoke
23
28
  uint32_t synchroniser; // synchroniser for threads - live during invoke
24
- uint32_t nstackwords; // nstackwords per stack - live after load model
25
- void *UNSAFE stacks; // pointer to top of stack - live after load model
26
29
  } thread_info_t;
27
30
 
28
31
 
@@ -31,56 +34,15 @@ typedef struct { // THIS STRUCT MUST BE IN SYNC WITH ASSEMBLY CODE.
31
34
  typedef void (*thread_function_pointer_t)(void * arg0, void * arg1, void * arg2);
32
35
  struct inference_engine;
33
36
 
34
- /** Function that creates threads, then calls a interp_invoke_internal,
35
- * then destroys threads
36
- * This function creates four threads for a total of five threads.
37
- * other versions of the functions create 3, 2, 1, or 0 threads.
38
- *
39
- * \param ie Pointer to the inference object to be passed to
40
- * interp_invoke_internal
41
- * \param ptr Pointer to a thread_info block. The thread-ids will
42
- * be stored in this block, and a stack pointer is expected
43
- * in this block:
44
- * ptr[0] [out] thread-id-0 (versions with fewer threads
45
- * ptr[1] [out] thread-id-1 will only use the first few
46
- * ptr[2] [out] thread-id-2 slots)
47
- * ptr[3] [out] thread-id-3
48
- * ptr[4] [out] synchroniser-id
49
- * ptr[5] [in] top of stacks
50
- * ptr[6] [in] number of words per stack
37
+ /** Function that runs the client task
51
38
  */
52
- int thread_invoke_5(struct inference_engine *ie, thread_info_t *ptr);
53
- int thread_invoke_4(struct inference_engine *ie, thread_info_t *ptr);
54
- int thread_invoke_3(struct inference_engine *ie, thread_info_t *ptr);
55
- int thread_invoke_2(struct inference_engine *ie, thread_info_t *ptr);
56
- int thread_invoke_1(struct inference_engine *ie, thread_info_t *ptr);
39
+ void thread_client(thread_info_t *ptr, int n);
57
40
 
58
- /** Function that creates threads.
59
- * This function creates four threads for a total of five threads.
60
- * other versions of the functions create 3, 2, 1, or 0 threads.
61
- *
62
- * \param ptr Pointer to a thread_info block. The thread-ids will
63
- * be stored in this block, and a stack pointer is expected
64
- * in this block:
65
- * ptr[0] [out] thread-id-0 (versions with fewer threads
66
- * ptr[1] [out] thread-id-1 will only use the first few
67
- * ptr[2] [out] thread-id-2 slots)
68
- * ptr[3] [out] thread-id-3
69
- * ptr[4] [out] synchroniser-id
70
- * ptr[5] [in] top of stacks
71
- * ptr[6] [in] number of words per stack
72
- */
73
- void thread_init_5(thread_info_t *ptr);
74
- void thread_init_4(thread_info_t *ptr);
75
- void thread_init_3(thread_info_t *ptr);
76
- void thread_init_2(thread_info_t *ptr);
77
- void thread_init_1(thread_info_t *ptr);
78
- /** Function that destroys threads. Must be called from the same function that
79
- * called an _init_ above.
80
- *
81
- * \param ptr Pointer to a thread_info block.
41
+ /** Function that runs the client task
82
42
  */
83
- void thread_destroy(thread_info_t *ptr);
43
+ static inline void thread_store_sync(thread_info_t *ptr, uint32_t s) {
44
+ ptr->synchroniser = s;
45
+ }
84
46
 
85
47
  /** Function that sets up parameters for one of the client threads
86
48
  * This particular one passes the second and third arguments to the thread.
@@ -94,7 +56,21 @@ void thread_destroy(thread_info_t *ptr);
94
56
  * \param arg2 Third argument for the thread function
95
57
  * \param thread_id The thread_id to initialise; one of ptr[0]..ptr[3] above
96
58
  */
97
- void thread_variable_setup(void * arg1, void * arg2, uint32_t thread_id);
59
+ #ifdef __xcore__
60
+ static inline void thread_variable_setup(void * arg1, void * arg2, uint32_t thread_id) {
61
+ #ifdef __VX4A__
62
+ asm volatile("xm.tsetr %0, 11, %1" :: "r" (thread_id), "r" (arg1));
63
+ asm volatile("xm.tsetr %0, 12, %1" :: "r" (thread_id), "r" (arg2));
64
+ asm volatile("xm.tsetr %0, 24, %1" :: "r" (thread_id), "r" (1));
65
+ #else
66
+ asm volatile("set t[%0]:r1, %1" :: "r" (thread_id), "r" (arg1));
67
+ asm volatile("set t[%0]:r2, %1" :: "r" (thread_id), "r" (arg2));
68
+ asm volatile("set t[%0]:r10, %1" :: "r" (thread_id), "r" (1));
69
+ #endif
70
+ }
71
+ #else
72
+ extern void thread_variable_setup(void * arg1, void * arg2, uint32_t thread_id);
73
+ #endif
98
74
 
99
75
  /** Function that starts all thread functions and runs them until completion.
100
76
  * It is assumed that the variable parts have been set up per thread.
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xmos_ai_tools
3
- Version: 1.3.2.dev303
3
+ Version: 1.3.2.dev314
4
4
  Summary: XMOS AI Tools
5
5
  Home-page: https://github.com/xmos/ai_tools
6
6
  Author: XMOS
@@ -41,4 +41,4 @@ Dynamic: summary
41
41
  Documentation
42
42
  -------------
43
43
 
44
- Click [here](https://github.com/xmos/ai_tools/blob/e51b0e1e84fc08d0aad46dfb9ba2d038ccd975ec/README.md) for documentation on using xmos-ai-tools to deploy AI models on xcore.
44
+ Click [here](https://github.com/xmos/ai_tools/blob/e358ca58e3fa05f0132d216e1dfefac098d2bb63/README.md) for documentation on using xmos-ai-tools to deploy AI models on xcore.
@@ -80,7 +80,7 @@ xmos_ai_tools/runtime/include/lib_tflite_micro/api/version.h,sha256=ImFxGU2PzLZ3
80
80
  xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_config.h,sha256=gywR3hBJe05GTLkcdJss0bmk3dzsWivXK6U9FF7Pfm0,589
81
81
  xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_device_memory.h,sha256=bLWcRDNrzClLh8_eR3XRRz3sA2pEAzzxGLDoPTsNp8A,1917
82
82
  xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_shared_config.h,sha256=EdqTecMZIdSk1ZWUE7rdl6ilXe4-vbFiwwcf0Y124c4,1562
83
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/thread_call.h,sha256=KNG-3gNWMSonzYTGbk4L0kT8WU9JD0bOzlk8naz7JO0,4965
83
+ xmos_ai_tools/runtime/include/lib_tflite_micro/src/thread_call.h,sha256=YobSgoLTISGz3o7mz-ZXiLNlJWnko5R44NmYh8SvxkQ,3206
84
84
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/conv2d_float.h,sha256=XfVVWAKhbv6nByOzO1j6WA4oQ4RTX3PvYx22f-_3JFA,7681
85
85
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.h,sha256=lC4Tw1Pxxg3zOXRdqNNtokuU-_cX9TTkYmGLe47-9dQ,630
86
86
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.h,sha256=_NIzvBYMqlwJexYESP5t5JXpxYTt-ZKq-1AdqAB9-Sc,812
@@ -380,17 +380,17 @@ xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/metrics.h
380
380
  xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/op_resolver.h,sha256=g0dl9tzUqngiINvjBlqDclFqvkC85MC4kbU13vE4OkY,6071
381
381
  xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_generated.h,sha256=hSumwEqc-LmMHG82KKl1yPLiVMNbLj_q19-VRPCR7ng,1093175
382
382
  xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_utils.h,sha256=tkHMDPARjIqppYCVInIowwdHxjNP3pfSS9O7vx-ODeo,1333
383
- xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a,sha256=cm2VQGSPP3myC3Lnv4rrMjX9tmIhHybjtpKIVwKUv7U,2476384
384
- xmos_ai_tools/runtime/lib/libxtflitemicro.a,sha256=ljU97-QXXi0Wwdkjb3A0IKVrIQrx4pMBOfk-5Wd4iB0,71964212
383
+ xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a,sha256=zNVlVeITK-V46GeccRWRBh-e33bLq1zJr4jpj6b-q1U,2479336
384
+ xmos_ai_tools/runtime/lib/libxtflitemicro.a,sha256=SQU77BXngIHnTu1q9o6_no3cvvMoL93yCSy8cBj9F8E,72202704
385
385
  xmos_ai_tools/xformer/__init__.py,sha256=a4K06oiSu2TYVwGvzwMDGGejPUYTvW9-5Uw6SfuFCX4,1903
386
386
  xmos_ai_tools/xformer/flash.py,sha256=MG4coi_Lvvg-oQmw1pomJD8eeOH4gAMjixjBFvO2BCk,6376
387
387
  xmos_ai_tools/xinterpreters/__init__.py,sha256=PFRB9VxOLKaA--j2ZvWGcmesv2C6uNYqJ_kBam68aUI,50
388
388
  xmos_ai_tools/xinterpreters/exceptions.py,sha256=HOjADxHYMPI9mN0YIbWxtw9hSeL2B6XWWwqtGtyJdVs,577
389
389
  xmos_ai_tools/xinterpreters/host_interpreter.py,sha256=ZdvzXUnAdnCcSU-dNQvq6ad2MDk9PZqu9UyNoBgBYKI,25755
390
- xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib,sha256=eZfE3gjspfTd_pQxJAbMcVuL5CJaAu7ALcwTFLV46VU,2360232
391
- xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib,sha256=eZfE3gjspfTd_pQxJAbMcVuL5CJaAu7ALcwTFLV46VU,2360232
392
- xmos_ai_tools-1.3.2.dev303.data/data/bin/xcore-opt,sha256=cLXPnw9BNVaa6FiFwGhA3hyP2fgnz3tjpCY2NYsZxo8,286686248
393
- xmos_ai_tools-1.3.2.dev303.dist-info/METADATA,sha256=zBSf6f8n8meiAP297aHc-ntSdTiN6kOfAwU-2b9u_hs,1574
394
- xmos_ai_tools-1.3.2.dev303.dist-info/WHEEL,sha256=I31SmUcoL8b9uce_DevdBj9MUbs81Vi2-7NmWxW2CC0,112
395
- xmos_ai_tools-1.3.2.dev303.dist-info/top_level.txt,sha256=YWegea73ll3tMlRWRdHJemUy2VOuEYDdOIaffxu_eF0,14
396
- xmos_ai_tools-1.3.2.dev303.dist-info/RECORD,,
390
+ xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib,sha256=mQp_HoqoSMCxV3Wj1MVVSjtoobePEkDJxgXolJmJsPA,2359560
391
+ xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib,sha256=mQp_HoqoSMCxV3Wj1MVVSjtoobePEkDJxgXolJmJsPA,2359560
392
+ xmos_ai_tools-1.3.2.dev314.data/data/bin/xcore-opt,sha256=F9lfM3nO9moykySibqzSvqf0fR_dl-SOCiumIEa2nVw,286686296
393
+ xmos_ai_tools-1.3.2.dev314.dist-info/METADATA,sha256=4PARxhHjjMdc_jnNIG63WgAEbsQ_UfR3ww_QpZllsZ8,1574
394
+ xmos_ai_tools-1.3.2.dev314.dist-info/WHEEL,sha256=98VLpmTXZiW_X2RJ0T4x1A5tW4Utj3RcaNGBZZbavbg,112
395
+ xmos_ai_tools-1.3.2.dev314.dist-info/top_level.txt,sha256=YWegea73ll3tMlRWRdHJemUy2VOuEYDdOIaffxu_eF0,14
396
+ xmos_ai_tools-1.3.2.dev314.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.1)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: py3-none-macosx_10_15_universal2
5
5