xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/CLProgramImpl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2021 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // CLProgramImpl.h: Defines the abstract rx::CLProgramImpl class.
7 
8 #ifndef LIBANGLE_RENDERER_CLPROGRAMIMPL_H_
9 #define LIBANGLE_RENDERER_CLPROGRAMIMPL_H_
10 
11 #include "libANGLE/renderer/CLKernelImpl.h"
12 
13 namespace rx
14 {
15 
16 class CLProgramImpl : angle::NonCopyable
17 {
18   public:
19     using Ptr = std::unique_ptr<CLProgramImpl>;
20 
21     CLProgramImpl(const cl::Program &program);
22     virtual ~CLProgramImpl();
23 
24     virtual angle::Result build(const cl::DevicePtrs &devices,
25                                 const char *options,
26                                 cl::Program *notify) = 0;
27 
28     virtual angle::Result compile(const cl::DevicePtrs &devices,
29                                   const char *options,
30                                   const cl::ProgramPtrs &inputHeaders,
31                                   const char **headerIncludeNames,
32                                   cl::Program *notify) = 0;
33 
34     virtual angle::Result getInfo(cl::ProgramInfo name,
35                                   size_t valueSize,
36                                   void *value,
37                                   size_t *valueSizeRet) const = 0;
38 
39     virtual angle::Result getBuildInfo(const cl::Device &device,
40                                        cl::ProgramBuildInfo name,
41                                        size_t valueSize,
42                                        void *value,
43                                        size_t *valueSizeRet) const = 0;
44 
45     virtual angle::Result createKernel(const cl::Kernel &kernel,
46                                        const char *name,
47                                        CLKernelImpl::Ptr *kernelOut) = 0;
48 
49     virtual angle::Result createKernels(cl_uint numKernels,
50                                         CLKernelImpl::CreateFuncs &createFuncs,
51                                         cl_uint *numKernelsRet) = 0;
52 
53   protected:
54     const cl::Program &mProgram;
55 };
56 
57 }  // namespace rx
58 
59 #endif  // LIBANGLE_RENDERER_CLPROGRAMIMPL_H_
60