-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
135 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## uses OpenCLABC; | ||
|
||
var C := CQ(5); | ||
|
||
CLContext.Default.SyncInvoke( | ||
CombineConvAsyncQueue(a->a, |C,C.ThenConvert(x->x*x, false)|, false).Print | ||
## uses OpenCLABC; | ||
|
||
var C := CQ(5); | ||
|
||
CLContext.Default.SyncInvoke( | ||
CombineConvAsyncQueue(a->a, |C,C.ThenConvert(x->x*x, false)|, false).Print | ||
).Println; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
## uses OpenCLABC; | ||
|
||
var P := new ParameterQueue<integer>('P'); | ||
|
||
CLContext.Default.SyncInvoke( | ||
CombineConvAsyncQueue(a->a, |P,P.ThenConvert(x->x*x, false)|, false), | ||
## uses OpenCLABC; | ||
|
||
var P := new ParameterQueue<integer>('P'); | ||
|
||
CLContext.Default.SyncInvoke( | ||
CombineConvAsyncQueue(a->a, |P,P.ThenConvert(x->x*x, false)|, false), | ||
P.NewSetter(5)).Println; |
50 changes: 25 additions & 25 deletions
50
Tests/Exec/CLABC/02#Выполнение очередей/04#ThenConvert/ThenConvUse_ConstDelayedFunc.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
## uses OpenCLABC; | ||
|
||
procedure Test(q: CommandQueue<integer>); | ||
begin | ||
q.Print; | ||
|
||
('-'*30).Println; | ||
CLContext.Default.SyncInvoke(q | ||
.ThenUse(x->Println(x)) | ||
.ThenConvert(x->(x*x).Println) | ||
.ThenUse(x->Println(x)) | ||
); | ||
|
||
('-'*30).Println; | ||
CLContext.Default.SyncInvoke(q | ||
.ThenUse(x->Println(x), false) | ||
.ThenConvert(x->(x*x).Println, false) | ||
.ThenUse(x->Println(x+1), false) | ||
); | ||
|
||
('='*30).Println; | ||
end; | ||
|
||
Test(2); | ||
Test(HFQ(()->3)); | ||
## uses OpenCLABC; | ||
|
||
procedure Test(q: CommandQueue<integer>); | ||
begin | ||
q.Print; | ||
|
||
('-'*30).Println; | ||
CLContext.Default.SyncInvoke(q | ||
.ThenUse(x->Println(x)) | ||
.ThenConvert(x->(x*x).Println) | ||
.ThenUse(x->Println(x)) | ||
); | ||
|
||
('-'*30).Println; | ||
CLContext.Default.SyncInvoke(q | ||
.ThenUse(x->Println(x), false) | ||
.ThenConvert(x->(x*x).Println, false) | ||
.ThenUse(x->Println(x+1), false) | ||
); | ||
|
||
('='*30).Println; | ||
end; | ||
|
||
Test(2); | ||
Test(HFQ(()->3)); | ||
Test(HFQ(()->4 as object).Cast&<integer>); |
18 changes: 9 additions & 9 deletions
18
Tests/Exec/CLABC/02#Выполнение очередей/05#Multiusable/discard single res.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
## uses OpenCLABC; | ||
|
||
var Q := HFQ(()->123).Multiusable; | ||
CLContext.Default.SyncInvoke( | ||
Q.DiscardResult | ||
// CombineConvAsyncQueueN2((a,b)->(a,b), Q, Q, false) | ||
// Q*Q | ||
// Q.ThenUse(x->Println(x), false)*Q | ||
);//.Println; | ||
## uses OpenCLABC; | ||
|
||
var Q := HFQ(()->123).Multiusable; | ||
CLContext.Default.SyncInvoke( | ||
Q.DiscardResult | ||
// CombineConvAsyncQueueN2((a,b)->(a,b), Q, Q, false) | ||
// Q*Q | ||
// Q.ThenUse(x->Println(x), false)*Q | ||
);//.Println; | ||
//EventDebug.ReportEventLogs; |
18 changes: 9 additions & 9 deletions
18
Tests/Exec/CLABC/02#Выполнение очередей/05#Multiusable/prev mu check.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
## uses OpenCLABC; | ||
|
||
var wh := new System.Threading.ManualResetEventSlim(false); | ||
var Q := (HPQ(wh.Wait)+HFQ(()->123)).Multiusable; | ||
var t := CLContext.Default.BeginInvoke( | ||
Q * | ||
Q.ThenUse(x->Println(x)) | ||
); | ||
wh.Set; | ||
## uses OpenCLABC; | ||
|
||
var wh := new System.Threading.ManualResetEventSlim(false); | ||
var Q := (HPQ(wh.Wait)+HFQ(()->123)).Multiusable; | ||
var t := CLContext.Default.BeginInvoke( | ||
Q * | ||
Q.ThenUse(x->Println(x)) | ||
); | ||
wh.Set; | ||
t.Wait; |
6 changes: 3 additions & 3 deletions
6
Tests/Exec/CLABC/02#Выполнение очередей/05#Multiusable/~07#HostExec/Quick+MU.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## uses OpenCLABC; | ||
|
||
var Q := HFQ(()->(1).Println+1, false).Multiusable; | ||
## uses OpenCLABC; | ||
|
||
var Q := HFQ(()->(1).Println+1, false).Multiusable; | ||
CLContext.Default.SyncInvoke(CombineConvSyncQueue(a->a, |Q,Q|, false,true).Println).Println; |
46 changes: 23 additions & 23 deletions
46
Tests/Exec/CLABC/02#Выполнение очередей/07#GPUCommandContainer/enq cancel.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
## uses OpenCLABC; | ||
|
||
var a := new CLArray<integer>(1); | ||
var wh := new System.Threading.ManualResetEventSlim(false); | ||
CLContext.Default.SyncInvoke( | ||
( | ||
HPQ(()-> | ||
begin | ||
wh.Wait; | ||
$'HPQ+1'.Println; | ||
raise new Exception('TestOK+1'); | ||
end) + | ||
CQ(a) | ||
).MakeCCQ.ThenWriteValue(0, HFQ(()-> | ||
begin | ||
Result := 0; | ||
$'HFQ+2'.Println; | ||
wh.Set; | ||
raise new Exception('TestOK+2'); | ||
end)) | ||
.HandleWithoutRes(e->e.Message.Println <> nil) | ||
); | ||
a.Dispose; | ||
## uses OpenCLABC; | ||
|
||
var a := new CLArray<integer>(1); | ||
var wh := new System.Threading.ManualResetEventSlim(false); | ||
CLContext.Default.SyncInvoke( | ||
( | ||
HPQ(()-> | ||
begin | ||
wh.Wait; | ||
$'HPQ+1'.Println; | ||
raise new Exception('TestOK+1'); | ||
end) + | ||
CQ(a) | ||
).MakeCCQ.ThenWriteValue(0, HFQ(()-> | ||
begin | ||
Result := 0; | ||
$'HFQ+2'.Println; | ||
wh.Set; | ||
raise new Exception('TestOK+2'); | ||
end)) | ||
.HandleWithoutRes(e->e.Message.Println <> nil) | ||
); | ||
a.Dispose; | ||
$'Expect 3 evs: HPQ + HFQ + async enq'.Println; |
20 changes: 10 additions & 10 deletions
20
Tests/Exec/CLABC/02#Выполнение очередей/07#GPUCommandContainer/enq err storage.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
## uses OpenCLABC; | ||
|
||
var a := new CLArray<integer>(1); | ||
var wh := new System.Threading.ManualResetEventSlim(false); | ||
var t := CLContext.Default.BeginInvoke( | ||
(HPQ(wh.Wait) + CQ(a)).MakeCCQ.ThenWriteArray(HFQ(()->nil as array of integer, false)) | ||
.HandleWithoutRes(e->TypeName(e).Println <> nil) | ||
); | ||
wh.Set; | ||
t.Wait; | ||
## uses OpenCLABC; | ||
|
||
var a := new CLArray<integer>(1); | ||
var wh := new System.Threading.ManualResetEventSlim(false); | ||
var t := CLContext.Default.BeginInvoke( | ||
(HPQ(wh.Wait) + CQ(a)).MakeCCQ.ThenWriteArray(HFQ(()->nil as array of integer, false)) | ||
.HandleWithoutRes(e->TypeName(e).Println <> nil) | ||
); | ||
wh.Set; | ||
t.Wait; | ||
a.Dispose; |
16 changes: 8 additions & 8 deletions
16
Tests/Exec/CLABC/02#Выполнение очередей/07#GPUCommandContainer/~00#Err/LazyQuickErr.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
## uses OpenCLABC; | ||
|
||
CLContext.Default.SyncInvoke( | ||
CLMemoryCCQ.Create(HFQ(()->new CLMemory(1))).ThenWriteArray1(HFQ(()-> | ||
begin | ||
Result := new byte[0]; | ||
raise new Exception('TestOK'); | ||
end, false)) | ||
## uses OpenCLABC; | ||
|
||
CLContext.Default.SyncInvoke( | ||
CLMemoryCCQ.Create(HFQ(()->new CLMemory(1))).ThenWriteArray1(HFQ(()-> | ||
begin | ||
Result := new byte[0]; | ||
raise new Exception('TestOK'); | ||
end, false)) | ||
); |
14 changes: 7 additions & 7 deletions
14
Tests/Exec/CLABC/02#Выполнение очередей/08#HostExec/~00#Err/insta err.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
## uses OpenCLABC; | ||
|
||
CLContext.Default.SyncInvoke( | ||
( | ||
HPQ(()->raise new Exception('TestOK'), need_own_thread:=false) + | ||
HPQ(()->raise new Exception('TestError'), need_own_thread:=false) | ||
).HandleWithoutRes(e->e.Message.Println <> nil) | ||
## uses OpenCLABC; | ||
|
||
CLContext.Default.SyncInvoke( | ||
( | ||
HPQ(()->raise new Exception('TestOK'), need_own_thread:=false) + | ||
HPQ(()->raise new Exception('TestError'), need_own_thread:=false) | ||
).HandleWithoutRes(e->e.Message.Println <> nil) | ||
); |
34 changes: 17 additions & 17 deletions
34
Tests/Exec/CLABC/02#Выполнение очередей/08#HostExec/~05#Wait/QuickUse.ThenWait.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
## uses OpenCLABC; | ||
|
||
var M := WaitMarker.Create; | ||
|
||
var mre := new System.Threading.ManualResetEventSlim(false); | ||
CLContext.Default.SyncInvoke( | ||
HPQ(()-> | ||
begin | ||
mre.Wait; | ||
'M'.Println; | ||
M.SendSignal; | ||
end) * | ||
HFQ(()->5).ThenUse(x-> | ||
begin | ||
$'/\{x}/\'.Println; | ||
mre.Set; | ||
end, false).ThenWaitFor(M) | ||
## uses OpenCLABC; | ||
|
||
var M := WaitMarker.Create; | ||
|
||
var mre := new System.Threading.ManualResetEventSlim(false); | ||
CLContext.Default.SyncInvoke( | ||
HPQ(()-> | ||
begin | ||
mre.Wait; | ||
'M'.Println; | ||
M.SendSignal; | ||
end) * | ||
HFQ(()->5).ThenUse(x-> | ||
begin | ||
$'/\{x}/\'.Println; | ||
mre.Set; | ||
end, false).ThenWaitFor(M) | ||
).Println; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## uses OpenCLABC; | ||
|
||
Write(new ParameterQueue<byte>('P1', 1)); | ||
## uses OpenCLABC; | ||
|
||
Write(new ParameterQueue<byte>('P1', 1)); | ||
Write(new ParameterQueue<object>('P2', 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## uses OpenCLABC; | ||
|
||
## uses OpenCLABC; | ||
|
||
HPQ(()->begin end).Cast&<Exception>.Print; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
## uses OpenCLABC; | ||
|
||
var Q := HFQ(()->1); | ||
|
||
(Q >= Q).Println; | ||
Q.HandleWithoutRes(e->true).Println; | ||
Q.HandleDefaultRes(e->true, 2).Println; | ||
## uses OpenCLABC; | ||
|
||
var Q := HFQ(()->1); | ||
|
||
(Q >= Q).Println; | ||
Q.HandleWithoutRes(e->true).Println; | ||
Q.HandleDefaultRes(e->true, 2).Println; | ||
Q.HandleReplaceRes(lst->3).Println; |