blob: 0e8c7992c1975a42dc4e34bf6eb81bf1c13c49ef [file] [log] [blame]
Kristofer Jonsson0c79f892021-06-02 17:15:57 +02001@startuml
2
3skinparam backgroundColor #FEFEFE
4
5box "Application" #0091BD
6participant "main()" as main
7end box
8
9box "Driver library" #00C1DE
10participant "Device" as ddev
11participant "Buffer" as dbuf
12participant "Network" as dnet
13participant "Inference" as dinf
14end box
15
16box "Kernel driver" #7D868C
17participant "Device" as kdev
18participant "Buffer" as kbuf
19participant "Network" as knet
20participant "Inference" as kinf
21end box
22
23note over ddev
24 Create device
25end note
26activate main
27main -> ddev++: Device()
28 ddev -> kdev++: open(<device node>)
29 return file descriptor
30return
31
32note over dnet
Kristofer Jonsson0c79f892021-06-02 17:15:57 +020033 Create network, parse network model
34end note
35
Mikael Olssonc081e592023-10-30 11:10:56 +010036main -> dnet++: Network(device, user_buffer, size)
Kristofer Jonsson0c79f892021-06-02 17:15:57 +020037 dnet -> knet++: ioctl(NETWORK_CREATE)
38 return file descriptor
39
40 dnet -> dnet: Parse network model
41return
42
43loop Allocate and fill IFM buffers
44 main -> dbuf++: Buffer(device)
45 dbuf -> kbuf++: ioctl(BUFFER_CREATE)
46 return file descriptor
47 return
48end loop
49
50loop Allocate OFM buffers
51 main -> dbuf++: Buffer(device)
52 dbuf -> kbuf++: ioctl(BUFFER_CREATE)
53 return file descriptor
54 return
55end loop
56
57note over dinf
58 Create and run inference
59end note
60main -> dinf++: Inference(network, ifm, ofm)
61 dinf -> kinf++: ioctl(INFERENCE_CREATE)
62 return file descriptor
63return
64
65main -> dinf++: wait(file descriptor)
66 dinf -> kinf++: poll(file descriptor)
67 return
68return
69
70@enduml