MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CLDevice

Class CLDevice

tensorflow/lite/delegates/gpu/cl/cl_device.h:84–123  ·  view source on GitHub ↗

A wrapper around opencl device id

Source from the content-addressed store, hash-verified

82
83// A wrapper around opencl device id
84class CLDevice {
85 public:
86 CLDevice() = default;
87 CLDevice(cl_device_id id, cl_platform_id platform_id);
88
89 CLDevice(CLDevice&& device);
90 CLDevice& operator=(CLDevice&& device);
91 CLDevice(const CLDevice&);
92 CLDevice& operator=(const CLDevice&);
93
94 ~CLDevice() {}
95
96 cl_device_id id() const { return id_; }
97 cl_platform_id platform() const { return platform_id_; }
98 std::string GetPlatformVersion() const;
99
100 const DeviceInfo& GetInfo() const { return info_; }
101 const DeviceInfo* GetInfoPtr() const { return &info_; }
102
103 Vendor vendor() const { return info_.vendor; }
104 OpenCLVersion cl_version() const { return info_.cl_version; }
105 bool SupportsFP16() const;
106 bool SupportsTextureArray() const;
107 bool SupportsExtension(const std::string& extension) const;
108 bool IsAdreno() const;
109 bool IsAdreno3xx() const;
110 bool IsAdreno4xx() const;
111 bool IsAdreno5xx() const;
112 bool IsAdreno6xx() const;
113 bool IsAdreno6xxOrHigher() const;
114
115 // To track bug on some Adreno. b/131099086
116 bool SupportsOneLayerTextureArray() const;
117 void DisableOneLayerTextureArray();
118
119 private:
120 cl_device_id id_ = nullptr;
121 cl_platform_id platform_id_ = nullptr;
122 DeviceInfo info_;
123};
124
125Status CreateDefaultGPUDevice(CLDevice* result);
126

Callers 1

CreateDefaultGPUDeviceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected