Browse Source

vstudio: special ifdef for the constant (bmw)

master
Tanguy Pruvot 9 years ago
parent
commit
2d83f74a7e
  1. 3
      ccminer.vcxproj
  2. 5
      ccminer.vcxproj.filters
  3. 7
      quark/cuda_bmw512.cu
  4. 15
      quark/cuda_bmw512_sm3.cuh

3
ccminer.vcxproj

@ -314,6 +314,7 @@ @@ -314,6 +314,7 @@
<ClInclude Include="algos.h" />
<ClInclude Include="miner.h" />
<ClInclude Include="nvml.h" />
<ClInclude Include="quark\cuda_bmw512_sm3.cuh" />
<ClInclude Include="quark\cuda_quark_blake512_sp.cuh" />
<ClInclude Include="quark\cuda_skein512_sp.cuh" />
<ClInclude Include="res\resource.h" />
@ -527,4 +528,4 @@ @@ -527,4 +528,4 @@
<Target Name="AfterClean">
<Delete Files="@(FilesToCopy->'$(OutDir)%(Filename)%(Extension)')" TreatErrorsAsWarnings="true" />
</Target>
</Project>
</Project>

5
ccminer.vcxproj.filters

@ -434,6 +434,9 @@ @@ -434,6 +434,9 @@
<ClInclude Include="quark\cuda_skein512_sp.cuh">
<Filter>Source Files\CUDA\quark</Filter>
</ClInclude>
<ClInclude Include="quark\cuda_bmw512_sm3.cuh">
<Filter>Source Files\CUDA\quark</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CudaCompile Include="cuda.cpp">
@ -698,4 +701,4 @@ @@ -698,4 +701,4 @@
<Filter>Ressources</Filter>
</Text>
</ItemGroup>
</Project>
</Project>

7
quark/cuda_bmw512.cu

@ -9,7 +9,12 @@ @@ -9,7 +9,12 @@
__constant__ uint64_t c_PaddedMessage80[16]; // padded message (80 bytes + padding)
#endif
#include "cuda_bmw512_30.cu"
#include "cuda_bmw512_sm3.cuh"
#ifdef __INTELLISENSE__
/* just for vstudio code colors */
#define __CUDA_ARCH__ 500
#endif
#undef SHL
#undef SHR

15
quark/cuda_bmw512_30.cu → quark/cuda_bmw512_sm3.cuh

@ -1,6 +1,11 @@ @@ -1,6 +1,11 @@
#include <stdio.h>
#include <memory.h>
#ifdef __INTELLISENSE__
/* for vstudio code colors */
#define __CUDA_ARCH__ 300
#endif
#include "cuda_helper.h"
#define SHL(x, n) ((x) << (n))
@ -12,8 +17,7 @@ @@ -12,8 +17,7 @@
q[i+8] + ROTL64(q[i+9], 37) + q[i+10] + ROTL64(q[i+11], 43) + \
q[i+12] + ROTL64(q[i+13], 53) + (SHR(q[i+14],1) ^ q[i+14]) + (SHR(q[i+15],2) ^ q[i+15])
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 500
#if !defined(__CUDA_ARCH__) || (__CUDA_ARCH__ >= 200 && __CUDA_ARCH__ < 500)
__constant__ uint64_t d_constMem[16] = {
SPH_C64(0x8081828384858687),
SPH_C64(0x88898A8B8C8D8E8F),
@ -32,6 +36,13 @@ __constant__ uint64_t d_constMem[16] = { @@ -32,6 +36,13 @@ __constant__ uint64_t d_constMem[16] = {
SPH_C64(0xF0F1F2F3F4F5F6F7),
SPH_C64(0xF8F9FAFBFCFDFEFF)
};
# ifdef __GNUC__
// windows and linux doesnt require the same ifdef for __constant__
# pragma GCC diagnostic ignored "-Wunused-variable"
# endif
#endif
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 500
__device__
void Compression512_30(uint64_t *msg, uint64_t *hash)
Loading…
Cancel
Save