-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
53 lines (47 loc) · 1.68 KB
/
main.go
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
package main
import (
"fmt"
"github.com/sheephuan/go-dl-benchmark/pkg/g_physical_devices"
"github.com/sheephuan/go-dl-benchmark/pkg/protos"
)
func main() {
// 注册设备
devDesc := protos.PhysicalDeviceDescription{
SerialNumber: "M8NRKD050090333",
DeviceName: "ROG 幻162021",
OSType: protos.DeviceOSType_windows,
ArchType: protos.ArchitectureType_x86_64,
ComputableChips: []protos.ComputableChipType{protos.ComputableChipType_cpu},
DeviceAddress: &protos.PhysicalDeviceDescription_PcAddr{PcAddr: &protos.PCDeviceAddress{DeviceIp: "127.0.0.1", DevicePort: 10001}},
}
g_physical_devices.RegisterDevicesSelf([]*protos.PhysicalDeviceDescription{&devDesc})
//ip, port := "127.0.0.1", 10001
//go terminal.LaunchRemoteTerminalService(ip, port)
//config := &protos.ModelBenchmarkTestArgs{
// ModelPath: "uploads/file/d45044fc495d9e031315dc19e20300a7_20230311194541.onnx",
// Framework: protos.FrameworkType_onnxruntime,
// InputTensorShape: "1,3,512,512",
// InputTensorType: protos.TensorDataType_float32,
// WarmupRounds: 1,
// RunRounds: 1,
//}
//d, _ := proto.Marshal(config)
//s := utils.Pb2Base64(d)
//fmt.Println(s)
//
////ability := model.ModelBenchmarkTestAbility{
//// IsSupportModelBenchmarkTest: true,
//// SupportedFrameworksForRuntimeAnalysis: []protos.FrameworkType{protos.FrameworkType_onnxruntime},
//// SupportedFrameworksForStaticAnalysis: []protos.FrameworkType{protos.FrameworkType_onnxruntime},
////}
////
//
////time.Sleep(2 * 1e9)
////res, err := ability.ModelBenchmarkTest(config, device)
////if err == nil {
//// fmt.Println(res)
////}
////
var ss string
_, _ = fmt.Scanln(&ss)
}