Browse Source

Remove define-clauses for USE_SCRYPT.

nfactor-troky
Noel Maersk 11 years ago
parent
commit
323af83fdb
  1. 2
      api.c
  2. 19
      cgminer.c
  3. 2
      driver-opencl.c
  4. 2
      driver-opencl.h
  5. 9
      miner.h
  6. 2
      ocl.h
  7. 14
      scrypt.h

2
api.c

@ -161,9 +161,7 @@ static const char *NULLSTR = "(null)";
static const char *TRUESTR = "true"; static const char *TRUESTR = "true";
static const char *FALSESTR = "false"; static const char *FALSESTR = "false";
#ifdef USE_SCRYPT
static const char *SCRYPTSTR = "scrypt"; static const char *SCRYPTSTR = "scrypt";
#endif
static const char *SHA256STR = "sha256"; static const char *SHA256STR = "sha256";
static const char *DEVICECODE = "" static const char *DEVICECODE = ""

19
cgminer.c

@ -1085,7 +1085,6 @@ static struct opt_table opt_config_table[] = {
set_gpu_vddc, NULL, NULL, set_gpu_vddc, NULL, NULL,
"Set the GPU voltage in Volts - one value for all or separate by commas for per card"), "Set the GPU voltage in Volts - one value for all or separate by commas for per card"),
#endif #endif
#ifdef USE_SCRYPT
OPT_WITH_ARG("--lookup-gap", OPT_WITH_ARG("--lookup-gap",
set_lookup_gap, NULL, NULL, set_lookup_gap, NULL, NULL,
"Set GPU lookup gap for scrypt mining, comma separated"), "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 "Intensity of GPU scanning (d or " MIN_INTENSITY_STR
" -> " MAX_INTENSITY_STR " -> " MAX_INTENSITY_STR
",default: d to maintain desktop interactivity)"), ",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 #endif
OPT_WITH_ARG("--hotplug", OPT_WITH_ARG("--hotplug",
set_int_0_to_9999, NULL, &hotplug_time, set_int_0_to_9999, NULL, &hotplug_time,
@ -1250,11 +1242,9 @@ static struct opt_table opt_config_table[] = {
opt_hidden opt_hidden
#endif #endif
), ),
#ifdef USE_SCRYPT
OPT_WITH_ARG("--thread-concurrency", OPT_WITH_ARG("--thread-concurrency",
set_thread_concurrency, NULL, NULL, set_thread_concurrency, NULL, NULL,
"Set GPU thread concurrency for scrypt mining, comma separated"), "Set GPU thread concurrency for scrypt mining, comma separated"),
#endif
OPT_WITH_ARG("--url|-o", OPT_WITH_ARG("--url|-o",
set_url, NULL, NULL, set_url, NULL, NULL,
"URL for bitcoin JSON-RPC server"), "URL for bitcoin JSON-RPC server"),
@ -1437,13 +1427,10 @@ extern const char *opt_argv0;
static char *opt_verusage_and_exit(const char *extra) static char *opt_verusage_and_exit(const char *extra)
{ {
printf("%s\nBuilt with " printf("%s\nBuilt with "
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL // FIXME: true always
"GPU " "GPU "
#endif #endif
#ifdef USE_SCRYPT "scrypt mining support.\n"
"scrypt "
#endif
"mining support.\n"
, packagename); , packagename);
printf("%s", opt_usage(opt_argv0, extra)); printf("%s", opt_usage(opt_argv0, extra));
fflush(stdout); fflush(stdout);
@ -4262,7 +4249,6 @@ void write_config(FILE *fcfg)
break; break;
} }
} }
#ifdef USE_SCRYPT
fputs("\",\n\"lookup-gap\" : \"", fcfg); fputs("\",\n\"lookup-gap\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", fprintf(fcfg, "%s%d", i > 0 ? "," : "",
@ -4275,7 +4261,6 @@ void write_config(FILE *fcfg)
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", fprintf(fcfg, "%s%d", i > 0 ? "," : "",
(int)gpus[i].shaders); (int)gpus[i].shaders);
#endif
#ifdef HAVE_ADL #ifdef HAVE_ADL
fputs("\",\n\"gpu-engine\" : \"", fcfg); fputs("\",\n\"gpu-engine\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)

2
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) static bool opencl_prepare_work(struct thr_info __maybe_unused *thr, struct work *work)
{ {
#ifdef USE_SCRYPT
work->blk.work = work; work->blk.work = work;
#endif
return true; return true;
} }

