mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-12 04:42:13 +08:00
206b6abe7d
* 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> old-commit-hash: 302d06ee709cb65dba39e836917f5693f0819efb
51 lines
951 B
C++
51 lines
951 B
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include "include/msm_kgsl.h"
|
|
#include <vector>
|
|
#include <CL/cl.h>
|
|
|
|
class Thneed;
|
|
|
|
class GPUMalloc {
|
|
public:
|
|
GPUMalloc(int size, int fd);
|
|
void *alloc(int size);
|
|
private:
|
|
uint64_t base;
|
|
int remaining;
|
|
};
|
|
|
|
class CachedCommand {
|
|
public:
|
|
CachedCommand(Thneed *lthneed, struct kgsl_gpu_command *cmd);
|
|
void exec(bool wait);
|
|
private:
|
|
struct kgsl_gpu_command cache;
|
|
struct kgsl_command_object cmds[2];
|
|
struct kgsl_command_object objs[1];
|
|
Thneed *thneed;
|
|
};
|
|
|
|
class Thneed {
|
|
public:
|
|
Thneed();
|
|
void stop();
|
|
void execute(float **finputs, float *foutput);
|
|
|
|
std::vector<cl_mem> inputs;
|
|
cl_mem output;
|
|
|
|
cl_command_queue command_queue;
|
|
int context_id;
|
|
|
|
// protected?
|
|
int record;
|
|
int timestamp;
|
|
GPUMalloc *ram;
|
|
std::vector<CachedCommand *> cmds;
|
|
std::vector<std::pair<int, struct kgsl_gpuobj_sync_obj *> > syncobjs;
|
|
int fd;
|
|
};
|
|
|