Browse Source

add --hamsi-expand-big option for setting EXPAND_BIG in X13 kernels

djm34
Jan Berdajs 11 years ago
parent
commit
881355d873
  1. 2
      kernel/marucoin-mod.cl
  2. 2
      kernel/marucoin-modold.cl
  3. 4
      kernel/marucoin.cl
  4. 1
      miner.h
  5. 1
      ocl.c
  6. 10
      ocl/build_kernel.c
  7. 1
      ocl/build_kernel.h
  8. 4
      sgminer.c

2
kernel/marucoin-mod.cl

@ -75,7 +75,9 @@ typedef long sph_s64; @@ -75,7 +75,9 @@ typedef long sph_s64;
#define SPH_GROESTL_BIG_ENDIAN 0
#define SPH_CUBEHASH_UNROLL 0
#define SPH_KECCAK_UNROLL 0
#if !defined SPH_HAMSI_EXPAND_BIG
#define SPH_HAMSI_EXPAND_BIG 4
#endif
#include "blake.cl"
#include "bmw.cl"

2
kernel/marucoin-modold.cl

@ -75,7 +75,9 @@ typedef long sph_s64; @@ -75,7 +75,9 @@ typedef long sph_s64;
#define SPH_GROESTL_BIG_ENDIAN 0
#define SPH_CUBEHASH_UNROLL 0
#define SPH_KECCAK_UNROLL 0
#if !defined SPH_HAMSI_EXPAND_BIG
#define SPH_HAMSI_EXPAND_BIG 4
#endif
#include "blake.cl"
#include "bmw.cl"

4
kernel/marucoin.cl

@ -74,7 +74,9 @@ typedef long sph_s64; @@ -74,7 +74,9 @@ typedef long sph_s64;
#define SPH_GROESTL_BIG_ENDIAN 0
#define SPH_CUBEHASH_UNROLL 0
#define SPH_KECCAK_UNROLL 0
#define SPH_HAMSI_EXPAND_BIG 1
#if !defined SPH_HAMSI_EXPAND_BIG
#define SPH_HAMSI_EXPAND_BIG 4
#endif
#include "blake.cl"
#include "bmw.cl"

1
miner.h

@ -956,6 +956,7 @@ extern bool opt_worktime; @@ -956,6 +956,7 @@ extern bool opt_worktime;
extern int swork_id;
extern int opt_tcp_keepalive;
extern bool opt_incognito;
extern int opt_hamsi_expand_big;
#if LOCK_TRACKING
extern pthread_mutex_t lockstat_lock;

1
ocl.c

@ -397,6 +397,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *alg @@ -397,6 +397,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *alg
set_base_compiler_options(build_data);
append_scrypt_compiler_options(build_data, cgpu->lookup_gap, cgpu->thread_concurrency, algorithm->nfactor);
append_hamsi_compiler_options(build_data, opt_hamsi_expand_big);
if (!(clState->program = build_opencl_kernel(build_data, filename)))
return NULL;

10
ocl/build_kernel.c

@ -107,6 +107,16 @@ void append_scrypt_compiler_options(build_kernel_data *data, int lookup_gap, uns @@ -107,6 +107,16 @@ void append_scrypt_compiler_options(build_kernel_data *data, int lookup_gap, uns
strcat(data->compiler_options, buf);
}
// TODO: move away, specific
void append_hamsi_compiler_options(build_kernel_data *data, int expand_big)
{
char buf[255];
sprintf(buf, " -D SPH_HAMSI_EXPAND_BIG=%d",
expand_big);
strcat(data->compiler_options, buf);
}
cl_program build_opencl_kernel(build_kernel_data *data, const char *filename)
{
int pl;

1
ocl/build_kernel.h

@ -27,5 +27,6 @@ cl_program build_opencl_kernel(build_kernel_data *data, const char *filename); @@ -27,5 +27,6 @@ cl_program build_opencl_kernel(build_kernel_data *data, const char *filename);
bool save_opencl_kernel(build_kernel_data *data, cl_program program);
void set_base_compiler_options(build_kernel_data *data);
void append_scrypt_compiler_options(build_kernel_data *data, int lookup_gap, unsigned int thread_concurrency, unsigned int nfactor);
void append_hamsi_compiler_options(build_kernel_data *data, int expand_big);
#endif /* BUILD_KERNEL_H */

4
sgminer.c

@ -108,6 +108,7 @@ time_t last_getwork; @@ -108,6 +108,7 @@ time_t last_getwork;
int nDevs;
int opt_dynamic_interval = 7;
int opt_g_threads = -1;
int opt_hamsi_expand_big = 4;
bool opt_restart = true;
struct list_head scan_devices;
@ -1343,6 +1344,9 @@ static struct opt_table opt_config_table[] = { @@ -1343,6 +1344,9 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--lookup-gap",
set_lookup_gap, NULL, NULL,
"Set GPU lookup gap for scrypt mining, comma separated"),
OPT_WITH_ARG("--hamsi-expand-big",
set_int_1_to_10, opt_show_intval, &opt_hamsi_expand_big,
"Set SPH_HAMSI_EXPAND_BIG for X13 algorithms (1 or 4 are common)"),
#ifdef HAVE_CURSES
OPT_WITHOUT_ARG("--incognito",
opt_set_bool, &opt_incognito,

Loading…
Cancel
Save