• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // CLProgramCL.h: Defines the class interface for CLProgramCL, implementing CLProgramImpl.
7 
8 #ifndef LIBANGLE_RENDERER_CL_CLPROGRAMCL_H_
9 #define LIBANGLE_RENDERER_CL_CLPROGRAMCL_H_
10 
11 #include "libANGLE/renderer/cl/cl_types.h"
12 
13 #include "libANGLE/renderer/CLProgramImpl.h"
14 
15 namespace rx
16 {
17 
18 class CLProgramCL : public CLProgramImpl
19 {
20   public:
21     CLProgramCL(const cl::Program &program, cl_program native);
22     ~CLProgramCL() override;
23 
24     cl_program getNative() const;
25 
26     std::string getSource(cl_int &errorCode) const override;
27 
28     cl_int build(const cl::DevicePtrs &devices, const char *options, cl::Program *notify) override;
29 
30     cl_int compile(const cl::DevicePtrs &devices,
31                    const char *options,
32                    const cl::ProgramPtrs &inputHeaders,
33                    const char **headerIncludeNames,
34                    cl::Program *notify) override;
35 
36     cl_int getInfo(cl::ProgramInfo name,
37                    size_t valueSize,
38                    void *value,
39                    size_t *valueSizeRet) const override;
40 
41     cl_int getBuildInfo(const cl::Device &device,
42                         cl::ProgramBuildInfo name,
43                         size_t valueSize,
44                         void *value,
45                         size_t *valueSizeRet) const override;
46 
47     CLKernelImpl::Ptr createKernel(const cl::Kernel &kernel,
48                                    const char *name,
49                                    cl_int &errorCode) override;
50 
51     cl_int createKernels(cl_uint numKernels,
52                          CLKernelImpl::CreateFuncs &createFuncs,
53                          cl_uint *numKernelsRet) override;
54 
55   private:
56     static void CL_CALLBACK Callback(cl_program program, void *userData);
57 
58     const cl_program mNative;
59 
60     friend class CLContextCL;
61 };
62 
getNative()63 inline cl_program CLProgramCL::getNative() const
64 {
65     return mNative;
66 }
67 
68 }  // namespace rx
69 
70 #endif  // LIBANGLE_RENDERER_CL_CLPROGRAMCL_H_
71