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 // CLPlatformCL.h: Defines the class interface for CLPlatformCL, implementing CLPlatformImpl. 7 8 #ifndef LIBANGLE_RENDERER_CL_CLPLATFORMCL_H_ 9 #define LIBANGLE_RENDERER_CL_CLPLATFORMCL_H_ 10 11 #include "libANGLE/renderer/CLPlatformImpl.h" 12 13 namespace rx 14 { 15 16 class CLPlatformCL : public CLPlatformImpl 17 { 18 public: 19 ~CLPlatformCL() override; 20 21 cl_platform_id getNative() const; 22 23 Info createInfo() const override; 24 CLDeviceImpl::CreateDatas createDevices() const override; 25 26 CLContextImpl::Ptr createContext(cl::Context &context, 27 const cl::DevicePtrs &devices, 28 bool userSync, 29 cl_int &errorCode) override; 30 31 CLContextImpl::Ptr createContextFromType(cl::Context &context, 32 cl::DeviceType deviceType, 33 bool userSync, 34 cl_int &errorCode) override; 35 36 cl_int unloadCompiler() override; 37 38 static void Initialize(CreateFuncs &createFuncs, bool isIcd); 39 40 private: 41 CLPlatformCL(const cl::Platform &platform, cl_platform_id native); 42 43 const cl_platform_id mNative; 44 45 friend class CLContextCL; 46 }; 47 getNative()48inline cl_platform_id CLPlatformCL::getNative() const 49 { 50 return mNative; 51 } 52 53 } // namespace rx 54 55 #endif // LIBANGLE_RENDERER_CL_CLPLATFORMCL_H_ 56