Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
azure-cloud-mining-script
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
azure-cloud-mining-script
Commits
740cb613
There was an error fetching the commit references. Please try again later.
Commit
740cb613
authored
7 years ago
by
fireice-uk
Browse files
Options
Downloads
Patches
Plain Diff
separate nonce_ctr from result push
parent
98a4caa2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xmrstak/backend/cpu/minethd.cpp
+24
-32
24 additions, 32 deletions
xmrstak/backend/cpu/minethd.cpp
with
24 additions
and
32 deletions
xmrstak/backend/cpu/minethd.cpp
+
24
−
32
View file @
740cb613
...
...
@@ -342,34 +342,29 @@ void minethd::work_main()
continue
;
}
size_t
nonce_ctr
=
250
;
if
(
oWork
.
bNiceHash
)
result
.
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
*
piNonce
&
0xFF000000
,
4096
);
else
result
.
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
0
,
4096
);
size_t
nonce_ctr
=
0
;
constexpr
size_t
nonce_chunk
=
4096
;
// Needs to be a power of 2
assert
(
sizeof
(
job_result
::
sJobID
)
==
sizeof
(
pool_job
::
sJobID
));
memcpy
(
result
.
sJobID
,
oWork
.
sJobID
,
sizeof
(
job_result
::
sJobID
));
while
(
globalStates
::
inst
().
iGlobalJobNo
.
load
(
std
::
memory_order_relaxed
)
==
iJobNo
)
1
while
(
globalStates
::
inst
().
iGlobalJobNo
.
load
(
std
::
memory_order_relaxed
)
==
iJobNo
)
{
if
((
iCount
&
0xF
)
==
0
)
//Store stats every 16 hashes
if
((
iCount
++
&
0xF
)
==
0
)
//Store stats every 16 hashes
{
if
(
--
nonce_ctr
==
0
)
{
if
(
oWork
.
bNiceHash
)
result
.
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
*
piNonce
&
0xFF000000
,
4096
);
else
result
.
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
0
,
4096
);
nonce_ctr
=
250
;
}
using
namespace
std
::
chrono
;
uint64_t
iStamp
=
time_point_cast
<
milliseconds
>
(
high_resolution_clock
::
now
()).
time_since_epoch
().
count
();
iHashCount
.
store
(
iCount
,
std
::
memory_order_relaxed
);
iTimestamp
.
store
(
iStamp
,
std
::
memory_order_relaxed
);
}
iCount
++
;
if
((
nonce_ctr
++
&
(
nonce_chunk
-
1
))
==
0
)
{
if
(
oWork
.
bNiceHash
)
result
.
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
*
piNonce
&
0xFF000000
,
nonce_chunk
);
else
result
.
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
0
,
nonce_chunk
);
}
*
piNonce
=
++
result
.
iNonce
;
...
...
@@ -466,11 +461,8 @@ void minethd::double_work_main()
continue
;
}
size_t
nonce_ctr
=
256
;
if
(
oWork
.
bNiceHash
)
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
*
piNonce0
&
0xFF000000
,
4096
);
else
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
0
,
4096
);
size_t
nonce_ctr
=
0
;
constexpr
size_t
nonce_chunk
=
4096
;
//Needs to be a power of 2
assert
(
sizeof
(
job_result
::
sJobID
)
==
sizeof
(
pool_job
::
sJobID
));
...
...
@@ -478,22 +470,22 @@ void minethd::double_work_main()
{
if
((
iCount
&
0x7
)
==
0
)
//Store stats every 16 hashes
{
if
(
--
nonce_ctr
==
0
)
{
if
(
oWork
.
bNiceHash
)
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
*
piNonce0
&
0xFF000000
,
4096
);
else
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
0
,
4096
);
nonce_ctr
=
256
;
}
using
namespace
std
::
chrono
;
uint64_t
iStamp
=
time_point_cast
<
milliseconds
>
(
high_resolution_clock
::
now
()).
time_since_epoch
().
count
();
iHashCount
.
store
(
iCount
,
std
::
memory_order_relaxed
);
iTimestamp
.
store
(
iStamp
,
std
::
memory_order_relaxed
);
}
iCount
+=
2
;
if
((
nonce_ctr
++
&
(
nonce_chunk
/
2
-
1
))
==
0
)
{
if
(
oWork
.
bNiceHash
)
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
*
piNonce0
&
0xFF000000
,
nonce_chunk
);
else
iNonce
=
globalStates
::
inst
().
calc_start_nonce
(
0
,
nonce_chunk
);
}
*
piNonce0
=
++
iNonce
;
*
piNonce1
=
++
iNonce
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment