Commit Graph

28 Commits

Author SHA1 Message Date
Willem Melching
c2b95ca6a1 util.h has conflicting ioctl def on comma two 2021-11-04 16:46:38 +01:00
Dean Lee
177c3b89b6 thneed/serialize: use funtions from clutil(#22760) 2021-11-04 16:19:25 +01:00
Dean Lee
ff33ca3413 util: remove function to_hex (#22792) 2021-11-04 16:18:01 +01:00
Willem Melching
45c506bb17 wshadow: fix comma three build 2021-11-02 17:27:34 +01:00
Dean Lee
07ad6d7444 thneed: use util::read_file to read from the file (#22757) 2021-11-01 11:07:28 +01:00
George Hotz
83ff9ca331 Use thneed directly on the loaded YUV data (#22236)
* completely untested

* it builds now

* bug fixes, save 1ms

* using a kernel to copy works

* more sane API to loadyuv

Co-authored-by: Comma Device <device@comma.ai>
2021-09-16 14:13:03 -07:00
Willem Melching
813ddb0c18 revert ioctl changes to thneed 2021-08-30 16:30:50 -07:00
Dean Lee
31230e5b60 retry ioctls while errno == EINTR (#22054) 2021-08-30 16:07:34 -07:00
arfy slowy
d74def61f8 fix: spelling typos (#21861)
* fix: typo spelling grammar

* revert

* Update selfdrive/locationd/calibrationd.py

* more revert

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-08-05 12:05:49 -07:00
Dean Lee
d82fa763d8 remove double semicolons (#21215) 2021-06-10 00:03:34 -07:00
Dean Lee
c53cb5d570 Use C++ header files instead of C header files. (#21192)
* use cstring instead of string.h

* use cstdio instead of stdio.h

* remove inttypes.h

* use cstdlib instead of stdlib.h

* use cstdint instead of stdint.h

* #include <cstddef>

* cstdlib

* use cmath

* remove stddef.h

* use cassert

* use csignal

* use ctime

* use cerror

* rebase master
2021-06-08 13:46:22 -07:00
Dean Lee
7222d0f20d Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
2021-05-08 22:15:17 -07:00
Dean Lee
d023397ba9 thneed: remove redundant function nanos_since_boot (#20329) 2021-03-12 10:31:55 -08:00
Willem Melching
1744076514 thneed: lookup dlsym offset at compile time (#20019) 2021-02-04 16:41:46 +01:00
Dean Lee
21f45e3ef4 Thneed::clinit() : use cl_get_device_id helper(#19934) 2021-01-27 12:09:28 +01:00
George Hotz
59fac9fdc6 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>
2021-01-19 18:08:31 -08:00
George Hotz
5fdda8dbd8 Thneed refactors for future functions (#2673)
* delete debug

* thneed updates, but it seems slower

* thneed refactor

* refactor touchups

* add back asserts

* fix uaf

* track the size for local args

* final thneed refactor

* switch kgsl_command_object to avoid memory leak

* comments

* unused includes

Co-authored-by: Comma Device <device@comma.ai>
2020-12-14 15:46:49 -08:00
Comma Device
71930a4b96 mask out the priority 2020-11-24 06:05:59 +00:00
Comma Device
5a8c90f32c give the model GPU context highest priority 2020-11-24 05:57:34 +00:00
George Hotz
a14ce09018 More governance work, fix thneed (#2610)
* more governance work

* fix thneed on qcom2

* waste doesn't OOM

Co-authored-by: Comma Device <device@comma.ai>
2020-11-23 17:52:28 -08:00
Dean Lee
d158837617 add function cl_get_device_id (#1948)
* add func cl_get_device_id

cleanup

* add fix from review
2020-08-17 11:24:39 +02:00
Adeeb Shihadeh
eb1aa3d831 Wunused (#1841)
* enable Wunused, first pass

* unused stuff in snpe model

* these are used on phone

* handle sigint and sigterm in modeld

* fix phone build

* camera qcom

* QCOM build works

* delete unused camerad vars

Co-authored-by: Comma Device <device@comma.ai>
2020-07-09 09:25:32 -07:00
George Hotz
01a486308d c++ify thneed to remove memory leaks (#1737)
Co-authored-by: Comma Device <device@comma.ai>
2020-06-19 15:53:48 -07:00
Adeeb
ab83e48ec4 Add pre-commit hooks (#1629) 2020-06-03 12:54:49 -07:00
George Hotz
b8571710e0 remove the clCreateProgramWithSource interceptor (#1559)
* remove the clCreateProgramWithSource interceptor

* that's old code, thneed is better

* label them thneed_, we shouldn't need to touch CL for anything not SNPE related
2020-05-24 03:33:36 -07:00
Comma Device
495e0c4648 wtf, how was that commented out and the tests still passed 2020-05-18 17:10:39 +00:00
George Hotz
78a352a8ca This isn't bigmodel, but there's a lot of good stuff here (#1532)
* bigmodel

* more debug print

* debugging bigmodel

* remove the tanh, debugging

* print images/buffers

* disassemble the command queues

* decompiler

* dump the shaders

* full disasm

* support patching kernel and fixing convolution_horizontal_reduced_reads_1x1

* microbenchmark

* 42 GFLOPS, 1 GB/s

* gemm benchmark

* 75 GFLOPS vs 42 GFLOPS

* 115 GFLOPS

* oops, never mind

* gemm image is slow

* this is pretty hopeless

* gemm image gets 62 GFLOPS

* this is addictive and still a waste of time

* cleanup cleanup

* that hook was dumb

* tabbing

* more tabbing

Co-authored-by: Comma Device <device@comma.ai>
2020-05-17 23:13:17 -07:00
George Hotz
302d06ee70 thneed saves 45% of a core (#1512)
* thneed runs the model

* thneed is doing the hooking

* set kernel args

* thneeding the bufferS

* print the images well

* thneeds with better buffers

* includes

* disasm adreno

* parse packets

* disasm works

* disasm better

* more thneeding

* much thneeding

* much more thneeding

* thneed works i think

* thneed is patient

* thneed works

* 7.7%

* gpuobj sync

* yay, it mallocs now

* cleaning it up, Thneed

* sync objs and set power

* thneed needs inputs and outputs

* thneed in modeld

* special modeld runs

* can't thneed the DSP

* test is weird

* thneed modeld uses 6.4% CPU

* add thneed to release

* move to debug

* delete some junk from the pr

* always track the timestamp

* timestamp hacks in thneed

* create a new command queue

* fix timestamp

* pretty much back to what we had, you can't use SNPE with thneed

* improve thneed test

* disable save log

Co-authored-by: Comma Device <device@comma.ai>
2020-05-15 13:53:01 -07:00