Browse Source

Old Kernel Fix

Old kernels would produce HW. Also, corrected an hamsi problem for
people who didn't use hamsi-expand-big 1.
djm34
ystarnaud 11 years ago
parent
commit
22c34fbf45
  1. 4
      algorithm.c
  2. 33
      kernel/bitblock.cl
  3. 2185
      kernel/bitblockold.cl
  4. 2
      kernel/hamsi.cl
  5. 31
      kernel/marucoin-mod.cl
  6. 1880
      kernel/marucoin-modold.cl
  7. 31
      kernel/x14.cl
  8. 1992
      kernel/x14old.cl

4
algorithm.c

@ -94,8 +94,8 @@ static void append_scrypt_compiler_options(struct _build_kernel_data *data, stru @@ -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":""));

33
kernel/bitblock.cl

@ -78,10 +78,7 @@ typedef int sph_s32; @@ -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) @@ -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];
#ifdef INPUT_BIG_LOCAL
__local sph_u32 T512_L[1024];
__constant const sph_u32 *T512_C = &T512[0][0];
barrier(CLK_LOCAL_MEM_FENCE);
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) @@ -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

2185
kernel/bitblockold.cl

File diff suppressed because it is too large Load Diff

2
kernel/hamsi.cl

@ -105,7 +105,7 @@ @@ -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"

31
kernel/marucoin-mod.cl

@ -78,9 +78,6 @@ typedef long sph_s64; @@ -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,15 +1090,20 @@ __kernel void search11(__global hash_t* hashes) @@ -1093,15 +1090,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];
#ifdef INPUT_BIG_LOCAL
__local sph_u32 T512_L[1024];
__constant const sph_u32 *T512_C = &T512[0][0];
barrier(CLK_LOCAL_MEM_FENCE);
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];
@ -1113,10 +1115,11 @@ __kernel void search11(__global hash_t* hashes) @@ -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

1880
kernel/marucoin-modold.cl

File diff suppressed because it is too large Load Diff

31
kernel/x14.cl

@ -80,9 +80,6 @@ typedef int sph_s32; @@ -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,15 +1104,20 @@ __kernel void search11(__global hash_t* hashes) @@ -1107,15 +1104,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];
#ifdef INPUT_BIG_LOCAL
__local sph_u32 T512_L[1024];
__constant const sph_u32 *T512_C = &T512[0][0];
barrier(CLK_LOCAL_MEM_FENCE);
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];
@ -1127,10 +1129,11 @@ __kernel void search11(__global hash_t* hashes) @@ -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

1992
kernel/x14old.cl

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save