This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/cuda/test.yap

45 lines
715 B
Plaintext
Raw Normal View History

2013-10-04 13:22:00 +01:00
:- use_module(library(cuda)).
2013-10-07 13:48:19 +01:00
:- use_module(library(lists)).
2013-10-04 13:22:00 +01:00
:- initialization(main).
main :-
2013-10-07 13:48:19 +01:00
Rule = ( db(Y, Z), db(X, Z), db(1, Z), X = Y ),
setof(a(X,Y), Z^Rule, L0), reverse(L0, RL0), writeln(RL0),
cuda_rule((a(X, Y) :- Rule ), Q),
cuda_eval(Q, L),
cuda_erase( Q ),
2013-10-07 12:38:08 +01:00
writeln(L).
2013-10-04 13:22:00 +01:00
2013-10-07 18:34:29 +01:00
main2 :-
Rule = ( db(Y, Z), db(X, Z), db(1, Z), X \= Y ),
setof(a(X,Y), Z^Rule, L0), reverse(L0, RL0), writeln(RL0),
cuda_rule((a(X, Y) :- Rule ), Q),
cuda_eval(Q, L),
cuda_erase( Q ),
writeln(L).
2013-10-04 13:22:00 +01:00
db(1,a).
db(2,a).
db(5,b).
db(4,q).
db(6,w).
db(10,s).
2013-10-07 13:48:19 +01:00
/*
db(11,a).
db(12,a).
db(15,b).
db(14,q).
db(16,w).
db(110,s).
db(21,a).
db(22,a).
db(25,b).
db(24,q).
db(26,w).
db(210,s).
*/
:- cuda_extensional(db/2, _X).