|
29 | 29 | #include "algorithm/bitblock.h"
|
30 | 30 | #include "algorithm/x14.h"
|
31 | 31 | #include "algorithm/fresh.h"
|
| 32 | +#include "algorithm/neoscrypt.h" |
32 | 33 |
|
33 | 34 | #include "compat.h"
|
34 | 35 |
|
@@ -92,6 +93,17 @@ static void append_scrypt_compiler_options(struct _build_kernel_data *data, stru
|
92 | 93 | strcat(data->binary_filename, buf);
|
93 | 94 | }
|
94 | 95 |
|
| 96 | +static void append_neoscrypt_compiler_options(struct _build_kernel_data *data, struct cgpu_info *cgpu, struct _algorithm_t *algorithm) |
| 97 | +{ |
| 98 | + char buf[255]; |
| 99 | + sprintf(buf, " -D MAX_GLOBAL_THREADS=%u", |
| 100 | + (unsigned int)cgpu->thread_concurrency); |
| 101 | + strcat(data->compiler_options, buf); |
| 102 | + |
| 103 | + sprintf(buf, "tc%u", (unsigned int)cgpu->thread_concurrency); |
| 104 | + strcat(data->binary_filename, buf); |
| 105 | +} |
| 106 | + |
95 | 107 | static void append_x11_compiler_options(struct _build_kernel_data *data, struct cgpu_info *cgpu, struct _algorithm_t *algorithm)
|
96 | 108 | {
|
97 | 109 | char buf[255];
|
@@ -140,6 +152,30 @@ static cl_int queue_scrypt_kernel(struct __clState *clState, struct _dev_blk_ctx
|
140 | 152 | return status;
|
141 | 153 | }
|
142 | 154 |
|
| 155 | +static cl_int queue_neoscrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_unused cl_uint threads) |
| 156 | +{ |
| 157 | + cl_kernel *kernel = &clState->kernel; |
| 158 | + unsigned int num = 0; |
| 159 | + cl_uint le_target; |
| 160 | + cl_int status = 0; |
| 161 | + |
| 162 | + /* This looks like a unnecessary double cast, but to make sure, that |
| 163 | + * the target's most significant entry is adressed as a 32-bit value |
| 164 | + * and not accidently by something else the double cast seems wise. |
| 165 | + * The compiler will get rid of it anyway. |
| 166 | + */ |
| 167 | + le_target = (cl_uint)le32toh(((uint32_t *)blk->work->/*device_*/target)[7]); |
| 168 | + memcpy(clState->cldata, blk->work->data, 80); |
| 169 | + status = clEnqueueWriteBuffer(clState->commandQueue, clState->CLbuffer0, true, 0, 80, clState->cldata, 0, NULL, NULL); |
| 170 | + |
| 171 | + CL_SET_ARG(clState->CLbuffer0); |
| 172 | + CL_SET_ARG(clState->outputBuffer); |
| 173 | + CL_SET_ARG(clState->padbuffer8); |
| 174 | + CL_SET_ARG(le_target); |
| 175 | + |
| 176 | + return status; |
| 177 | +} |
| 178 | + |
143 | 179 | static cl_int queue_maxcoin_kernel(struct __clState *clState, struct _dev_blk_ctx *blk, __maybe_unused cl_uint threads)
|
144 | 180 | {
|
145 | 181 | cl_kernel *kernel = &clState->kernel;
|
@@ -597,6 +633,11 @@ static algorithm_settings_t algos[] = {
|
597 | 633 | A_SCRYPT( "zuikkis" ),
|
598 | 634 | #undef A_SCRYPT
|
599 | 635 |
|
| 636 | +#define A_NEOSCRYPT(a) \ |
| 637 | + { a, ALGO_NEOSCRYPT, "", 1, 65536, 65536, 0, 0, 0xFF, 0xFFFF000000000000ULL, 0x0000ffffUL, 0, -1, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, neoscrypt_regenhash, queue_neoscrypt_kernel, gen_hash, append_neoscrypt_compiler_options} |
| 638 | + A_NEOSCRYPT("neoscrypt"), |
| 639 | +#undef A_NEOSCRYPT |
| 640 | + |
600 | 641 | // kernels starting from this will have difficulty calculated by using quarkcoin algorithm
|
601 | 642 | #define A_QUARK(a, b) \
|
602 | 643 | { a, ALGO_QUARK, "", 256, 256, 256, 0, 0, 0xFF, 0xFFFFFFULL, 0x0000ffffUL, 0, 0, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, b, queue_sph_kernel, gen_hash, append_x11_compiler_options }
|
|
0 commit comments