mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
e0b0a6c030
This patch is an initial attempt to re-structure cgminer source code from its monolithic design (with nearly all code being concentrated in main.c) to a more modular one. In this first stage, the conditionally compiled functions for GPU and CPU mining were extracted into dedicated files: * device-cpu.h and device-cpu.c covering WANT_CPUMINE functions * device-gpu.h and device-gpu.c covering HAVE_OPENCL functions The main.c file is left untouched as reference, while the remainder without the extracted parts is located in cgminer.c. The Makefile.am has been updated to use the re-structured source files for the build. Above pure re-structuring *NO* functional modifications were made. The sources were tested to compile and run on on a current Linux system with working CPU and GPU mining (Bitforce not tested due to loack of hardware).
21 lines
538 B
C
21 lines
538 B
C
#ifndef __DEVICE_CPU_H__
|
|
#define __DEVICE_CPU_H__
|
|
|
|
#include "miner.h"
|
|
|
|
#ifndef OPT_SHOW_LEN
|
|
#define OPT_SHOW_LEN 80
|
|
#endif
|
|
|
|
extern const char *algo_names[];
|
|
extern bool opt_usecpu;
|
|
extern struct device_api cpu_api;
|
|
|
|
extern char *set_algo(const char *arg, enum sha256_algos *algo);
|
|
extern void show_algo(char buf[OPT_SHOW_LEN], const enum sha256_algos *algo);
|
|
extern char *force_nthreads_int(const char *arg, int *i);
|
|
extern void init_max_name_len();
|
|
extern double bench_algo_stage3(enum sha256_algos algo);
|
|
|
|
#endif /* __DEVICE_CPU_H__ */
|