Just playing with this now to make suggestions using cuckatoo/mean.cpp, intended for discussion at the moment.
Add an atomic bool and a stop_solver() function, that should allow callers to interrupt the solver process and exit cleanly (after building a new block, for instance). All solvers would need to check for SHOULD_STOP in appropriate places and return.
Add a CALL_CONVENTION definition to prepend where exposure to callers is required
Definition that squashes all printf output when set
Split a run_solver function away from main, so linkers have something to link to directly
Create a ParamMap class and use that to pass in user-configurable parameters to the solver. The ParamMap class can expose functions that allow it to be manipulated. (So rust ffi can just hold an opaque reference to a param map and call functions on it directly).
I'd hope with this in place, changes to solver functionality would be minimal (except for the need to incorporate the SHOULD_STOP variable).
Still need to think about:
How to return statistics for each device to the caller, particularly CUDA. I think it's desirable to use each solver as intended, passing in a range and let the solver mutate the header (instead of doing it beforehand and passing in range=1 each time), but this won't work very well unless there's a way to return device-specific statistics to the caller about what's going on.
Device the best way of returning solutions to the caller.
Just playing with this now to make suggestions using cuckatoo/mean.cpp, intended for discussion at the moment.
I'd hope with this in place, changes to solver functionality would be minimal (except for the need to incorporate the SHOULD_STOP variable).
Still need to think about: