• 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 // CLDeviceCL.h: Defines the class interface for CLDeviceCL, implementing CLDeviceImpl.
7 
8 #ifndef LIBANGLE_RENDERER_CL_CLDEVICECL_H_
9 #define LIBANGLE_RENDERER_CL_CLDEVICECL_H_
10 
11 #include "libANGLE/renderer/CLDeviceImpl.h"
12 
13 namespace rx
14 {
15 
16 class CLDeviceCL : public CLDeviceImpl
17 {
18   public:
19     ~CLDeviceCL() override;
20 
21     cl_device_id getNative() const;
22 
23     Info createInfo(cl::DeviceType type) const override;
24 
25     cl_int getInfoUInt(cl::DeviceInfo name, cl_uint *value) const override;
26     cl_int getInfoULong(cl::DeviceInfo name, cl_ulong *value) const override;
27     cl_int getInfoSizeT(cl::DeviceInfo name, size_t *value) const override;
28     cl_int getInfoStringLength(cl::DeviceInfo name, size_t *value) const override;
29     cl_int getInfoString(cl::DeviceInfo name, size_t size, char *value) const override;
30 
31     cl_int createSubDevices(const cl_device_partition_property *properties,
32                             cl_uint numDevices,
33                             CreateFuncs &createFuncs,
34                             cl_uint *numDevicesRet) override;
35 
36   private:
37     CLDeviceCL(const cl::Device &device, cl_device_id native);
38 
39     const cl_device_id mNative;
40 
41     friend class CLPlatformCL;
42 };
43 
getNative()44 inline cl_device_id CLDeviceCL::getNative() const
45 {
46     return mNative;
47 }
48 
49 }  // namespace rx
50 
51 #endif  // LIBANGLE_RENDERER_CL_CLDEVICECL_H_
52