1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#include "GB_cuda.hpp"
bool GB_cuda_apply_binop_branch
(
const GrB_Type ctype,
const GrB_BinaryOp op,
const GrB_Matrix A
)
{
int jit_control = GB_jitifyer_get_control ( ) ;
if (jit_control <= GxB_JIT_PAUSE)
{
// JIT is off or paused
return (false) ;
}
if (op == NULL || op->hash == UINT64_MAX)
{
return false ;
}
if (A->header_size == 0)
{
return false ;
}
bool ok = GB_cuda_type_branch (ctype) && GB_cuda_type_branch (A->type) ;
if (op->xtype != NULL)
{
ok = ok && GB_cuda_type_branch (op->xtype) ;
}
if (op->ytype != NULL)
{
ok = ok && GB_cuda_type_branch (op->ytype) ;
}
if (op->ztype != NULL)
{
ok = ok && GB_cuda_type_branch (op->ztype) ;
}
double work = GB_nnz_held (A) ;
int gpu_count = GB_ngpus_to_use (work) ;
ok = ok && (gpu_count > 0);
return (ok) ;
}
|