-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
meson.build
95 lines (75 loc) · 2.24 KB
/
meson.build
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Marvell.
if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
build = false
reason = 'only supported on 64-bit Linux'
subdir_done()
endif
enable_mvtvm = true
if not libarchive.found()
message('drivers/ml/cnxk: libarchive not found')
enable_mvtvm = false
endif
if not jansson_dep.found()
message('drivers/ml/cnxk: jansson not found')
enable_mvtvm = false
endif
dlpack_dep = dependency('dlpack', method: 'cmake', required: false, cmake_args: 'CONFIG')
if not dlpack_dep.found()
message('drivers/ml/cnxk: dlpack not found')
enable_mvtvm = false
endif
dmlc_dep = dependency('dmlc', method: 'cmake', required: false, cmake_args: 'CONFIG')
if not dmlc_dep.found()
message('drivers/ml/cnxk: dmlc not found')
enable_mvtvm = false
endif
tvm_dep = dependency('tvm', method: 'cmake', required: false, cmake_args: 'CONFIG', modules : ['tvm::tvm_runtime'])
if not tvm_dep.found()
message('drivers/ml/cnxk: tvm_runtime not found')
enable_mvtvm = false
endif
tvmdp_dep = dependency('tvmdp', method: 'pkg-config', required: false)
if not tvmdp_dep.found()
message('drivers/ml/cnxk: tvmdp not found')
enable_mvtvm = false
endif
sources = files(
'cn10k_ml_dev.c',
'cn10k_ml_ops.c',
'cn10k_ml_model.c',
'cn10k_ml_ocm.c',
'cnxk_ml_dev.c',
'cnxk_ml_io.c',
'cnxk_ml_model.c',
'cnxk_ml_ops.c',
'cnxk_ml_utils.c',
)
deps += ['mldev', 'common_cnxk', 'kvargs', 'hash']
if enable_mvtvm
dpdk_conf.set('RTE_MLDEV_CNXK_ENABLE_MVTVM', 1)
sources += files(
'mvtvm_ml_dev.c',
'mvtvm_ml_ops.c',
'mvtvm_ml_model.c',
)
ext_deps += jansson_dep
ext_deps += dlpack_dep
ext_deps += dmlc_dep
ext_deps += tvm_dep
ext_deps += tvmdp_dep
ext_deps += cc.find_library('stdc++', required: true)
deps += ['bus_vdev']
message('drivers/ml/cnxk: Enabled TVM model support')
else
message('drivers/ml/cnxk: Disabled TVM model support')
sources += files(
'mvtvm_ml_stubs.c',
)
endif
require_iova_in_mbuf = false
if get_option('buildtype').contains('debug')
cflags += [ '-DCNXK_ML_DEV_DEBUG' ]
else
cflags += [ '-UCNXK_ML_DEV_DEBUG' ]
endif