mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 16:26:14 +08:00
Thneed load/save (#19700)
* start thneed load/save * compiling * fix loading * build thneed model in scons * don't hardcode /data/openpilot * release files * those too * support for loading/saving binary kernels * save binaries out of json band * make binary a command line flag to the compiler * need include assert * fix shadowed common in SConscript * cleanup run.h * hmm, the recurrent buffer wasn't 0ed * ugh, unique ptr * remove power constraint, refactor record * Revert "remove power constraint, refactor record" This reverts commit bb6fa52db6df59cd9d6420a6f630430e35af8a5e. * print on thneed stop * fingers crossed for this one * recorded * just curious * okay okay, pass tests? * cleanups * refactor wait Co-authored-by: Comma Device <device@comma.ai> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
+22
-11
@@ -10,14 +10,17 @@ common_src = [
|
||||
"transforms/transform.cc"
|
||||
]
|
||||
|
||||
if arch == "aarch64":
|
||||
libs += ['gsl', 'CB', 'gnustl_shared']
|
||||
common_src += ["thneed/thneed.cc"]
|
||||
lenv['CFLAGS'].append("-DUSE_THNEED")
|
||||
lenv['CXXFLAGS'].append("-DUSE_THNEED")
|
||||
elif arch == "larch64":
|
||||
libs += ['gsl', 'CB', 'pthread', 'dl']
|
||||
common_src += ["thneed/thneed.cc"]
|
||||
thneed_src = [
|
||||
"thneed/thneed.cc",
|
||||
"thneed/serialize.cc",
|
||||
"runners/thneedmodel.cc",
|
||||
]
|
||||
|
||||
if arch == "aarch64" or arch == "larch64":
|
||||
libs += ['gsl', 'CB']
|
||||
libs += ['gnustl_shared'] if arch == "aarch64" else ['pthread', 'dl']
|
||||
|
||||
common_src += thneed_src
|
||||
lenv['CFLAGS'].append("-DUSE_THNEED")
|
||||
lenv['CXXFLAGS'].append("-DUSE_THNEED")
|
||||
else:
|
||||
@@ -40,15 +43,23 @@ else:
|
||||
del libs[libs.index('symphony-cpu')]
|
||||
del common_src[common_src.index('runners/snpemodel.cc')]
|
||||
|
||||
common = lenv.Object(common_src)
|
||||
common_model = lenv.Object(common_src)
|
||||
|
||||
# build thneed model
|
||||
if arch == "aarch64" or arch == "larch64":
|
||||
compiler = lenv.Program('thneed/compile', ["thneed/compile.cc" ]+common_model, LIBS=libs)
|
||||
cmd = f"cd {Dir('.').get_abspath()} && {compiler[0].get_abspath()} ../../models/supercombo.dlc ../../models/supercombo.thneed --binary"
|
||||
snpe_path = "/data/pythonpath/phonelibs/snpe/"+arch
|
||||
cenv = Environment(ENV = {'LD_LIBRARY_PATH' : snpe_path+":"+lenv["ENV"]["LD_LIBRARY_PATH"]})
|
||||
cenv.Command("../../models/supercombo.thneed", ["../../models/supercombo.dlc", compiler], cmd)
|
||||
|
||||
lenv.Program('_dmonitoringmodeld', [
|
||||
"dmonitoringmodeld.cc",
|
||||
"models/dmonitoring.cc",
|
||||
]+common, LIBS=libs)
|
||||
]+common_model, LIBS=libs)
|
||||
|
||||
lenv.Program('_modeld', [
|
||||
"modeld.cc",
|
||||
"models/driving.cc",
|
||||
]+common, LIBS=libs)
|
||||
]+common_model, LIBS=libs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user