|
|
@@ -169,7 +169,7 @@ unsigned unittest_failures;
|
|
|
unsigned long global_quota_gcd = 1;
|
|
|
time_t last_getwork;
|
|
|
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
int opt_dynamic_interval = 7;
|
|
|
int nDevs;
|
|
|
int opt_g_threads = -1;
|
|
|
@@ -1034,7 +1034,7 @@ struct mining_algorithm *mining_algorithm_by_alias(const char * const alias)
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if defined(USE_SHA256D) && defined(HAVE_OPENCL)
|
|
|
+#if defined(USE_SHA256D) && defined(USE_OPENCL)
|
|
|
static
|
|
|
float opencl_oclthreads_to_intensity_sha256d(const unsigned long oclthreads)
|
|
|
{
|
|
|
@@ -1060,7 +1060,7 @@ static struct mining_algorithm malgo_sha256d = {
|
|
|
|
|
|
.hash_data_f = hash_data,
|
|
|
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
.opencl_nodefault = true,
|
|
|
.opencl_oclthreads_to_intensity = opencl_oclthreads_to_intensity_sha256d,
|
|
|
.opencl_intensity_to_oclthreads = opencl_intensity_to_oclthreads_sha256d,
|
|
|
@@ -1072,7 +1072,7 @@ static struct mining_algorithm malgo_sha256d = {
|
|
|
|
|
|
|
|
|
#ifdef USE_SCRYPT
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
static
|
|
|
float opencl_oclthreads_to_intensity_scrypt(const unsigned long oclthreads)
|
|
|
{
|
|
|
@@ -1096,7 +1096,7 @@ static struct mining_algorithm malgo_scrypt = {
|
|
|
|
|
|
.hash_data_f = scrypt_hash_data,
|
|
|
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
.opencl_oclthreads_to_intensity = opencl_oclthreads_to_intensity_scrypt,
|
|
|
.opencl_intensity_to_oclthreads = opencl_intensity_to_oclthreads_scrypt,
|
|
|
.opencl_min_oclthreads = 0x100, // intensity 8
|
|
|
@@ -2164,7 +2164,7 @@ char *set_temp_target(char *arg)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
static
|
|
|
char *set_no_opencl_binaries(__maybe_unused void * const dummy)
|
|
|
{
|
|
|
@@ -2315,7 +2315,7 @@ static char *set_null(const char __maybe_unused *arg)
|
|
|
|
|
|
/* These options are available from config file or commandline */
|
|
|
static struct opt_table opt_config_table[] = {
|
|
|
-#ifdef WANT_CPUMINE
|
|
|
+#ifdef USE_CPUMINING
|
|
|
#ifdef USE_SHA256D
|
|
|
OPT_WITH_ARG("--algo",
|
|
|
set_algo, show_algo, &opt_algo,
|
|
|
@@ -2353,7 +2353,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
// NOTE: Silently ignoring option, since it is plausable a non-SHA256d miner was using it just to skip benchmarking
|
|
|
OPT_WITH_ARG("--algo|-a", arg_ignored, NULL, NULL, opt_hidden),
|
|
|
#endif /* USE_SHA256D */
|
|
|
-#endif /* WANT_CPUMINE */
|
|
|
+#endif /* USE_CPUMINING */
|
|
|
OPT_WITH_ARG("--api-allow",
|
|
|
set_api_allow, NULL, NULL,
|
|
|
"Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets]"),
|
|
|
@@ -2436,7 +2436,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
opt_set_bool, &opt_compact,
|
|
|
"Use compact display without per device statistics"),
|
|
|
#endif
|
|
|
-#ifdef WANT_CPUMINE
|
|
|
+#ifdef USE_CPUMINING
|
|
|
OPT_WITH_ARG("--cpu-threads",
|
|
|
force_nthreads_int, opt_show_intval, &opt_n_threads,
|
|
|
"Number of miner CPU threads"),
|
|
|
@@ -2492,7 +2492,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
set_generate_addr, NULL, NULL,
|
|
|
opt_hidden),
|
|
|
#endif
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
OPT_WITH_ARG("--gpu-dyninterval",
|
|
|
set_int_1_to_65535, opt_show_intval, &opt_dynamic_interval,
|
|
|
opt_hidden),
|
|
|
@@ -2537,7 +2537,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
set_intensity, NULL, NULL,
|
|
|
opt_hidden),
|
|
|
#endif
|
|
|
-#if defined(HAVE_OPENCL) || defined(USE_MODMINER) || defined(USE_X6500) || defined(USE_ZTEX)
|
|
|
+#if defined(USE_OPENCL) || defined(USE_MODMINER) || defined(USE_X6500) || defined(USE_ZTEX)
|
|
|
OPT_WITH_ARG("--kernel-path",
|
|
|
opt_set_charp, opt_show_charp, &opt_kernel_path,
|
|
|
"Specify a path to where bitstream and kernel files are"),
|
|
|
@@ -2545,7 +2545,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
opt_set_charp, opt_show_charp, &opt_kernel_path,
|
|
|
opt_hidden),
|
|
|
#endif
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
OPT_WITH_ARG("--kernel|-k",
|
|
|
set_kernel, NULL, NULL,
|
|
|
opt_hidden),
|
|
|
@@ -2649,7 +2649,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
OPT_WITHOUT_ARG("--no-submit-stale",
|
|
|
opt_set_invbool, &opt_submit_stale,
|
|
|
"Don't submit shares if they are detected as stale"),
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
OPT_WITHOUT_ARG("--no-opencl-binaries",
|
|
|
set_no_opencl_binaries, NULL,
|
|
|
opt_hidden),
|
|
|
@@ -2752,7 +2752,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
OPT_WITH_ARG("--set-device|--set",
|
|
|
opt_string_elist_add, NULL, &opt_set_device_list,
|
|
|
"Set default parameters on devices; eg, NFY:osc6_bits=50"),
|
|
|
-#if defined(USE_SCRYPT) && defined(HAVE_OPENCL)
|
|
|
+#if defined(USE_SCRYPT) && defined(USE_OPENCL)
|
|
|
OPT_WITH_ARG("--shaders",
|
|
|
set_shaders, NULL, NULL,
|
|
|
opt_hidden),
|
|
|
@@ -2818,7 +2818,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
opt_hidden
|
|
|
#endif
|
|
|
),
|
|
|
-#if defined(USE_SCRYPT) && defined(HAVE_OPENCL)
|
|
|
+#if defined(USE_SCRYPT) && defined(USE_OPENCL)
|
|
|
OPT_WITH_ARG("--thread-concurrency",
|
|
|
set_thread_concurrency, NULL, NULL,
|
|
|
opt_hidden),
|
|
|
@@ -2834,7 +2834,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
OPT_WITH_ARG("--user|-u",
|
|
|
set_user, NULL, NULL,
|
|
|
"Username for bitcoin JSON-RPC server"),
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
OPT_WITH_ARG("--vectors|-v",
|
|
|
set_vector, NULL, NULL,
|
|
|
opt_hidden),
|
|
|
@@ -2848,7 +2848,7 @@ static struct opt_table opt_config_table[] = {
|
|
|
OPT_WITHOUT_ARG("--weighed-stats",
|
|
|
opt_set_bool, &opt_weighed_stats,
|
|
|
"Display statistics weighed to difficulty 1"),
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
OPT_WITH_ARG("--worksize|-w",
|
|
|
set_worksize, NULL, NULL,
|
|
|
opt_hidden),
|
|
|
@@ -3084,7 +3084,7 @@ static struct opt_table opt_cmdline_table[] = {
|
|
|
OPT_WITHOUT_ARG("--help|-h",
|
|
|
opt_verusage_and_exit, NULL,
|
|
|
"Print this message"),
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
OPT_WITHOUT_ARG("--ndevs|-n",
|
|
|
print_ndevs_and_exit, &nDevs,
|
|
|
opt_hidden),
|
|
|
@@ -3742,7 +3742,7 @@ static int statusy;
|
|
|
static int devsummaryYOffset;
|
|
|
static int total_lines;
|
|
|
#endif
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
struct cgpu_info gpus[MAX_GPUDEVICES]; /* Maximum number apparently possible */
|
|
|
#endif
|
|
|
struct cgpu_info *cpus;
|
|
|
@@ -7854,10 +7854,10 @@ void write_config(FILE *fcfg)
|
|
|
}
|
|
|
fputs("\n]\n", fcfg);
|
|
|
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
write_config_opencl(fcfg);
|
|
|
#endif
|
|
|
-#if defined(WANT_CPUMINE) && defined(USE_SHA256D)
|
|
|
+#if defined(USE_CPUMINING) && defined(USE_SHA256D)
|
|
|
fprintf(fcfg, ",\n\"algo\" : \"%s\"", algo_names[opt_algo]);
|
|
|
#endif
|
|
|
|
|
|
@@ -11643,7 +11643,7 @@ void bfg_watchdog(struct cgpu_info * const cgpu, struct timeval * const tvp_now)
|
|
|
else if (cgpu->status == LIFE_WAIT)
|
|
|
cgpu->status = LIFE_WELL;
|
|
|
|
|
|
-#ifdef WANT_CPUMINE
|
|
|
+#ifdef USE_CPUMINING
|
|
|
if (!strcmp(cgpu->drv->dname, "cpu"))
|
|
|
return;
|
|
|
#endif
|
|
|
@@ -11709,7 +11709,7 @@ void print_summary(void)
|
|
|
applog(LOG_WARNING, "Started at %s", datestamp);
|
|
|
if (total_pools == 1)
|
|
|
applog(LOG_WARNING, "Pool: %s", pools[0]->rpc_url);
|
|
|
-#if defined(WANT_CPUMINE) && defined(USE_SHA256D)
|
|
|
+#if defined(USE_CPUMINING) && defined(USE_SHA256D)
|
|
|
if (opt_n_threads > 0)
|
|
|
applog(LOG_WARNING, "CPU hasher algorithm used: %s", algo_names[opt_algo]);
|
|
|
#endif
|
|
|
@@ -11815,7 +11815,7 @@ void print_summary(void)
|
|
|
|
|
|
void _bfg_clean_up(bool restarting)
|
|
|
{
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
clear_adl(nDevs);
|
|
|
#endif
|
|
|
#ifdef HAVE_LIBUSB
|
|
|
@@ -12240,7 +12240,7 @@ void enable_curses(void) {
|
|
|
#endif
|
|
|
|
|
|
/* TODO: fix need a dummy CPU device_drv even if no support for CPU mining */
|
|
|
-#ifndef WANT_CPUMINE
|
|
|
+#ifndef USE_CPUMINING
|
|
|
struct device_drv cpu_drv;
|
|
|
struct device_drv cpu_drv = {
|
|
|
.name = "CPU",
|
|
|
@@ -13198,7 +13198,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
snprintf(packagename, sizeof(packagename), "%s %s", PACKAGE, VERSION);
|
|
|
|
|
|
-#if defined(WANT_CPUMINE) && defined(USE_SHA256D)
|
|
|
+#if defined(USE_CPUMINING) && defined(USE_SHA256D)
|
|
|
init_max_name_len();
|
|
|
#endif
|
|
|
|
|
|
@@ -13224,7 +13224,7 @@ int main(int argc, char *argv[])
|
|
|
strcpy(cgminer_path, dirname(s));
|
|
|
free(s);
|
|
|
strcat(cgminer_path, "/");
|
|
|
-#if defined(WANT_CPUMINE) && defined(WIN32)
|
|
|
+#if defined(USE_CPUMINING) && defined(WIN32)
|
|
|
{
|
|
|
char buf[32];
|
|
|
int gev = GetEnvironmentVariable("BFGMINER_BENCH_ALGO", buf, sizeof(buf));
|
|
|
@@ -13275,7 +13275,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
// Ensure at least the default goal is created
|
|
|
get_mining_goal("default");
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
opencl_early_init();
|
|
|
#endif
|
|
|
|
|
|
@@ -13626,12 +13626,12 @@ begin_bench:
|
|
|
start_cgpu(cgpu);
|
|
|
}
|
|
|
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
for (i = 0; i < nDevs; i++)
|
|
|
pause_dynamic_threads(i);
|
|
|
#endif
|
|
|
|
|
|
-#if defined(WANT_CPUMINE) && defined(USE_SHA256D)
|
|
|
+#if defined(USE_CPUMINING) && defined(USE_SHA256D)
|
|
|
if (opt_n_threads > 0)
|
|
|
applog(LOG_INFO, "%d cpu miner threads started, using '%s' algorithm.",
|
|
|
opt_n_threads, algo_names[opt_algo]);
|
|
|
@@ -13661,7 +13661,7 @@ begin_bench:
|
|
|
quit(1, "watchdog thread create failed");
|
|
|
pthread_detach(thr->pth);
|
|
|
|
|
|
-#ifdef HAVE_OPENCL
|
|
|
+#ifdef USE_OPENCL
|
|
|
/* Create reinit gpu thread */
|
|
|
gpur_thr_id = 3;
|
|
|
thr = &control_thr[gpur_thr_id];
|