Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/maztheman/nheqminer
Browse files Browse the repository at this point in the history
  • Loading branch information
maztheman committed Dec 15, 2016
2 parents ac2d7a5 + be7a19c commit b860e27
Show file tree
Hide file tree
Showing 21 changed files with 399 additions and 283 deletions.
7 changes: 4 additions & 3 deletions cpu_tromp/cpu_tromp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ProjectGuid>{6C180164-4DBE-45D7-85E0-7BDFACF3FC7B}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cpu_tromp</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
Expand All @@ -29,14 +30,14 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseSSE2|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -93,7 +94,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CPU_TROMP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<DisableSpecificWarnings>4244;4334</DisableSpecificWarnings>
<AdditionalIncludeDirectories>..\3rdparty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
Expand Down
6 changes: 3 additions & 3 deletions cpu_tromp/equi.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef u32 proof[PROOFSIZE];
void setheader(blake2b_state *ctx, const char *header, const u32 headerLen, const char* nce, const u32 nonceLen) {
uint32_t le_N = WN;
uint32_t le_K = WK;
uchar personal[] = "ZcashPoW01230123";
uchar personal[] = "DeepWebCa01230123";
memcpy(personal+8, &le_N, 4);
memcpy(personal+12, &le_K, 4);
blake2b_param P[1];
Expand All @@ -73,7 +73,7 @@ enum verify_code { POW_OK, POW_DUPLICATE, POW_OUT_OF_ORDER, POW_NONZERO_XOR };
const char *errstr[] = { "OK", "duplicate index", "indices out of order", "nonzero xor" };

void genhash(blake2b_state *ctx, u32 idx, uchar *hash) {
constexpr int hash_size = WN / 8;
const int hash_size = WN / 8;
blake2b_state state = *ctx;
u32 leb = (idx / HASHESPERBLAKE);
blake2b_update(&state, (uchar *)&leb, sizeof(u32));
Expand All @@ -83,7 +83,7 @@ void genhash(blake2b_state *ctx, u32 idx, uchar *hash) {
}

int verifyrec(blake2b_state *ctx, u32 *indices, uchar *hash, int r) {
constexpr int hash_size = WN / 8;
const int hash_size = WN / 8;
if (r == 0) {
genhash(ctx, *indices, hash);
return POW_OK;
Expand Down
5 changes: 3 additions & 2 deletions cpu_xenoncat/cpu_xenoncat.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ProjectGuid>{299E011B-5242-4EDA-B2F2-73C9B48F12FD}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cpu_xenoncat</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
Expand All @@ -25,7 +26,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -77,7 +78,7 @@ asm\fasm.exe asm\xenoncat_AVX2.asm asm\xenoncatavx2.obj</Command>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
8 changes: 5 additions & 3 deletions cuda_silentarmy/cuda_silentarmy.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<ProjectGuid>{76AC1E54-C6AC-465B-AF41-416B2C3874C1}</ProjectGuid>
<RootNamespace>cuda_silentarmy</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<CudaToolkitCustomDir>
</CudaToolkitCustomDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand All @@ -48,7 +50,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -142,7 +144,7 @@ copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;WIN64;_LIB;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand All @@ -157,7 +159,7 @@ copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
</PostBuildEvent>
<CudaCompile>
<TargetMachinePlatform>64</TargetMachinePlatform>
<CodeGeneration>compute_61,sm_61;compute_52,sm_52;compute_50,sm_50;compute_35,sm_35;compute_30,sm_30;</CodeGeneration>
<CodeGeneration>compute_52,sm_52;compute_50,sm_50;compute_35,sm_35;compute_30,sm_30;</CodeGeneration>
<PtxAsOptionV>true</PtxAsOptionV>
<FastMath>true</FastMath>
<Keep>true</Keep>
Expand Down
18 changes: 9 additions & 9 deletions cuda_silentarmy/kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ __device__ void potential_sol(char **htabs, uint ref0, uint ref1)
sols.valid[sol_i] = 1;
}

constexpr uint c_kernel_sol_counters = 32768 * (THRD / THREADS_PER_ROW);
const uint c_kernel_sol_counters = 32768 * (THRD / THREADS_PER_ROW);
__device__ uint kernel_sol_counters[c_kernel_sol_counters];

/*
Expand Down Expand Up @@ -2354,11 +2354,11 @@ checkCudaErrors(cudaDeviceSynchronize());

static inline void solve_new(c_context *miner, unsigned round)
{
constexpr uint32_t INIT_THREADS = 256;
constexpr uint32_t INIT_DIM = NR_ROWS / ROWS_PER_UINT / INIT_THREADS;
const uint32_t INIT_THREADS = 256;
const uint32_t INIT_DIM = NR_ROWS / ROWS_PER_UINT / INIT_THREADS;

constexpr uint32_t ROUND_THREADS = THRD;
constexpr uint32_t ROUND_DIM = NR_ROWS / ROUND_THREADS;
const uint32_t ROUND_THREADS = THRD;
const uint32_t ROUND_DIM = NR_ROWS / ROUND_THREADS;
static uint32_t ROUND0_DIM = select_work_size_blake() / ROUND_THREADS;

// Now on every round!!!!
Expand Down Expand Up @@ -2404,11 +2404,11 @@ static inline void solve_new(c_context *miner, unsigned round)

static inline void solve_old(unsigned round, c_context *miner)
{
constexpr uint32_t INIT_DIM = NR_ROWS / ROWS_PER_UINT / 256;
constexpr uint32_t INIT_THREADS = 256;
const uint32_t INIT_DIM = NR_ROWS / ROWS_PER_UINT / 256;
const uint32_t INIT_THREADS = 256;

constexpr uint32_t ROUND_THREADS = THRD;
constexpr uint32_t ROUND_DIM = NR_ROWS / ROUND_THREADS;
const uint32_t ROUND_THREADS = THRD;
const uint32_t ROUND_DIM = NR_ROWS / ROUND_THREADS;
static uint32_t ROUND0_DIM = select_work_size_blake() / ROUND_THREADS;

switch (round) {
Expand Down
2 changes: 1 addition & 1 deletion cuda_silentarmy/sa_blake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void zcash_blake2b_init(blake2b_state_t *st, uint8_t hash_len,
st->h[0] = blake2b_iv[0] ^ (0x01010000 | hash_len);
for (uint32_t i = 1; i <= 5; i++)
st->h[i] = blake2b_iv[i];
st->h[6] = blake2b_iv[6] ^ *(uint64_t *)"ZcashPoW";
st->h[6] = blake2b_iv[6] ^ *(uint64_t *)"DeepWebCa";
st->h[7] = blake2b_iv[7] ^ (((uint64_t)k << 32) | n);
st->bytes = 0;
}
Expand Down
7 changes: 5 additions & 2 deletions cuda_silentarmy_sm30/cuda_silentarmy_sm30.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<ProjectGuid>{53E62B3D-3FA6-4B53-8175-2B93753D98C4}</ProjectGuid>
<RootNamespace>cuda_silentarmy_sm30</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<CudaToolkitCustomDir>
</CudaToolkitCustomDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand All @@ -31,7 +33,7 @@
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
Expand Down Expand Up @@ -93,7 +95,7 @@ copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;WIN64;_LIB;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand Down Expand Up @@ -151,6 +153,7 @@ copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
<TargetMachinePlatform>64</TargetMachinePlatform>
<CodeGeneration>compute_30,sm_30;compute_20,sm_20</CodeGeneration>
<PtxAsOptionV>true</PtxAsOptionV>
<Keep>true</Keep>
</CudaCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit b860e27

Please sign in to comment.