Files
dragonpilot/selfdrive/modeld/runners/onnxmodel.h
Mitchell Goff c9f00678af Refactor model runners (#28598)
* Started work on model runner refactor

* Fixed some compile errors

* everything compiles

* Fixed bug in SNPEModel

* updateInput -> setInputBuffer

* I understand nothing

* whoops lol

* use std::string instead of char*

* Move common logic into RunModel

* formatting fix
2023-07-06 22:26:11 -07:00

22 lines
517 B
C++

#pragma once
#include "selfdrive/modeld/runners/runmodel.h"
class ONNXModel : public RunModel {
public:
ONNXModel(const std::string path, float *output, size_t output_size, int runtime, bool _use_tf8 = false, cl_context context = NULL);
~ONNXModel();
void execute();
private:
int proc_pid;
float *output;
size_t output_size;
bool use_tf8;
// pipe to communicate to onnx_runner subprocess
void pread(float *buf, int size);
void pwrite(float *buf, int size);
int pipein[2];
int pipeout[2];
};