• 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     cl_int getCommandExecutionStatus(cl_int &executionStatus) override;
27 
28     cl_int setUserEventStatus(cl_int executionStatus) override;
29 
30     cl_int setCallback(cl::Event &event, cl_int commandExecCallbackType) override;
31 
32     cl_int getProfilingInfo(cl::ProfilingInfo name,
33                             size_t valueSize,
34                             void *value,
35                             size_t *valueSizeRet) override;
36 
37     static std::vector<cl_event> Cast(const cl::EventPtrs &events);
38 
39   private:
40     static void CL_CALLBACK Callback(cl_event event, cl_int commandStatus, void *userData);
41 
42     const cl_event mNative;
43 };
44 
getNative()45 inline cl_event CLEventCL::getNative() const
46 {
47     return mNative;
48 }
49 
50 }  // namespace rx
51 
52 #endif  // LIBANGLE_RENDERER_CL_CLEVENTCL_H_
53