From 323af83fdbc68657345d47c6899ff53bd5357c37 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Sun, 24 Nov 2013 19:52:14 +0200 Subject: [PATCH] Remove define-clauses for USE_SCRYPT. --- api.c | 2 -- cgminer.c | 19 ++----------------- driver-opencl.c | 2 -- driver-opencl.h | 2 -- miner.h | 9 ++------- ocl.h | 2 -- scrypt.h | 14 -------------- 7 files changed, 4 insertions(+), 46 deletions(-) diff --git a/api.c b/api.c index b8512f9f..2bf9a27c 100644 --- a/api.c +++ b/api.c @@ -161,9 +161,7 @@ static const char *NULLSTR = "(null)"; static const char *TRUESTR = "true"; static const char *FALSESTR = "false"; -#ifdef USE_SCRYPT static const char *SCRYPTSTR = "scrypt"; -#endif static const char *SHA256STR = "sha256"; static const char *DEVICECODE = "" diff --git a/cgminer.c b/cgminer.c index e64a86ea..576dcf6c 100644 --- a/cgminer.c +++ b/cgminer.c @@ -1085,7 +1085,6 @@ static struct opt_table opt_config_table[] = { set_gpu_vddc, NULL, NULL, "Set the GPU voltage in Volts - one value for all or separate by commas for per card"), #endif -#ifdef USE_SCRYPT OPT_WITH_ARG("--lookup-gap", set_lookup_gap, NULL, NULL, "Set GPU lookup gap for scrypt mining, comma separated"), @@ -1094,13 +1093,6 @@ static struct opt_table opt_config_table[] = { "Intensity of GPU scanning (d or " MIN_INTENSITY_STR " -> " MAX_INTENSITY_STR ",default: d to maintain desktop interactivity)"), -#else - OPT_WITH_ARG("--intensity|-I", - set_intensity, NULL, NULL, - "Intensity of GPU scanning (d or " MIN_INTENSITY_STR - " -> " MAX_INTENSITY_STR - ",default: d to maintain desktop interactivity)"), -#endif #endif OPT_WITH_ARG("--hotplug", set_int_0_to_9999, NULL, &hotplug_time, @@ -1250,11 +1242,9 @@ static struct opt_table opt_config_table[] = { opt_hidden #endif ), -#ifdef USE_SCRYPT OPT_WITH_ARG("--thread-concurrency", set_thread_concurrency, NULL, NULL, "Set GPU thread concurrency for scrypt mining, comma separated"), -#endif OPT_WITH_ARG("--url|-o", set_url, NULL, NULL, "URL for bitcoin JSON-RPC server"), @@ -1437,13 +1427,10 @@ extern const char *opt_argv0; static char *opt_verusage_and_exit(const char *extra) { printf("%s\nBuilt with " -#ifdef HAVE_OPENCL +#ifdef HAVE_OPENCL // FIXME: true always "GPU " #endif -#ifdef USE_SCRYPT - "scrypt " -#endif - "mining support.\n" + "scrypt mining support.\n" , packagename); printf("%s", opt_usage(opt_argv0, extra)); fflush(stdout); @@ -4262,7 +4249,6 @@ void write_config(FILE *fcfg) break; } } -#ifdef USE_SCRYPT fputs("\",\n\"lookup-gap\" : \"", fcfg); for(i = 0; i < nDevs; i++) fprintf(fcfg, "%s%d", i > 0 ? "," : "", @@ -4275,7 +4261,6 @@ void write_config(FILE *fcfg) for(i = 0; i < nDevs; i++) fprintf(fcfg, "%s%d", i > 0 ? "," : "", (int)gpus[i].shaders); -#endif #ifdef HAVE_ADL fputs("\",\n\"gpu-engine\" : \"", fcfg); for(i = 0; i < nDevs; i++) diff --git a/driver-opencl.c b/driver-opencl.c index b3c9461c..bc8be2a6 100644 --- a/driver-opencl.c +++ b/driver-opencl.c @@ -1407,9 +1407,7 @@ static bool opencl_thread_init(struct thr_info *thr) static bool opencl_prepare_work(struct thr_info __maybe_unused *thr, struct work *work) { -#ifdef USE_SCRYPT work->blk.work = work; -#endif return true; } diff --git a/driver-opencl.h b/driver-opencl.h index 1cb88076..330828b6 100644 --- a/driver-opencl.h +++ b/driver-opencl.h @@ -18,11 +18,9 @@ extern char *set_temp_target(char *arg); extern char *set_intensity(char *arg); extern char *set_vector(char *arg); extern char *set_worksize(char *arg); -#ifdef USE_SCRYPT extern char *set_shaders(char *arg); extern char *set_lookup_gap(char *arg); extern char *set_thread_concurrency(char *arg); -#endif extern char *set_kernel(char *arg); void manage_gpu(void); extern void pause_dynamic_threads(int gpu); diff --git a/miner.h b/miner.h index 5dae4081..ca1da456 100644 --- a/miner.h +++ b/miner.h @@ -476,11 +476,9 @@ struct cgpu_info { enum cl_kernels kernel; cl_ulong max_alloc; -#ifdef USE_SCRYPT int opt_lg, lookup_gap; size_t opt_tc, thread_concurrency; size_t shaders; -#endif struct timeval tv_gpustart; int intervals; #endif @@ -1119,13 +1117,12 @@ typedef struct { cl_uint PreW31; cl_uint PreW32; - /* For diakgcn */ + /* FIXME: remove (For diakgcn) */ cl_uint B1addK6, PreVal0addK7, W16addK16, W17addK17; cl_uint zeroA, zeroB; cl_uint oneA, twoA, threeA, fourA, fiveA, sixA, sevenA; -#ifdef USE_SCRYPT + struct work *work; -#endif } dev_blk_ctx; #else typedef struct { @@ -1302,9 +1299,7 @@ struct work { unsigned char target[32]; unsigned char hash[32]; -#ifdef USE_SCRYPT unsigned char device_target[32]; -#endif double device_diff; uint64_t share_diff; diff --git a/ocl.h b/ocl.h index ed8bfde8..6720a49a 100644 --- a/ocl.h +++ b/ocl.h @@ -19,12 +19,10 @@ typedef struct { cl_command_queue commandQueue; cl_program program; cl_mem outputBuffer; -#ifdef USE_SCRYPT cl_mem CLbuffer0; cl_mem padbuffer8; size_t padbufsize; void * cldata; -#endif bool hasBitAlign; bool hasOpenCL11plus; bool hasOpenCL12plus; diff --git a/scrypt.h b/scrypt.h index 8f3d2190..b08edfaf 100644 --- a/scrypt.h +++ b/scrypt.h @@ -3,22 +3,8 @@ #include "miner.h" -#ifdef USE_SCRYPT extern int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); extern void scrypt_regenhash(struct work *work); -#else /* USE_SCRYPT */ -static inline int scrypt_test(__maybe_unused unsigned char *pdata, - __maybe_unused const unsigned char *ptarget, - __maybe_unused uint32_t nonce) -{ - return 0; -} - -static inline void scrypt_regenhash(__maybe_unused struct work *work) -{ -} -#endif /* USE_SCRYPT */ - #endif /* SCRYPT_H */