Skip to content

Commit

Permalink
(test5)
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Oct 17, 2023
1 parent 8f9de0e commit 3c7fb6e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Modules/OpenCLABC.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9145,8 +9145,9 @@ CLKernelArgPrivateCommon<TInp> = record
//TODO NVidia only
// - They have another incompatibility, where they don't return new event if input events had error
{$ifdef DEBUG}
var c: cl_context;
var ue := new UserEvent(c{$ifdef EventDebug}, $'Dummy instead of enq by {TypeName(q)}, waiting on: {ev_l2.evs?.JoinToString}'{$endif});
var ntv_c: cl_context;
cl.GetCommandQueueInfo_QUEUE_CONTEXT(cq, ntv_c).RaiseIfError;
var ue := new UserEvent(ntv_c{$ifdef EventDebug}, $'Dummy instead of enq by {TypeName(q)}, waiting on: {ev_l2.evs?.JoinToString}'{$endif});
ue.SetComplete(true);
Result.Item1 := ev_l2 + cl_event(ue);
{$endif DEBUG}
Expand Down Expand Up @@ -9217,11 +9218,11 @@ CLKernelArgPrivateCommon<TInp> = record

ev_l1.MultiAttachCallback(()->
begin
var (enq_ev, enq_act) := ExecuteEnqFunc(get_o(), cq, ev_l2, enq_f, l1_err_handler,l2_err_handler{$ifdef DEBUG}, err_test_reason{$endif DEBUG}{$ifdef EventDebug}, q{$endif});
var (enq_ev, post_enq_act) := ExecuteEnqFunc(get_o(), cq, ev_l2, enq_f, l1_err_handler,l2_err_handler{$ifdef DEBUG}, err_test_reason{$endif DEBUG}{$ifdef EventDebug}, q{$endif});
OpenCLABCInternalException.RaiseIfError( cl.Flush(cq) );
enq_ev.MultiAttachCallback(()->
begin
if (enq_act<>nil) and not l1_err_handler.HadError then enq_act(g.c);
if post_enq_act<>nil then post_enq_act(g.c);
g.ReturnCQ(cq);
res_ev.SetComplete(l2_err_handler.HadError);
end{$ifdef EventDebug}, $'propagating Enq ev of {TypeName(q)} to res_ev: {res_ev.uev}'{$endif});
Expand Down Expand Up @@ -9267,14 +9268,14 @@ CLKernelArgPrivateCommon<TInp> = record
o_const := prev_qr.IsConst;
end;

var (enq_ev, enq_act) := EnqueueableCore.Invoke(
var (enq_ev, post_enq_act) := EnqueueableCore.Invoke(
self.ExpectedEnqCount, o_const, get_o, g, l,
InvokeParams, ProcessError
{$ifdef DEBUG},self{$endif}
);

Result := new QueueResNil(enq_ev);
if enq_act<>nil then Result.AddAction(enq_act);
if post_enq_act<>nil then Result.AddAction(post_enq_act);
end;

end;
Expand Down Expand Up @@ -9479,7 +9480,7 @@ ExecCommandCLKernelCache = record
//TODO Надо ли "()->" перед arg_cache? Разница в том что:
// - Без "()->" его будет читать прямо перед вызовом InvokeParams
// - А сейчас его считает аж в EnqFunc<cl_kernel>
var (enq_ev, enq_act) := EnqueueableCore.Invoke(
var (enq_ev, post_enq_act) := EnqueueableCore.Invoke(
self.ExpectedEnqCount+args_non_const_c, k_const, get_k_ntv, g, l,
(enq_c, o_const, g, enq_evs)->
InvokeParams(enq_c, o_const, g, enq_evs, ()->arg_cache),
Expand All @@ -9488,7 +9489,7 @@ ExecCommandCLKernelCache = record
);

Result := new QueueResNil(enq_ev);
if enq_act<>nil then Result.AddAction(enq_act);
if post_enq_act<>nil then Result.AddAction(post_enq_act);
end;

protected procedure Finalize; override :=
Expand Down Expand Up @@ -9524,7 +9525,7 @@ ExecCommandCLKernelCache = record
var inp_const := prev_qr.IsConst;
l := prev_qr.TakeBaseOut;

var (enq_ev, enq_act) := EnqueueableCore.Invoke(
var (enq_ev, post_enq_act) := EnqueueableCore.Invoke(
self.ExpectedEnqCount, inp_const, prev_qr.GetResDirect, g, l,
(enq_c, o_const, g, enq_evs)->
InvokeParams(enq_c, o_const, g, enq_evs, qr),
Expand All @@ -9533,7 +9534,7 @@ ExecCommandCLKernelCache = record
);

Result := new CLTaskLocalData(enq_ev);
if enq_act<>nil then Result.prev_delegate.AddAction(enq_act);
if post_enq_act<>nil then Result.prev_delegate.AddAction(post_enq_act);
end);
end;

Expand Down

0 comments on commit 3c7fb6e

Please sign in to comment.