2
driver-opencl.h

@ -18,11 +18,9 @@ extern char *set_temp_target(char *arg);
extern char *set_intensity(char *arg); extern char *set_intensity(char *arg);
extern char *set_vector(char *arg); extern char *set_vector(char *arg);
extern char *set_worksize(char *arg); extern char *set_worksize(char *arg);
#ifdef USE_SCRYPT
extern char *set_shaders(char *arg); extern char *set_shaders(char *arg);
extern char *set_lookup_gap(char *arg); extern char *set_lookup_gap(char *arg);
extern char *set_thread_concurrency(char *arg); extern char *set_thread_concurrency(char *arg);
#endif
extern char *set_kernel(char *arg); extern char *set_kernel(char *arg);
void manage_gpu(void); void manage_gpu(void);
extern void pause_dynamic_threads(int gpu); extern void pause_dynamic_threads(int gpu);

9
miner.h

@ -476,11 +476,9 @@ struct cgpu_info {
enum cl_kernels kernel; enum cl_kernels kernel;
cl_ulong max_alloc; cl_ulong max_alloc;
#ifdef USE_SCRYPT
int opt_lg, lookup_gap; int opt_lg, lookup_gap;
size_t opt_tc, thread_concurrency; size_t opt_tc, thread_concurrency;
size_t shaders; size_t shaders;
#endif
struct timeval tv_gpustart; struct timeval tv_gpustart;
int intervals; int intervals;
#endif #endif
@ -1119,13 +1117,12 @@ typedef struct {
cl_uint PreW31; cl_uint PreW31;
cl_uint PreW32; cl_uint PreW32;
/* For diakgcn */ /* FIXME: remove (For diakgcn) */
cl_uint B1addK6, PreVal0addK7, W16addK16, W17addK17; cl_uint B1addK6, PreVal0addK7, W16addK16, W17addK17;
cl_uint zeroA, zeroB; cl_uint zeroA, zeroB;
cl_uint oneA, twoA, threeA, fourA, fiveA, sixA, sevenA; cl_uint oneA, twoA, threeA, fourA, fiveA, sixA, sevenA;
#ifdef USE_SCRYPT
struct work *work; struct work *work;
#endif
} dev_blk_ctx; } dev_blk_ctx;
#else #else
typedef struct { typedef struct {
@ -1302,9 +1299,7 @@ struct work {
unsigned char target[32]; unsigned char target[32];
unsigned char hash[32]; unsigned char hash[32];
#ifdef USE_SCRYPT
unsigned char device_target[32]; unsigned char device_target[32];
#endif
double device_diff; double device_diff;
uint64_t share_diff; uint64_t share_diff;

2
ocl.h

@ -19,12 +19,10 @@ typedef struct {
cl_command_queue commandQueue; cl_command_queue commandQueue;
cl_program program; cl_program program;
cl_mem outputBuffer; cl_mem outputBuffer;
#ifdef USE_SCRYPT
cl_mem CLbuffer0; cl_mem CLbuffer0;
cl_mem padbuffer8; cl_mem padbuffer8;
size_t padbufsize; size_t padbufsize;
void * cldata; void * cldata;
#endif
bool hasBitAlign; bool hasBitAlign;
bool hasOpenCL11plus; bool hasOpenCL11plus;
bool hasOpenCL12plus; bool hasOpenCL12plus;

14
scrypt.h

@ -3,22 +3,8 @@
#include "miner.h" #include "miner.h"
#ifdef USE_SCRYPT
extern int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, extern int scrypt_test(unsigned char *pdata, const unsigned char *ptarget,
uint32_t nonce); uint32_t nonce);
extern void scrypt_regenhash(struct work *work); 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 */ #endif /* SCRYPT_H */

Loading…
Cancel
Save