Skip to content

Commit

Permalink
small speed improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
djm34 committed May 20, 2019
1 parent 34962b8 commit 99951cf
Show file tree
Hide file tree
Showing 25 changed files with 373 additions and 1,531 deletions.
6 changes: 3 additions & 3 deletions JHA/cuda_jha_compactionTest.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <sm_30_intrinsics.h>

#ifdef __INTELLISENSE__
#define __shfl_up(a,b)
#define __shfl_up_sync(c,a,b)
#endif

static uint32_t *d_tempBranch1Nonces[MAX_GPUS];
Expand Down Expand Up @@ -128,7 +128,7 @@ void jackpot_compactTest_gpu_SCAN(uint32_t *data, int width, uint32_t *partial_s

for (int i=1; i<=width; i*=2)
{
uint32_t n = __shfl_up((int)value, i, width);
uint32_t n = __shfl_up_sync(0xFFFFFFFF, (int)value, i, width);

if (lane_id >= i) value += n;
}
Expand All @@ -155,7 +155,7 @@ void jackpot_compactTest_gpu_SCAN(uint32_t *data, int width, uint32_t *partial_s

for (int i=1; i<=width; i*=2)
{
uint32_t n = __shfl_up((int)warp_sum, i, width);
uint32_t n = __shfl_up_sync(0xFFFFFFFF, (int)warp_sum, i, width);

if (lane_id >= i) warp_sum += n;
}
Expand Down
6 changes: 3 additions & 3 deletions RUN-ZCOIN-MTP.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

x64\Release\ccminer -a mtp -o http://127.0.0.1:8382 -u djm34 -p password --coinbase-addr aDn7MMYjVQqenT11VFDYHfFdwXmSTRUTak --no-getwork -i 20
rem x64\Release\ccminer -a mtp -o http://127.0.0.1:8382 -u djm34 -p password --coinbase-addr aDn7MMYjVQqenT11VFDYHfFdwXmSTRUTak --no-getwork -i 20
rem x64\Release\ccminer -a mtp -o stratum+tcp://xzc.2miners.com:8080 -u aDn7MMYjVQqenT11VFDYHfFdwXmSTRUTak -p 0 -i 21 -d 0,1
rem x64\Release\ccminer -a mtp -o stratum+tcp://zcoin.mintpond.com:3000 -u aDn7MMYjVQqenT11VFDYHfFdwXmSTRUTak.worker -p 0,strict,verbose,d=1000 -i 20
x64\Release\ccminer -a mtp -o stratum+tcp://zcoin.mintpond.com:3000 -u aDn7MMYjVQqenT11VFDYHfFdwXmSTRUTak.worker -p 0,strict,verbose,d=500 -i 21

rem x64\Release\ccminer -a mtp -o stratum+tcp://pool.bibop.net:4000 -u aDn7MMYjVQqenT11VFDYHfFdwXmSTRUTak -p 0,c=XZC -i 20 -d 1
rem x64\Release\ccminer -a mtp -o stratum+tcp://pool.bibop.net:4001 -u aDn7MMYjVQqenT11VFDYHfFdwXmSTRUTak -p 0,c=XZC,d=10 -i 20 -d 1


pause
3 changes: 3 additions & 0 deletions argon2ref/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,7 @@ void fill_segment(const argon2_instance_t *instance,
int fill_memory_blocks(argon2_instance_t *instance);

int fill_memory_blocks_mtp(argon2_instance_t *instance);



#endif
6 changes: 4 additions & 2 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,15 +1214,17 @@ static bool submit_upstream_work_mtp(CURL *curl, struct work *work, struct mtp *
params = json_dumps(val, 0);
json_decref(val);

req = (char*)malloc(128 + 2 * 84 + strlen(work->txs) + strlen(params) + strlen(mtphashvalue_str) + strlen(mtpreserved_str) + strlen(merkleroot_str)+ strlen(proofmtp_str) + strlen(blockmtp_str));
req = (char*)malloc(128 + 2 * 84 + strlen(work->txs) + strlen(params) + strlen(mtphashvalue_str)
+ strlen(mtpreserved_str) + strlen(merkleroot_str)+ strlen(proofmtp_str) + strlen(blockmtp_str));
sprintf(req,
"{\"method\": \"submitblock\", \"params\": [\"%s%s%s%s%s%s%s\", %s], \"id\":4}\r\n",
data_str, mtphashvalue_str, mtpreserved_str, merkleroot_str, blockmtp_str, proofmtp_str, work->txs, params);
free(params);

}
else {
req = (char*)malloc(128 + 2 * 84 + strlen(work->txs) + strlen(mtphashvalue_str) + strlen(mtpreserved_str) + strlen(merkleroot_str) + strlen(proofmtp_str) + strlen(blockmtp_str) );
req = (char*)malloc(128 + 2 * 84 + strlen(work->txs) + strlen(mtphashvalue_str) + strlen(mtpreserved_str)
+ strlen(merkleroot_str) + strlen(proofmtp_str) + strlen(blockmtp_str) );
sprintf(req,
"{\"method\": \"submitblock\", \"params\": [\"%s%s%s%s%s%s%s\"], \"id\":4}\r\n",
data_str, mtphashvalue_str, mtpreserved_str, merkleroot_str, blockmtp_str, proofmtp_str, work->txs);
Expand Down
12 changes: 6 additions & 6 deletions ccminer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.0.props" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.1.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
Expand Down Expand Up @@ -208,15 +208,15 @@
</Link>
<CudaCompile>
<CInterleavedPTX>false</CInterleavedPTX>
<MaxRegCount>80</MaxRegCount>
<PtxAsOptionV>false</PtxAsOptionV>
<MaxRegCount>128</MaxRegCount>
<PtxAsOptionV>true</PtxAsOptionV>
<Keep>true</Keep>
<CodeGeneration>compute_52,sm_52;compute_61,sm_61;compute_75,sm_75</CodeGeneration>
<Include>$(NVTOOLSEXT_PATH)\include;..\..\..\Common\C99</Include>
<Optimization>O2</Optimization>
<TargetMachinePlatform>64</TargetMachinePlatform>
<InterleaveSourceInPTX>false</InterleaveSourceInPTX>
<GenerateLineInfo>false</GenerateLineInfo>
<InterleaveSourceInPTX>true</InterleaveSourceInPTX>
<GenerateLineInfo>true</GenerateLineInfo>
</CudaCompile>
<CudaLink>
<Optimization>O3</Optimization>
Expand Down Expand Up @@ -567,7 +567,7 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.0.targets" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.1.targets" />
</ImportGroup>
<!-- Copy the required dlls -->
<Target Name="AfterBuild">
Expand Down
Loading

0 comments on commit 99951cf

Please sign in to comment.