载入中...
搜索中...
未找到
GpuBackend.h
浏览该文件的文档.
1#ifndef EVE_TENSOR_GPUBACKEND_H
2#define EVE_TENSOR_GPUBACKEND_H
3
4#include <vector>
5
6namespace eve::tensor {
7
8class Graph;
9struct OptimizedGraph;
10
27public:
29
30 static GpuProgram *tryBuild(const Graph &graph, const OptimizedGraph &opt, int outputNode);
31
33 std::vector<float> run(const std::vector<const float *> &feeds) const;
34
35private:
36 GpuProgram();
37 GpuProgram(const GpuProgram &) = delete;
38 GpuProgram &operator=(const GpuProgram &) = delete;
39
40 struct Impl;
41 Impl *impl_ = nullptr;
42};
43
49bool gpuReduce(const float *data, int size, int op, float &outResult);
50
51} // namespace eve::tensor
52
53#endif // EVE_TENSOR_GPUBACKEND_H
const Graph & graph
Light2D::Data * data
GPU execution of a compiled tensor Graph via generated compute shaders.
Definition GpuBackend.h:26
std::vector< float > run(const std::vector< const float * > &feeds) const
feeds[slot] must point to placeholderSize(slot) floats. Returns the output buffer.
static GpuProgram * tryBuild(const Graph &graph, const OptimizedGraph &opt, int outputNode)
bool gpuReduce(const float *data, int size, int op, float &outResult)
GPU-accelerated reduction for large eager tensors. op: 0 = sum, 1 = min, 2 = max. Returns false (call...