mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 04:24:19 +00:00
Old Kernel Fix
Old kernels would produce HW. Also, corrected an hamsi problem for people who didn't use hamsi-expand-big 1.
This commit is contained in:
parent
5c9126fd61
commit
22c34fbf45
@ -94,8 +94,8 @@ static void append_scrypt_compiler_options(struct _build_kernel_data *data, stru
|
||||
static void append_hamsi_compiler_options(struct _build_kernel_data *data, struct cgpu_info *cgpu, struct _algorithm_t *algorithm)
|
||||
{
|
||||
char buf[255];
|
||||
sprintf(buf, " -D SPH_HAMSI_EXPAND_BIG=%d%s ",
|
||||
opt_hamsi_expand_big, ((opt_hamsi_short)?" -D SPH_HAMSI_SHORT=1 ":""));
|
||||
sprintf(buf, " -D SPH_HAMSI_EXPAND_BIG=%d -D SPH_HAMSI_SHORT=%d ",
|
||||
opt_hamsi_expand_big, ((opt_hamsi_short)?1:0));
|
||||
strcat(data->compiler_options, buf);
|
||||
|
||||
sprintf(buf, "big%u%s", (unsigned int)opt_hamsi_expand_big, ((opt_hamsi_short)?"hs":""));
|
||||
|
@ -78,10 +78,7 @@ typedef int sph_s32;
|
||||
#define SPH_CUBEHASH_UNROLL 0
|
||||
#define SPH_KECCAK_UNROLL 1
|
||||
#ifndef SPH_HAMSI_EXPAND_BIG
|
||||
#define SPH_HAMSI_EXPAND_BIG 1
|
||||
#endif
|
||||
#ifndef SPH_HAMSI_SHORT
|
||||
#define SPH_HAMSI_SHORT 1
|
||||
#define SPH_HAMSI_EXPAND_BIG 1
|
||||
#endif
|
||||
|
||||
#include "blake.cl"
|
||||
@ -1108,15 +1105,20 @@ __kernel void search11(__global hash_t* hashes)
|
||||
{
|
||||
uint gid = get_global_id(0);
|
||||
__global hash_t *hash = &(hashes[gid-get_global_offset(0)]);
|
||||
__local sph_u32 T512_L[1024];
|
||||
__constant const sph_u32 *T512_C = &T512[0][0];
|
||||
|
||||
int init = get_local_id(0);
|
||||
int step = get_local_size(0);
|
||||
for (int i = init; i < 1024; i += step)
|
||||
T512_L[i] = T512_C[i];
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
#ifdef INPUT_BIG_LOCAL
|
||||
__local sph_u32 T512_L[1024];
|
||||
__constant const sph_u32 *T512_C = &T512[0][0];
|
||||
|
||||
int init = get_local_id(0);
|
||||
int step = get_local_size(0);
|
||||
for (int i = init; i < 1024; i += step)
|
||||
T512_L[i] = T512_C[i];
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
#else
|
||||
#define INPUT_BIG_LOCAL INPUT_BIG
|
||||
#endif
|
||||
|
||||
sph_u32 c0 = HAMSI_IV512[0], c1 = HAMSI_IV512[1], c2 = HAMSI_IV512[2], c3 = HAMSI_IV512[3];
|
||||
sph_u32 c4 = HAMSI_IV512[4], c5 = HAMSI_IV512[5], c6 = HAMSI_IV512[6], c7 = HAMSI_IV512[7];
|
||||
@ -1128,10 +1130,11 @@ __kernel void search11(__global hash_t* hashes)
|
||||
|
||||
#define buf(u) hash->h1[i + u]
|
||||
|
||||
for(int i = 0; i < 64; i += 8) {
|
||||
INPUT_BIG_LOCAL;
|
||||
P_BIG;
|
||||
T_BIG;
|
||||
for(int i = 0; i < 64; i += 8)
|
||||
{
|
||||
INPUT_BIG_LOCAL;
|
||||
P_BIG;
|
||||
T_BIG;
|
||||
}
|
||||
|
||||
#undef buf
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -105,7 +105,7 @@
|
||||
|
||||
//temp fix for shortened implementation of X15
|
||||
#ifdef SPH_HAMSI_SHORT
|
||||
#if SPH_HAMSI_EXPAND_BIG == 1
|
||||
#if SPH_HAMSI_SHORT == 1 && SPH_HAMSI_EXPAND_BIG == 1
|
||||
#include "hamsi_helper_big.cl"
|
||||
#else
|
||||
#include "hamsi_helper.cl"
|
||||
|
@ -78,9 +78,6 @@ typedef long sph_s64;
|
||||
#if !defined SPH_HAMSI_EXPAND_BIG
|
||||
#define SPH_HAMSI_EXPAND_BIG 1
|
||||
#endif
|
||||
#ifndef SPH_HAMSI_SHORT
|
||||
#define SPH_HAMSI_SHORT 1
|
||||
#endif
|
||||
|
||||
#include "blake.cl"
|
||||
#include "bmw.cl"
|
||||
@ -1093,16 +1090,21 @@ __kernel void search11(__global hash_t* hashes)
|
||||
{
|
||||
uint gid = get_global_id(0);
|
||||
__global hash_t *hash = &(hashes[gid-get_global_offset(0)]);
|
||||
__local sph_u32 T512_L[1024];
|
||||
__constant const sph_u32 *T512_C = &T512[0][0];
|
||||
|
||||
int init = get_local_id(0);
|
||||
int step = get_local_size(0);
|
||||
for (int i = init; i < 1024; i += step)
|
||||
T512_L[i] = T512_C[i];
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
#ifdef INPUT_BIG_LOCAL
|
||||
__local sph_u32 T512_L[1024];
|
||||
__constant const sph_u32 *T512_C = &T512[0][0];
|
||||
|
||||
int init = get_local_id(0);
|
||||
int step = get_local_size(0);
|
||||
for (int i = init; i < 1024; i += step)
|
||||
T512_L[i] = T512_C[i];
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
#else
|
||||
#define INPUT_BIG_LOCAL INPUT_BIG
|
||||
#endif
|
||||
|
||||
sph_u32 c0 = HAMSI_IV512[0], c1 = HAMSI_IV512[1], c2 = HAMSI_IV512[2], c3 = HAMSI_IV512[3];
|
||||
sph_u32 c4 = HAMSI_IV512[4], c5 = HAMSI_IV512[5], c6 = HAMSI_IV512[6], c7 = HAMSI_IV512[7];
|
||||
sph_u32 c8 = HAMSI_IV512[8], c9 = HAMSI_IV512[9], cA = HAMSI_IV512[10], cB = HAMSI_IV512[11];
|
||||
@ -1113,10 +1115,11 @@ __kernel void search11(__global hash_t* hashes)
|
||||
|
||||
#define buf(u) hash->h1[i + u]
|
||||
|
||||
for(int i = 0; i < 64; i += 8) {
|
||||
INPUT_BIG_LOCAL;
|
||||
P_BIG;
|
||||
T_BIG;
|
||||
for(int i = 0; i < 64; i += 8)
|
||||
{
|
||||
INPUT_BIG_LOCAL;
|
||||
P_BIG;
|
||||
T_BIG;
|
||||
}
|
||||
|
||||
#undef buf
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -80,9 +80,6 @@ typedef int sph_s32;
|
||||
#ifndef SPH_HAMSI_EXPAND_BIG
|
||||
#define SPH_HAMSI_EXPAND_BIG 1
|
||||
#endif
|
||||
#ifndef SPH_HAMSI_SHORT
|
||||
#define SPH_HAMSI_SHORT 1
|
||||
#endif
|
||||
|
||||
#include "blake.cl"
|
||||
#include "bmw.cl"
|
||||
@ -1107,16 +1104,21 @@ __kernel void search11(__global hash_t* hashes)
|
||||
{
|
||||
uint gid = get_global_id(0);
|
||||
__global hash_t *hash = &(hashes[gid-get_global_offset(0)]);
|
||||
__local sph_u32 T512_L[1024];
|
||||
__constant const sph_u32 *T512_C = &T512[0][0];
|
||||
|
||||
#ifdef INPUT_BIG_LOCAL
|
||||
__local sph_u32 T512_L[1024];
|
||||
__constant const sph_u32 *T512_C = &T512[0][0];
|
||||
|
||||
int init = get_local_id(0);
|
||||
int step = get_local_size(0);
|
||||
for (int i = init; i < 1024; i += step)
|
||||
T512_L[i] = T512_C[i];
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
#else
|
||||
#define INPUT_BIG_LOCAL INPUT_BIG
|
||||
#endif
|
||||
|
||||
int init = get_local_id(0);
|
||||
int step = get_local_size(0);
|
||||
for (int i = init; i < 1024; i += step)
|
||||
T512_L[i] = T512_C[i];
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
sph_u32 c0 = HAMSI_IV512[0], c1 = HAMSI_IV512[1], c2 = HAMSI_IV512[2], c3 = HAMSI_IV512[3];
|
||||
sph_u32 c4 = HAMSI_IV512[4], c5 = HAMSI_IV512[5], c6 = HAMSI_IV512[6], c7 = HAMSI_IV512[7];
|
||||
sph_u32 c8 = HAMSI_IV512[8], c9 = HAMSI_IV512[9], cA = HAMSI_IV512[10], cB = HAMSI_IV512[11];
|
||||
@ -1127,10 +1129,11 @@ __kernel void search11(__global hash_t* hashes)
|
||||
|
||||
#define buf(u) hash->h1[i + u]
|
||||
|
||||
for(int i = 0; i < 64; i += 8) {
|
||||
INPUT_BIG_LOCAL;
|
||||
P_BIG;
|
||||
T_BIG;
|
||||
for(int i = 0; i < 64; i += 8)
|
||||
{
|
||||
INPUT_BIG_LOCAL;
|
||||
P_BIG;
|
||||
T_BIG;
|
||||
}
|
||||
|
||||
#undef buf
|
||||
|
1828
kernel/x14old.cl
1828
kernel/x14old.cl
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user