decred / gominer

Go (golang) based GPU miner for Decred.
GNU General Public License v3.0
160 stars 80 forks source link

remove code duplication/improve build system #107

Open jolan opened 7 years ago

jolan commented 7 years ago

A lot of code is duplicated between cladldevice.go/cldevice.go/cudevice.go to work around having hard run-time dependencies on libraries. Should be able to reduce this somehow.

jolan commented 7 years ago

Might be able to eventually use the plugin support that landed in go tip:

https://tip.golang.org/pkg/plugin/

jolan commented 6 years ago

The Go plugin stuff mentioned above is now released but doesn't work with Cgo so that's not an option.

Probably the best path forward would be to just support both OpenCL/CUDA in the same binary and statically link the CUDA runtime library. The OpenCL runtime is dynamically loaded anyway so it just needs a stub for linking essentially.