MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CLContext

Class CLContext

tensorflow/lite/delegates/gpu/cl/cl_context.h:29–51  ·  view source on GitHub ↗

A RAII wrapper around opencl context

Source from the content-addressed store, hash-verified

27
28// A RAII wrapper around opencl context
29class CLContext {
30 public:
31 CLContext() {}
32 explicit CLContext(cl_context context);
33
34 // Move only
35 CLContext(CLContext&& context);
36 CLContext& operator=(CLContext&& context);
37 CLContext(const CLContext&) = delete;
38 CLContext& operator=(const CLContext&) = delete;
39
40 ~CLContext();
41
42 cl_context context() const { return context_; }
43
44 bool IsFloatTexture2DSupported(int num_channels, DataType data_type,
45 cl_mem_flags flags = CL_MEM_READ_WRITE) const;
46
47 private:
48 void Release();
49
50 cl_context context_ = nullptr;
51};
52
53Status CreateCLContext(const CLDevice& device, CLContext* result);
54Status CreateCLGLContext(const CLDevice& device,

Callers 1

CreateCLContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected