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 std::string getSource(cl_int &errorCode) const = 0; 25 26 virtual cl_int build(const cl::DevicePtrs &devices, 27 const char *options, 28 cl::Program *notify) = 0; 29 30 virtual cl_int compile(const cl::DevicePtrs &devices, 31 const char *options, 32 const cl::ProgramPtrs &inputHeaders, 33 const char **headerIncludeNames, 34 cl::Program *notify) = 0; 35 36 virtual cl_int getInfo(cl::ProgramInfo name, 37 size_t valueSize, 38 void *value, 39 size_t *valueSizeRet) const = 0; 40 41 virtual cl_int getBuildInfo(const cl::Device &device, 42 cl::ProgramBuildInfo name, 43 size_t valueSize, 44 void *value, 45 size_t *valueSizeRet) const = 0; 46 47 virtual CLKernelImpl::Ptr createKernel(const cl::Kernel &kernel, 48 const char *name, 49 cl_int &errorCode) = 0; 50 51 virtual cl_int createKernels(cl_uint numKernels, 52 CLKernelImpl::CreateFuncs &createFuncs, 53 cl_uint *numKernelsRet) = 0; 54 55 protected: 56 const cl::Program &mProgram; 57 }; 58 59 } // namespace rx 60 61 #endif // LIBANGLE_RENDERER_CLPROGRAMIMPL_H_ 62