make user functions return bool

This commit is contained in:
Vítor Santos Costa
2015-02-03 02:37:25 +00:00
parent 5a668febd9
commit 2f621e5b47
14 changed files with 111 additions and 89 deletions

View File

@@ -1,8 +1,10 @@
#CHECK: CUDA
macro_optional_find_package (CUDA ON)
macro_log_feature (CUDA_FOUND "CUDA"
"CUDA GGPU Programming "
macro_log_feature (CUDA_FOUND "CUDA"
"CUDA GGPU Programming "
"http://www.r.org" FALSE)
if (CUDA_FOUND)
# CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
# CUDA_VERSION_MINOR -- The minor version.
@@ -51,4 +53,3 @@ if (CUDA_FOUND)
endif (CUDA_FOUND)

View File

@@ -23,7 +23,7 @@ CC=@CC@
NVCC=@NVCC@
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include @CUDA_CPPFLAGS@
NVCCFLAGS=@CUDA_CPPFLAGS@ -I$(srcdir) -I../.. -I$(srcdir)/../../include
LDFLAGS=@LDFLAGS@
CUDA_LDFLAGS=@CUDA_LDFLAGS@
#
#
# You shouldn't need to change what follows.

View File

@@ -24,7 +24,7 @@ else
PKG_CUDA="packages/cuda"
case "$target_os" in
*darwin*)
CUDA_LDFLAGS="$LDFLAGS"
CUDA_LDFLAGS="$LDFLAGS $LIBS"
CUDA_CPPFLAGS="-arch=sm_20 -Xcompiler -fPIC -O3 "
CUDA_SHLIB_LD="$NVCC --shared -L../.. -lYap "
;;

View File

@@ -115,7 +115,7 @@ int32_t Cuda_Erase(predicate *pe)
return TRUE;
}
static int
static YAP_Bool
load_facts( void ) {
int32_t nrows = YAP_IntOfTerm(YAP_ARG1);
@@ -164,7 +164,7 @@ load_facts( void ) {
static int currentFact = 0;
static predicate *currentPred = NULL;
static int
static YAP_Bool
cuda_init_facts( void ) {
int32_t nrows = YAP_IntOfTerm(YAP_ARG1);
@@ -198,7 +198,7 @@ cuda_init_facts( void ) {
}
}
static int
static YAP_Bool
cuda_load_fact( void ) {
YAP_Term th = YAP_ARG1;
@@ -225,7 +225,7 @@ cuda_load_fact( void ) {
return TRUE;
}
static int
static YAP_Bool
load_rule( void ) {
// maximum of 2K symbols per rule, should be enough for ILP
int32_t vec[2048], *ptr = vec, *nvec;
@@ -303,14 +303,14 @@ load_rule( void ) {
return YAP_Unify(YAP_ARG4, YAP_MkIntTerm((YAP_Int)pred));
}
static int
static YAP_Bool
cuda_erase( void )
{
predicate *ptr = (predicate *)YAP_IntOfTerm(YAP_ARG1);
return Cuda_Erase( ptr );
}
static int
static YAP_Bool
cuda_eval( void )
{
int32_t *mat;
@@ -336,7 +336,7 @@ cuda_eval( void )
return YAP_Unify(YAP_ARG2, out);
}
static int
static YAP_Bool
cuda_coverage( void )
{
int32_t *mat;
@@ -384,7 +384,7 @@ cuda_coverage( void )
} while ( TRUE );
}
static int cuda_count( void )
static YAP_Bool cuda_count( void )
{
int32_t *mat;
predicate *ptr = (predicate *)YAP_IntOfTerm(YAP_ARG1);
@@ -396,7 +396,7 @@ static int cuda_count( void )
return YAP_Unify(YAP_ARG2, YAP_MkIntTerm(n));
}
static int cuda_statistics( void )
static YAP_Bool cuda_statistics( void )
{
Cuda_Statistics();
return TRUE;