fixes, small improvements in functionality
This commit is contained in:
parent
490b7cd40a
commit
c757e51cb0
@ -264,6 +264,7 @@ cuda_eval( void )
|
||||
}
|
||||
out = YAP_MkPairTerm(YAP_MkApplTerm( f, ncols, vec ), out);
|
||||
}
|
||||
free( mat );
|
||||
return YAP_Unify(YAP_ARG2, out);
|
||||
}
|
||||
|
||||
@ -275,6 +276,7 @@ static int cuda_count( void )
|
||||
|
||||
if (n < 0)
|
||||
return FALSE;
|
||||
free( mat );
|
||||
return YAP_Unify(YAP_ARG2, YAP_MkIntTerm(n));
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,22 @@
|
||||
:- module(bdd, [cuda_extensional/2,
|
||||
cuda_rule/2,
|
||||
cuda_erase/1,
|
||||
cuda_eval/2,
|
||||
cuda_count/2]).
|
||||
:- module(cuda, [cuda_extensional/2,
|
||||
cuda_inline/2,
|
||||
cuda_rule/2,
|
||||
cuda_erase/1,
|
||||
cuda_eval/2,
|
||||
cuda_count/2]).
|
||||
|
||||
tell_warning :-
|
||||
print_message(warning,functionality(cuda)).
|
||||
|
||||
:- dynamic inline/2.
|
||||
|
||||
:- catch(load_foreign_files([cuda], [], init_cuda),_,fail) -> true ; tell_warning.
|
||||
|
||||
:- meta_predicate cudda_extensional(:,-).
|
||||
|
||||
cuda_inline(P, Q) :-
|
||||
assert(inline(P,Q)).
|
||||
|
||||
cuda_extensional( Call, IdFacts) :-
|
||||
strip_module(Call, Mod, Name/Arity),
|
||||
functor(S, Name, Arity),
|
||||
@ -27,6 +33,10 @@ cuda_rule((Head :- Body) , IdRules) :-
|
||||
body_to_list( (B1, B2), LF, L0, N0, NF) :- !,
|
||||
body_to_list( B1, LF, LI, N0, N1),
|
||||
body_to_list( B2, LI, L0, N1, NF).
|
||||
body_to_list( true, L, L, N, N) :- !.
|
||||
body_to_list( B, [NB|L], L, N0, N) :-
|
||||
inline( B, NB ), !,
|
||||
N is N0+1.
|
||||
body_to_list( B, [B|L], L, N0, N) :-
|
||||
N is N0+1.
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
#include <thrust/device_vector.h>
|
||||
#include "lista.h"
|
||||
@ -347,6 +346,9 @@ int cargafinal(int name, int cols, int **ptr)
|
||||
}
|
||||
cout << "select finala" << endl;*/
|
||||
|
||||
GPUmem.clear();
|
||||
CPUmem.clear();
|
||||
|
||||
*ptr = ini;
|
||||
return cont;
|
||||
}
|
||||
|
Reference in New Issue
Block a user