mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-19 00:02:08 +08:00
95051090a1
* 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 old-commit-hash: c9f00678af17dc75b9e56a968c4357704e40c901
22 lines
517 B
C++
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];
|
|
};
|