xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/CLEventImpl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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 // CLEventImpl.h: Defines the abstract rx::CLEventImpl class.
7 
8 #ifndef LIBANGLE_RENDERER_CLEVENTIMPL_H_
9 #define LIBANGLE_RENDERER_CLEVENTIMPL_H_
10 
11 #include "libANGLE/renderer/cl_types.h"
12 
13 namespace rx
14 {
15 
16 class CLEventImpl : angle::NonCopyable
17 {
18   public:
19     using Ptr        = std::unique_ptr<CLEventImpl>;
20     using CreateFunc = std::function<Ptr(const cl::Event &)>;
21 
22     CLEventImpl(const cl::Event &event);
23     virtual ~CLEventImpl();
24 
25     virtual angle::Result getCommandExecutionStatus(cl_int &executionStatus) = 0;
26 
27     virtual angle::Result setUserEventStatus(cl_int executionStatus) = 0;
28 
29     virtual angle::Result setCallback(cl::Event &event, cl_int commandExecCallbackType) = 0;
30 
31     virtual angle::Result getProfilingInfo(cl::ProfilingInfo name,
32                                            size_t valueSize,
33                                            void *value,
34                                            size_t *valueSizeRet) = 0;
35 
36   protected:
37     const cl::Event &mEvent;
38 };
39 
40 }  // namespace rx
41 
42 #endif  // LIBANGLE_RENDERER_CLEVENTIMPL_H_
43