event::event(clover::context &ctx, const ref_vector<event> &deps,
action action_ok, action action_fail) :
- context(ctx), _status(0), wait_count(1),
+ context(ctx), wait_count(1), _status(0),
action_ok(action_ok), action_fail(action_fail) {
for (auto &ev : deps)
ev.chain(*this);
return !wait_count;
}
+cl_int
+event::status() const {
+ return _status;
+}
+
void
event::chain(event &ev) {
if (wait_count) {
hard_event::status() const {
pipe_screen *screen = queue()->device().pipe;
- if (_status < 0)
- return _status;
+ if (event::status() < 0)
+ return event::status();
else if (!_fence)
return CL_QUEUED;
cl_int
soft_event::status() const {
- if (_status < 0)
- return _status;
+ if (event::status() < 0)
+ return event::status();
else if (!signalled() ||
any_of([](const event &ev) {
void abort(cl_int status);
bool signalled() const;
- virtual cl_int status() const = 0;
+ virtual cl_int status() const;
virtual command_queue *queue() const = 0;
virtual cl_command_type command() const = 0;
virtual void wait() const;
protected:
void chain(event &ev);
- cl_int _status;
std::vector<intrusive_ref<event>> deps;
private:
std::vector<intrusive_ref<event>> abort_self(cl_int status);
unsigned wait_count;
+ cl_int _status;
action action_ok;
action action_fail;
std::vector<intrusive_ref<event>> _chain;