Skip to content

Commit

Permalink
use int with for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausT committed Dec 6, 2014
1 parent 5c01f4f commit 3d9efcb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions blake32.cu
Expand Up @@ -133,7 +133,7 @@ void blake256_compress(uint32_t *h, const uint32_t *block, const uint32_t T0, co
m[2] = block[2];
m[3] = block[3];

for (uint32_t i = 4; i < 16; i++) {
for (int i = 4; i < 16; i++) {
#if PRECALC64
m[i] = c_Padding[i];
#else
Expand Down Expand Up @@ -173,7 +173,7 @@ void blake256_compress(uint32_t *h, const uint32_t *block, const uint32_t T0, co
h[7U] ^= v[7U] ^ v[15U];
#else
//#pragma unroll 16
for (uint32_t i = 0; i < 16; i++) {
for (int i = 0; i < 16; i++) {
uint32_t j = i % 8U;
h[j] ^= v[i];
}
Expand Down
2 changes: 1 addition & 1 deletion ccminer.vcxproj
Expand Up @@ -174,7 +174,7 @@
<MaxRegCount>80</MaxRegCount>
<PtxAsOptionV>true</PtxAsOptionV>
<Keep>true</Keep>
<CodeGeneration>compute_50,sm_50</CodeGeneration>
<CodeGeneration>compute_50,sm_50;compute_52,sm_52</CodeGeneration>
<AdditionalOptions>--ptxas-options="-O2" %(AdditionalOptions)</AdditionalOptions>
<Defines>
</Defines>
Expand Down
10 changes: 5 additions & 5 deletions pentablake.cu
Expand Up @@ -149,7 +149,7 @@ void pentablake_compress(uint64_t *h, const uint64_t *block, const uint32_t T0)
m[2] = block[2];
m[3] = block[3];

for (uint32_t i = 4; i < 16; i++) {
for (int i = 4; i < 16; i++) {
m[i] = (T0 == 0x200) ? block[i] : c_Padding[i];
}

Expand All @@ -167,7 +167,7 @@ void pentablake_compress(uint64_t *h, const uint64_t *block, const uint32_t T0)
v[14] = c_u512[6];
v[15] = c_u512[7];

for (uint32_t i = 0; i < 16; i++) {
for (int i = 0; i < 16; i++) {
/* column step */
G(0, 4, 0x8, 0xC, 0x0);
G(1, 5, 0x9, 0xD, 0x2);
Expand All @@ -181,7 +181,7 @@ void pentablake_compress(uint64_t *h, const uint64_t *block, const uint32_t T0)
}

//#pragma unroll 16
for (uint32_t i = 0; i < 16; i++) {
for (int i = 0; i < 16; i++) {
uint32_t j = i % 8;
h[j] ^= v[i];
}
Expand Down Expand Up @@ -293,13 +293,13 @@ void pentablake_gpu_hash_80(int threads, const uint32_t startNounce, void *outpu
#if __CUDA_ARCH__ < 300
uint32_t *outHash = (uint32_t *)outputHash + 16 * thread;
#pragma unroll 8
for (uint32_t i=0; i < 8; i++) {
for (int i=0; i < 8; i++) {
outHash[2*i] = cuda_swab32( _HIWORD(h[i]) );
outHash[2*i+1] = cuda_swab32( _LOWORD(h[i]) );
}
#else
uint64_t *outHash = (uint64_t *)outputHash + 8 * thread;
for (uint32_t i=0; i < 8; i++) {
for (int i=0; i < 8; i++) {
outHash[i] = cuda_swab64( h[i] );
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions quark/cuda_quark_blake512.cu
Expand Up @@ -272,13 +272,13 @@ void quark_blake512_gpu_hash_80(int threads, uint32_t startNounce, uint32_t *out
#if __CUDA_ARCH__ <= 350
uint32_t *outHash = outputHash + 16 * thread;
#pragma unroll 8
for (uint32_t i=0; i < 8; i++) {
for (int i=0; i < 8; i++) {
outHash[2*i] = cuda_swab32( _HIWORD(h[i]) );
outHash[2*i+1] = cuda_swab32( _LOWORD(h[i]) );
}
#else
uint64_t *outHash = (uint64_t *)outputHash + 8 * thread;
for (uint32_t i=0; i < 8; i++) {
for (int i=0; i < 8; i++) {
outHash[i] = cuda_swab64( h[i] );
}
#endif
Expand Down

0 comments on commit 3d9efcb

Please sign in to comment.