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