• 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 // CLEventCL.h: Defines the class interface for CLEventCL, implementing CLEventImpl.
7 
8 #ifndef LIBANGLE_RENDERER_CL_CLEVENTCL_H_
9 #define LIBANGLE_RENDERER_CL_CLEVENTCL_H_
10 
11 #include "libANGLE/renderer/cl/cl_types.h"
12 
13 #include "libANGLE/renderer/CLEventImpl.h"
14 
15 namespace rx
16 {
17 
18 class CLEventCL : public CLEventImpl
19 {
20   public:
21     CLEventCL(const cl::Event &event, cl_event native);
22     ~CLEventCL() override;
23 
24     cl_event getNative() const;
25 
26     angle::Result onEventCreate() override;
27 
28     angle::Result getCommandExecutionStatus(cl_int &executionStatus) override;
29 
30     angle::Result setUserEventStatus(cl_int executionStatus) override;
31 
32     angle::Result setCallback(cl::Event &event, cl_int commandExecCallbackType) override;
33 
34     angle::Result getProfilingInfo(cl::ProfilingInfo name,
35                                    size_t valueSize,
36                                    void *value,
37                                    size_t *valueSizeRet) override;
38 
39     static std::vector<cl_event> Cast(const cl::EventPtrs &events);
40 
41   private:
42     static void CL_CALLBACK Callback(cl_event event, cl_int commandStatus, void *userData);
43 
44     const cl_event mNative;
45 };
46 
getNative()47 inline cl_event CLEventCL::getNative() const
48 {
49     return mNative;
50 }
51 
52 }  // namespace rx
53 
54 #endif  // LIBANGLE_RENDERER_CL_CLEVENTCL_H_
55