Remove va_arg
Closed this issue · 5 comments
The va_arg usage of the GxB get/set methods causes problems when porting to ARM64. See GraphBLAS/python-suitesparse-graphblas#50 for the problem and its solution.
Note that this isn't necessarily a problem with ARM64 as much as the cffi Python library. I'm not sure the degree to which SuiteSparse:GraphBLAS should change to accommodate packages not supporting the right calling conventions (IMO this is a cffi problem not a problem with python-graphblas).
ARM64 causes other problems as well (for instance it doesn't support so called "closure functions" implemented with trampolines that Julia uses), but SuiteSparse:GraphBLAS isn't the issue.
Got it. I only use va_arg in a few specific functions, though, and it wouldn't be too hard to add type-specific functions that avoid its use altogether.
Each of my va_arg is only variable in the type of a 3rd parameter, not the number of parameters. So instead of
GxB_Matrix_Option_set (GrB_Matrix A, GxB_Option_Field field, ... ) ;
where the "..." is always just one argument, I could add:
GxB_Matrix_Option_set_FP64 (GrB_Matrix A, GxB_Option_Field, double arg) ;
GxB_Matrix_Option_set_INT32 (GrB_Matrix A, GxB_Option_Field, int32_t arg) ;
and so on. I would keep the va_arg variants, and just add these type-specific ones. It would be easy to do ... just cause some API bloat.
The problem is that we want to support arbitrary types in the interface for GrB_set
and GrB_get
. The standard API could quickly become very bloated.
I suppose this might be better done as a void star at that point?
7.4.0 added non-variadic versions for get and set (with GxB methods). @DrTimothyAldenDavis, can this issue be closed?
Yes -- let's close it.