1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-06 23:52:38 -05:00

Compare commits

..

229 Commits

Author SHA1 Message Date
XMRig
f1b8351a63 v5.9.0 2020-03-08 13:09:51 +07:00
XMRig
a620dfc955 Merge branch 'dev' 2020-03-08 13:09:14 +07:00
XMRig
f1e688724e #1585 Fixed build without HTTP support. 2020-03-08 12:29:32 +07:00
XMRig
e8355e1a1c Sync changes with proxy. 2020-03-08 02:43:16 +07:00
XMRig
6cb27e9662 Added command line option --astrobwt-max-size 2020-03-08 00:13:47 +07:00
xmrig
5fee8ba288 Merge pull request #1584 from SChernykh/dev
Fixed invalid AstroBWT hashes after algo switching
2020-03-07 22:47:17 +07:00
SChernykh
b7840d9ab6 Fixed invalid AstroBWT hashes after algo switching 2020-03-07 16:41:33 +01:00
XMRig
d591832eea Merge branch 'feature-rx-keva' into dev 2020-03-07 21:29:29 +07:00
XMRig
13ac54ada9 v5.9.0-dev 2020-03-07 21:27:55 +07:00
XMRig
1f36ea2a8e Added "coin": "keva" and post PR cleanup. 2020-03-07 20:38:44 +07:00
XMRig
ab90af37b3 Merge branch 'master' of https://github.com/kevacoin-project/xmrig into feature-rx-keva 2020-03-07 17:13:08 +07:00
xmrig
88031650b4 Update README.md 2020-03-07 15:24:55 +07:00
XMRig
4a5493e12f Added the wizard suggestion. 2020-03-07 03:24:35 +07:00
XMRig
6a97aeaf1b v5.8.3-dev 2020-03-07 03:00:34 +07:00
XMRig
6ac3534fd5 Merge branch 'master' into dev 2020-03-07 02:59:53 +07:00
XMRig
e210067660 Merge branch 'dev' 2020-03-06 13:26:52 +07:00
xmrig
50c66083a7 Merge pull request #1582 from SChernykh/dev
Fixed compilation withut randomx/argon2
2020-03-06 13:24:49 +07:00
SChernykh
05dc9821c5 Fixed compilation withut randomx/argon2 2020-03-06 07:22:57 +01:00
XMRig
c623dc7c92 v5.8.2 2020-03-06 13:18:30 +07:00
XMRig
4a7897b8bc Merge branch 'dev' 2020-03-06 13:17:44 +07:00
xmrig
33a7530f9b Update CHANGELOG.md 2020-03-06 13:04:38 +07:00
XMRig
44f0daf384 Fixed Linux build. 2020-03-06 12:59:30 +07:00
XMRig
6a45d5dcc9 Update year. 2020-03-06 12:57:21 +07:00
XMRig
7bf12dc81f #1581 Fixed macOS build. 2020-03-06 12:51:16 +07:00
XMRig
2020b71eeb Merge branch 'feature-fetch' into dev 2020-03-06 12:45:13 +07:00
XMRig
cad5fef1ea HTTP subsystem refactoring. 2020-03-06 12:38:09 +07:00
kevacoin
56e88f57fb Fixed scratchpad L2/L3 bit, from 18, 21 to 17 and 20. 2020-03-05 11:23:49 -08:00
xmrig
bc09aa5ad0 Merge pull request #1580 from SChernykh/dev
AstroBWT 20-50% speedup
2020-03-05 18:26:19 +07:00
SChernykh
eeadea53e2 AstroBWT 20-50% speedup
Skips hashes with large stage 2 size. Added configurable `astrobwt-max-size` parameter, default value is 550, min 400, max 1200, optimal value ranges from 500 to 600 depending on CPU.

- Intel CPUs get 20-25% speedup
- 1st- and 2nd-gen Ryzens get 30% speedup
- 3rd-gen Ryzens get up to 50% speedup
2020-03-05 12:20:21 +01:00
kevacoin
0528ccd01e Added Keva. 2020-03-04 16:23:33 -08:00
XMRig
5486300db7 Code cleanup. 2020-03-04 21:00:49 +07:00
XMRig
b0dda2b5b3 http-parser updated to latest version. 2020-03-04 18:30:53 +07:00
XMRig
c80ef54b60 v5.8.2-dev 2020-03-04 12:31:27 +07:00
XMRig
31383861cd Merge branch 'master' into dev 2020-03-04 12:31:00 +07:00
XMRig
b2b18ce22d v5.8.1 2020-03-04 10:19:51 +07:00
XMRig
8496f5b631 Merge branch 'dev' 2020-03-04 10:19:14 +07:00
xmrig
ec17bc4d40 Update CHANGELOG.md 2020-03-04 00:08:38 +07:00
XMRig
5fa6a034d5 Formatting. 2020-03-04 00:06:20 +07:00
xmrig
24c25b7d2e Merge pull request #1575 from SChernykh/dev
Fixed new block detection for Dero solo mining
2020-03-04 00:03:12 +07:00
SChernykh
874cff3d51 Fixed new block detection for Dero solo mining 2020-03-03 17:53:19 +01:00
XMRig
297d884482 v5.8.1-dev 2020-03-03 23:12:13 +07:00
XMRig
26c72cd7d8 Merge branch 'master' into dev 2020-03-03 23:11:39 +07:00
XMRig
fa91cff515 v5.8.0 2020-03-03 12:09:10 +07:00
XMRig
f415814069 Merge branch 'dev' 2020-03-03 12:07:42 +07:00
xmrig
9cf78cf14b Update CHANGELOG.md 2020-03-03 10:07:44 +07:00
XMRig
8dc87576c5 Sync changes with proxy. 2020-03-01 14:04:58 +07:00
XMRig
f0db17be87 Move "Content-Type" header setting. 2020-03-01 12:57:19 +07:00
XMRig
616c52f266 #1572 Fix compile warning. 2020-03-01 11:59:53 +07:00
XMRig
5bad45925a v5.8.0-dev 2020-03-01 11:48:30 +07:00
XMRig
cdd9ea2496 Make "astrobwt" as primary user visible algorithm name. 2020-03-01 10:21:29 +07:00
SChernykh
14ef99ca67 AstroBWT algorithm (DERO) support
To test:

- Download https://github.com/deroproject/derosuite/releases/tag/AstroBWT
- Run daemon with `--testnet` in command line

In config.json:
- "coin":"dero"
- "url":"127.0.0.1:30306"
- "daemon:"true"
2020-02-29 22:41:24 +01:00
XMRig
2cd45a9e38 v5.7.1-dev 2020-02-25 15:25:31 +07:00
XMRig
a070035d97 Merge branch 'master' into dev 2020-02-25 15:24:51 +07:00
XMRig
012d7124cd v5.7.0 2020-02-25 05:41:43 +07:00
XMRig
cde1e2c5f3 Merge branch 'dev' 2020-02-25 05:41:12 +07:00
XMRig
ead441f5db Optimize file log. 2020-02-23 06:52:23 +07:00
xmrig
031e09fede Update CHANGELOG.md 2020-02-23 03:26:25 +07:00
XMRig
1ee27a564b HTTP subsystem refactoring, fixed possible crashes shortly after destroying daemon or self-select client. 2020-02-23 01:40:19 +07:00
XMRig
23c51c9a11 Fixed regression. 2020-02-22 04:51:37 +07:00
xmrig
f9e653ea9f Merge pull request #1563 from SChernykh/dev
Optimized CFROUND
2020-02-22 01:45:52 +07:00
SChernykh
131085be80 Optimized CFROUND
Shorter version using BMI2 instructionns
2020-02-21 19:00:58 +01:00
xmrig
12081e4f5b Merge pull request #1562 from SChernykh/dev
Fixed 32-bit compilation
2020-02-21 22:09:21 +07:00
SChernykh
e1b8f52e59 Fixed 32-bit compilation 2020-02-21 16:08:23 +01:00
XMRig
6dad42a4db v5.7.0-dev 2020-02-21 21:58:41 +07:00
xmrig
799d95d67a Update CHANGELOG.md 2020-02-21 21:51:29 +07:00
xmrig
b131c60f08 Merge pull request #1560 from SChernykh/dev
Tuned JIT compiler
2020-02-21 03:04:12 +07:00
SChernykh
1e2e247789 Merge branch 'dev' of https://github.com/SChernykh/xmrig into dev 2020-02-20 20:59:25 +01:00
SChernykh
0caeb41bff Tuned JIT compiler
0.3-0.4% speedup depending on CPU.
2020-02-20 20:59:22 +01:00
XMRig
fd0cbd448b Use "extra_nonce" for daemon client. 2020-02-21 01:31:22 +07:00
XMRig
bdf6e87dc5 Update default config example. 2020-02-19 01:28:13 +07:00
xmrig
88c7aca6f5 Merge pull request #1557 from SChernykh/dev
Refactored fma_soft() in randomx_vm.cl
2020-02-19 00:28:17 +07:00
SChernykh
887c891ab2 Refactored fma_soft() in randomx_vm.cl
Fixes #1554 (hopefully)
2020-02-18 18:19:03 +01:00
XMRig
2bc5fb10a7 Added "-x" and "--proxy" command line options. 2020-02-18 21:42:01 +07:00
XMRig
8497e9c54f Merge branch 'feature-socks5' into dev 2020-02-18 20:38:07 +07:00
XMRig
2e07e69697 Added IPv4 and IPv6 support for SOCKS5. 2020-02-18 19:24:49 +07:00
XMRig
2fea4e72b5 Implemented donate over SOCKS5. 2020-02-18 17:58:14 +07:00
xmrig
2863ade0c2 Merge pull request #1555 from SChernykh/dev
Fix crash when share is found before pool login
2020-02-18 02:26:40 +07:00
SChernykh
fb0b638cbb Fix crash when share is found before pool login 2020-02-17 20:22:09 +01:00
XMRig
1e2d011705 Initial SOCKS5 implementation. 2020-02-18 02:16:21 +07:00
XMRig
dfaca04167 v5.6.1-dev 2020-02-16 16:13:05 +07:00
XMRig
33b1d5f4b3 Merge branch 'master' into dev 2020-02-16 15:49:11 +07:00
XMRig
2499822106 v5.6.0 2020-02-15 21:24:56 +07:00
XMRig
9fe9e8989d Merge branch 'dev' 2020-02-15 21:23:59 +07:00
XMRig
311d3e1c18 Fixed wrong OpenCL platform on macOS. 2020-02-15 04:32:32 +07:00
XMRig
5e444553b1 Fixed build without NVML. 2020-02-15 04:07:11 +07:00
XMRig
16f011a47f v5.6.0-dev 2020-02-15 03:08:08 +07:00
xmrig
488049e695 Update CHANGELOG.md 2020-02-15 03:06:45 +07:00
XMRig
d23e5e15ba Added AMD GPUs health information for Linux (via sysfs). 2020-02-14 23:37:44 +07:00
XMRig
5ad52192fe Update year. 2020-02-14 02:41:21 +07:00
xmrig
937dc7b7c3 Merge pull request #1551 from SChernykh/dev
Added RandomX JIT for AMD Navi GPUs
2020-02-14 02:32:21 +07:00
SChernykh
7fa5e8706e Added RandomX JIT for AMD Navi GPUs 2020-02-13 20:15:08 +01:00
XMRig
2f27d5d108 Added printHealth to IBackend interface. 2020-02-14 01:11:53 +07:00
XMRig
56f23db878 Added ADL support for Windows. 2020-02-14 00:16:32 +07:00
xmrig
264e3928c2 Merge pull request #1546 from SChernykh/dev
Fixed generic OpenCL code for AMD Navi
2020-02-11 17:12:18 +07:00
SChernykh
ef629ba0d0 Fixed generic OpenCL code for AMD Navi 2020-02-10 22:00:40 +01:00
XMRig
aacdbc360b Merge branch 'bug-nonce-overflow' into dev 2020-02-06 22:00:53 +07:00
XMRig
e2e37c8cfb Fixed nicehash nonce overflow for GPU backends. 2020-02-06 22:00:03 +07:00
XMRig
c307433900 Fixed nicehash nonce overflow for CPU backend. 2020-02-06 17:19:08 +07:00
XMRig
97e6a6669f Merge branch 'network-stats' into dev 2020-02-05 18:44:43 +07:00
xmrig
e8f5cc67f8 Merge pull request #1536 from SChernykh/dev
Workaround for new AMD drivers (OpenCL)
2020-02-05 17:37:14 +07:00
SChernykh
8f9c1dd781 Workaround for new AMD drivers (OpenCL) 2020-02-04 23:11:46 +01:00
XMRig
60634366c1 v5.5.4-dev 2020-02-03 00:07:03 +07:00
XMRig
78bd280666 Merge branch 'master' into dev 2020-02-03 00:06:32 +07:00
XMRig
217540296f v5.5.3 2020-02-02 23:40:26 +07:00
XMRig
7eaabd4e00 Merge branch 'dev' 2020-02-02 23:39:49 +07:00
xmrig
ff59f3dbb4 Update CHANGELOG.md 2020-02-02 23:38:54 +07:00
xmrig
9c8da1d4d3 Merge pull request #1529 from SChernykh/dev
Crash fix for Bullodzer CPUs
2020-02-02 23:19:49 +07:00
SChernykh
ffc9f67751 Crash fix for Bullodzer CPUs 2020-02-02 17:16:59 +01:00
XMRig
bf1a0a0b83 v5.5.2 2020-02-02 13:30:29 +07:00
XMRig
f864687a96 Merge branch 'dev' 2020-02-02 13:29:13 +07:00
XMRig
030d6e5962 Update year. 2020-02-01 20:24:00 +07:00
xmrig
f609be6ec3 Update CHANGELOG.md 2020-02-01 18:47:11 +07:00
xmrig
aa4a4c9fd0 Merge pull request #1520 from SChernykh/dev
Fixed setThreadAffinity()
2020-01-29 17:48:37 +07:00
SChernykh
269d12d1be Fixed setThreadAffinity()
Added 1 ms sleep to guarantee thread rescheduling to the correct CPU core before returning.
2020-01-28 19:39:02 +01:00
xmrig
23a1ae0337 Merge pull request #1519 from SChernykh/dev
Removed MSR mod for Bulldozer
2020-01-27 22:20:21 +07:00
SChernykh
4571899664 Removed MSR mod for Bulldozer
It turned out to be useless: https://www.reddit.com/r/MoneroMining/comments/et7s7w/psa_amd_opteronfxa6a8a10_owners_needed_to_test/
2020-01-27 09:39:39 +01:00
xmrig
6d9b50b938 Merge pull request #1516 from SChernykh/dev
Fix compile error
2020-01-24 20:52:29 +07:00
SChernykh
cd763be05b Fix compile error 2020-01-24 14:09:07 +01:00
xmrig
4e6b24d67d Merge pull request #1515 from SChernykh/dev
Fix crash on Linux
2020-01-24 19:35:40 +07:00
SChernykh
42a7194e93 Fix crash on Linux 2020-01-24 13:34:12 +01:00
xmrig
01e063f6f5 Update CHANGELOG.md 2020-01-24 11:42:32 +07:00
xmrig
81e3f6e7d9 Merge pull request #1510 from SChernykh/dev
Optimized CFROUND
2020-01-23 12:49:13 +07:00
SChernykh
9f1753cc4f Optimized CFROUND 2020-01-22 20:11:00 +01:00
xmrig
39eafc3255 Merge pull request #1508 from SChernykh/dev
Added support for BMI2 instructions
2020-01-22 12:00:45 +07:00
SChernykh
d342968211 Added support for BMI2 instructions 2020-01-21 19:44:56 +01:00
XMRig
c5968e8896 New NetworkState. 2020-01-16 21:48:39 +07:00
xmrig
8e6f4d4ecb Merge pull request #1502 from SChernykh/dev
Optimizations for AMD Bulldozer
2020-01-15 20:26:06 +07:00
SChernykh
f80177cbd3 Optimizations for AMD Bulldozer
- Added support for XOP instructions
- Enabled Ryzen code for Bulldozer because it's faster there too
2020-01-15 13:04:26 +01:00
xmrig
32b0314990 Merge pull request #1501 from SChernykh/dev
MSR preset for Bulldozer CPUs
2020-01-15 08:57:14 +07:00
SChernykh
665e43fecc MSR preset for Bulldozer CPUs
Also fixed verbose output for MSR presets with masks.
2020-01-14 19:27:34 +01:00
xmrig
b5fb96dca0 Merge pull request #1500 from SChernykh/dev
JIT compiler: removed unnecessary memcpy from generateProgram()
2020-01-14 07:59:08 +07:00
SChernykh
73722ce186 JIT compiler: removed unnecessary memcpy from generateProgram() 2020-01-13 18:00:41 +01:00
XMRig
638ed7b4f2 v5.5.2-dev 2020-01-12 12:55:50 +07:00
XMRig
b5b12216d6 Merge branch 'master' into dev 2020-01-12 12:55:04 +07:00
xmrig
d2867a2ed8 Merge pull request #1495 from jtgrassie/missed-script-change
add intel change to boost script
2020-01-12 09:56:37 +07:00
Jethro Grassie
e290995999 add change to boost script 2020-01-11 21:42:48 -05:00
XMRig
9ae8907b3e v5.5.1 2020-01-12 08:34:01 +07:00
XMRig
a80f3e8190 Merge branch 'dev' 2020-01-12 08:32:16 +07:00
xmrig
b3d1ca6cb2 Update CHANGELOG.md 2020-01-12 07:43:29 +07:00
xmrig
0290b1ed3c Merge pull request #1493 from SChernykh/dev
Update MSR preset for Intel
2020-01-09 14:24:11 +07:00
SChernykh
869209389e Update MSR preset for Intel
As per https://github.com/xmrig/xmrig/issues/1433#issuecomment-572126184
2020-01-09 08:10:36 +01:00
XMRig
c6530e352f Code cleanup. 2020-01-07 10:13:01 +07:00
xmrig
706f588b36 Merge pull request #1489 from SChernykh/dev
JIT compiler tweaks
2020-01-07 02:41:40 +07:00
SChernykh
eb20dfbc94 JIT compiler tweaks 2020-01-06 13:57:48 +01:00
xmrig
f69ba3ea1d Update CHANGELOG.md 2020-01-03 19:54:28 +07:00
XMRig
88ff807700 Fix compile warnings. 2020-01-03 19:11:48 +07:00
XMRig
e76e75cdff Merge branch 'dev' of github.com:xmrig/xmrig into dev 2020-01-03 05:36:47 +07:00
XMRig
083c61754b Fixed unwanted resume after dataset change. 2020-01-03 05:36:22 +07:00
xmrig
146bbda33f Merge pull request #1477 from SChernykh/dev
Refactor Ryzen fix to fix compilation issues
2019-12-31 17:07:37 +07:00
SChernykh
c9f90e6770 Refactor Ryzen fix to fix compilation issues 2019-12-31 11:55:07 +02:00
xmrig
6a2a8579ae Merge pull request #1473 from SChernykh/dev
Auto-config for mobile Ryzen APUs
2019-12-31 02:36:30 +07:00
SChernykh
29dd2c2138 Cleanup 2019-12-30 20:55:03 +02:00
SChernykh
4e5aef0a8a Auto-config for mobile Ryzen APUs 2019-12-30 20:53:21 +02:00
XMRig
039c42b1fe v5.5.1-dev 2019-12-30 16:05:51 +07:00
XMRig
1e45349890 Merge branch 'master' into dev 2019-12-30 16:05:24 +07:00
XMRig
d64bbfa9c0 #1469 Fixed build with gcc 4.8. 2019-12-30 16:04:07 +07:00
XMRig
d5605a29b4 v5.5.0 2019-12-29 21:42:11 +07:00
XMRig
4c28fa6009 Merge branch 'dev' 2019-12-29 21:41:40 +07:00
XMRig
ad9ae6a143 Merge branch 'dev' of github.com:xmrig/xmrig into dev 2019-12-29 15:36:39 +07:00
XMRig
a5b0bc04cc Add "cn/ultra" alias for tlo-pool.raasu.org pool. 2019-12-29 15:36:05 +07:00
xmrig
f491e99bf9 Update CHANGELOG.md 2019-12-29 03:43:10 +07:00
XMRig
402c44b547 Added "cn-pico/tlo". 2019-12-29 00:29:19 +07:00
XMRig
ac4086b273 Fix build. 2019-12-28 02:00:08 +07:00
XMRig
f00769f758 Code style cleanup. 2019-12-28 01:45:54 +07:00
xmrig
6ceb4dfc4f Merge pull request #1465 from SChernykh/dev
Fix for 1st-gen Ryzen crashes
2019-12-27 18:26:26 +07:00
SChernykh
3a2941b719 Fix for 1st-gen Ryzen crashes 2019-12-27 12:40:38 +02:00
xmrig
99826a6b51 Update CHANGELOG.md 2019-12-27 15:03:24 +07:00
XMRig
4a9a7434f6 Revert Platform::setProcessPriority 2019-12-27 03:19:03 +07:00
XMRig
dbb721cb5e Removed "rx/v" algorithm. 2019-12-26 22:34:19 +07:00
xmrig
2a93bb2cee Update CHANGELOG.md 2019-12-25 05:01:19 +07:00
XMRig
7dfb4d9dc0 v5.5.0-dev 2019-12-25 04:53:38 +07:00
XMRig
22eca8e0d5 Fixed memory allocation checks. 2019-12-25 04:39:21 +07:00
XMRig
ecb46643e2 Added support for alternative CUDA plugin API. 2019-12-25 00:35:43 +07:00
xmrig
73d959a259 Update ALGORITHMS.md 2019-12-24 03:48:39 +07:00
XMRig
a95b179a60 Merge branch 'dev' of github.com:xmrig/xmrig into dev 2019-12-24 02:05:00 +07:00
XMRig
2e4a83547d Add console title for Windows. 2019-12-24 02:04:34 +07:00
xmrig
fd30294ca0 Merge pull request #1461 from suanlian1/patch-1
Monero already changed PoW on Nov 30, 2019
2019-12-24 01:07:44 +07:00
sairog
9b16a2736a Update README.md
Monero already changed PoW on Nov 30, 2019. Also minor text corrections.
2019-12-23 23:23:16 +05:30
XMRig
ea7aa4ccef Fixed MSVC build. 2019-12-23 00:37:43 +07:00
XMRig
d81845e1ab Merge branch 'feature-env' into dev 2019-12-23 00:29:38 +07:00
XMRig
f9d07229b4 Add extra variables. 2019-12-23 00:28:57 +07:00
XMRig
2d15c10e0f Added ENV support for "loader" option. 2019-12-22 19:48:33 +07:00
XMRig
5bd6a1c028 Added ENV support for "user", "pass" and "rig-id" fields. 2019-12-22 19:09:30 +07:00
XMRig
356e666e61 Added Env class. 2019-12-22 18:09:26 +07:00
XMRig
bdf12bca0f Make Process::location static. 2019-12-22 13:26:06 +07:00
XMRig
c44ae06d54 Added --randomx-no-rdmsr command line option. 2019-12-21 23:57:25 +07:00
XMRig
c7de9e6561 v5.4.1-dev 2019-12-21 23:42:18 +07:00
XMRig
00c9f89213 Merge branch 'master' into dev 2019-12-21 23:41:44 +07:00
XMRig
8f2a92c3ec v5.4.0 2019-12-21 16:12:02 +07:00
XMRig
69e67784d3 Merge branch 'dev' 2019-12-21 16:11:25 +07:00
xmrig
cd7f73a31c Update ALGORITHMS.md 2019-12-21 13:40:42 +07:00
XMRig
98cfe7ed37 Added extra error message. 2019-12-20 23:44:32 +07:00
XMRig
449617d717 Allow use old CUDA plugin. 2019-12-20 21:10:13 +07:00
xmrig
a25042db72 Update CHANGELOG.md 2019-12-20 04:16:28 +07:00
XMRig
049caabdae Add missing algorithm name alias. 2019-12-20 04:08:47 +07:00
XMRig
81b1cccb0b Merge branch 'Spudz76-dev-rxv' into dev 2019-12-20 04:06:25 +07:00
XMRig
2911bb3a81 Fix OpenCL. 2019-12-20 04:05:09 +07:00
Tony Butler
45412a2ace Add MoneroV (rx/v) algorithm [based on MoneroOcean/master] 2019-12-18 16:17:22 -07:00
XMRig
f4cedd7b63 Fixed MsrItem serialization. 2019-12-19 03:49:32 +07:00
XMRig
3e3d34b3ce Allow number value for "wrmsr" option only for Intel. 2019-12-19 03:28:05 +07:00
XMRig
12fb27e2cf Use MsrItem::kNoMask. 2019-12-19 03:20:48 +07:00
xmrig
a1e8c1353f Merge pull request #1443 from SChernykh/dev
Fixed crash with GCC compiler
2019-12-18 23:45:36 +07:00
SChernykh
c01c035269 Fixed crash with GCC compiler 2019-12-18 17:32:57 +01:00
xmrig
eeb8bbe5bc Merge pull request #1439 from SChernykh/dev
Add vzeroupper for processors with AVX
2019-12-18 18:32:17 +07:00
SChernykh
f85aba5d21 Fixed AVX detection 2019-12-18 12:20:21 +01:00
SChernykh
f8bf8fddd9 Update jit_compiler_x86_static.S 2019-12-18 09:13:21 +01:00
SChernykh
7459677fd5 Add vzeroupper for processors with AVX
To avoid false dependencies on upper 128 bits of YMM registers.
2019-12-18 09:12:25 +01:00
xmrig
c0b0628d59 Merge pull request #1438 from SChernykh/dev
Added bit masks for MSR registers
2019-12-18 11:44:06 +07:00
SChernykh
59e8fdb9ed Added bit masks for MSR registers 2019-12-17 23:55:22 +01:00
XMRig
5142a406b0 Less error prone log interface. 2019-12-18 02:20:31 +07:00
XMRig
3cc8b19ca0 Added command line option --verbose. 2019-12-17 22:03:50 +07:00
XMRig
f8865b1498 Added "verbose" option. 2019-12-17 21:46:11 +07:00
XMRig
969821296f Merge branch 'feature-custom-msr' into dev 2019-12-17 16:53:28 +07:00
XMRig
a877b1d269 Added save/restore MSR registers on Linux. 2019-12-17 16:17:11 +07:00
XMRig
9cea70b77c Rename Rx_windows.cpp to Rx_win.cpp. 2019-12-17 15:16:37 +07:00
XMRig
d2d501c821 Added RandomX option "rdmsr" and save/restore MSR registers on Windows. 2019-12-17 14:45:01 +07:00
XMRig
a5089638ea #1421 Added limit for maximum send buffer size. 2019-12-17 03:18:25 +07:00
XMRig
17f82280d0 v5.4.0-dev 2019-12-17 02:52:47 +07:00
xmrig
c78d800392 Merge pull request #1434 from SChernykh/dev
RandomSFX (Safex Cash variant) support
2019-12-17 02:46:26 +07:00
XMRig
8bef964f68 Added support for write custom MSR. 2019-12-17 02:27:07 +07:00
SChernykh
4da37baf8c RandomSFX (Safex Cash variant) support 2019-12-16 19:36:29 +01:00
XMRig
33e7a54c29 #1421 Use dynamic size send buffer. 2019-12-16 14:09:03 +07:00
XMRig
1d4c8dda96 #1423 Implemented driver reuse. 2019-12-16 03:41:58 +07:00
XMRig
b633b593ad Strict wrmsr error handling. 2019-12-16 02:45:07 +07:00
XMRig
8dbb83f99b Revert changes. 2019-12-16 02:17:57 +07:00
xmrig
f24e4f6462 Merge pull request #1424 from SChernykh/dev
Use unique service name for WinRing0 driver
2019-12-16 01:32:32 +07:00
SChernykh
2e001677df Use unique service name for WinRing0 driver
To avoid error 1072
2019-12-15 19:28:14 +01:00
XMRig
be253808d4 v5.3.1-dev 2019-12-16 00:17:08 +07:00
XMRig
e07cbe858b Merge branch 'master' into dev 2019-12-16 00:15:49 +07:00
241 changed files with 20359 additions and 7397 deletions

View File

@@ -1,3 +1,72 @@
# v5.9.0
- [#1578](https://github.com/xmrig/xmrig/pull/1578) Added new RandomKEVA algorithm for upcoming Kevacoin fork, as `"algo": "rx/keva"` or `"coin": "keva"`.
- [#1584](https://github.com/xmrig/xmrig/pull/1584) Fixed invalid AstroBWT hashes after algorithm switching.
- [#1585](https://github.com/xmrig/xmrig/issues/1585) Fixed build without HTTP support.
- Added command line option `--astrobwt-max-size`.
# v5.8.2
- [#1580](https://github.com/xmrig/xmrig/pull/1580) AstroBWT algorithm 20-50% speedup.
- Added new option `astrobwt-max-size`.
- [#1581](https://github.com/xmrig/xmrig/issues/1581) Fixed macOS build.
# v5.8.1
- [#1575](https://github.com/xmrig/xmrig/pull/1575) Fixed new block detection for DERO solo mining.
# v5.8.0
- [#1573](https://github.com/xmrig/xmrig/pull/1573) Added new AstroBWT algorithm for upcoming DERO fork, as `"algo": "astrobwt"` or `"coin": "dero"`.
# v5.7.0
- **Added SOCKS5 proxies support for Tor https://xmrig.com/docs/miner/tor.**
- [#377](https://github.com/xmrig/xmrig-proxy/issues/377) Fixed duplicate jobs in daemon (solo) mining client.
- [#1560](https://github.com/xmrig/xmrig/pull/1560) RandomX 0.3-0.4% speedup depending on CPU.
- Fixed possible crashes in HTTP client.
# v5.6.0
- [#1536](https://github.com/xmrig/xmrig/pull/1536) Added workaround for new AMD GPU drivers.
- [#1546](https://github.com/xmrig/xmrig/pull/1546) Fixed generic OpenCL code for AMD Navi GPUs.
- [#1551](https://github.com/xmrig/xmrig/pull/1551) Added RandomX JIT for AMD Navi GPUs.
- Added health information for AMD GPUs (clocks/power/fan/temperature) via ADL (Windows) and sysfs (Linux).
- Fixed possible nicehash nonce overflow in some conditions.
- Fixed wrong OpenCL platform on macOS, option `platform` now ignored on this OS.
# v5.5.3
- [#1529](https://github.com/xmrig/xmrig/pull/1529) Fixed crash on Bulldozer CPUs.
# v5.5.2
- [#1500](https://github.com/xmrig/xmrig/pull/1500) Removed unnecessary code from RandomX JIT compiler.
- [#1502](https://github.com/xmrig/xmrig/pull/1502) Optimizations for AMD Bulldozer.
- [#1508](https://github.com/xmrig/xmrig/pull/1508) Added support for BMI2 instructions.
- [#1510](https://github.com/xmrig/xmrig/pull/1510) Optimized `CFROUND` instruction for RandomX.
- [#1520](https://github.com/xmrig/xmrig/pull/1520) Fixed thread affinity.
# v5.5.1
- [#1469](https://github.com/xmrig/xmrig/issues/1469) Fixed build with gcc 4.8.
- [#1473](https://github.com/xmrig/xmrig/pull/1473) Added RandomX auto-config for mobile Ryzen APUs.
- [#1477](https://github.com/xmrig/xmrig/pull/1477) Fixed build with Clang.
- [#1489](https://github.com/xmrig/xmrig/pull/1489) RandomX JIT compiler tweaks.
- [#1493](https://github.com/xmrig/xmrig/pull/1493) Default value for Intel MSR preset changed to `15`.
- Fixed unwanted resume after RandomX dataset change.
# v5.5.0
- [#179](https://github.com/xmrig/xmrig/issues/179) Added support for [environment variables](https://xmrig.com/docs/miner/environment-variables) in config file.
- [#1445](https://github.com/xmrig/xmrig/pull/1445) Removed `rx/v` algorithm.
- [#1453](https://github.com/xmrig/xmrig/issues/1453) Fixed crash on 32bit systems.
- [#1459](https://github.com/xmrig/xmrig/issues/1459) Fixed crash on very low memory systems.
- [#1465](https://github.com/xmrig/xmrig/pull/1465) Added fix for 1st-gen Ryzen crashes.
- [#1466](https://github.com/xmrig/xmrig/pull/1466) Added `cn-pico/tlo` algorithm.
- Added `--randomx-no-rdmsr` command line option.
- Added console title for Windows with miner name and version.
- On Windows `priority` option now also change base priority.
# v5.4.0
- [#1434](https://github.com/xmrig/xmrig/pull/1434) Added RandomSFX (`rx/sfx`) algorithm for Safex Cash.
- [#1445](https://github.com/xmrig/xmrig/pull/1445) Added RandomV (`rx/v`) algorithm for *new* MoneroV.
- [#1419](https://github.com/xmrig/xmrig/issues/1419) Added reverting MSR changes on miner exit, use `"rdmsr": false,` in `"randomx"` object to disable this feature.
- [#1423](https://github.com/xmrig/xmrig/issues/1423) Fixed conflicts with exists WinRing0 driver service.
- [#1425](https://github.com/xmrig/xmrig/issues/1425) Fixed crash on first generation Zen CPUs (MSR mod accidentally enable Opcache), additionally now you can disable Opcache and enable MSR mod via config `"wrmsr": ["0xc0011020:0x0", "0xc0011021:0x60", "0xc0011022:0x510000", "0xc001102b:0x1808cc16"],`.
- Added advanced usage for `wrmsr` option, for example: `"wrmsr": ["0x1a4:0x6"],` (Intel) and `"wrmsr": ["0xc0011020:0x0", "0xc0011021:0x40:0xffffffffffffffdf", "0xc0011022:0x510000", "0xc001102b:0x1808cc16"],` (Ryzen).
- Added new config option `"verbose"` and command line option `--verbose`.
# v5.3.0
- [#1414](https://github.com/xmrig/xmrig/pull/1414) Added native MSR support for Windows, by using signed **WinRing0 driver** (© 2007-2009 OpenLibSys.org).
- Added new [MSR documentation](https://xmrig.com/docs/miner/randomx-optimization-guide/msr).

View File

@@ -9,14 +9,18 @@ option(WITH_CN_PICO "Enable CryptoNight-Pico algorithm" ON)
option(WITH_CN_GPU "Enable CryptoNight-GPU algorithm" ON)
option(WITH_RANDOMX "Enable RandomX algorithms family" ON)
option(WITH_ARGON2 "Enable Argon2 algorithms family" ON)
option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON)
option(WITH_HTTP "Enable HTTP protocol support (client/server)" ON)
option(WITH_DEBUG_LOG "Enable debug log output" OFF)
option(WITH_TLS "Enable OpenSSL support" ON)
option(WITH_ASM "Enable ASM PoW implementations" ON)
option(WITH_MSR "Enable MSR mod & 1st-gen Ryzen fix" ON)
option(WITH_ENV_VARS "Enable environment variables support in config file" ON)
option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
option(WITH_OPENCL "Enable OpenCL backend" ON)
option(WITH_CUDA "Enable CUDA backend" ON)
option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" ON)
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" ON)
option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON)
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
@@ -51,7 +55,6 @@ set(HEADERS
src/net/JobResult.h
src/net/JobResults.h
src/net/Network.h
src/net/NetworkState.h
src/net/strategies/DonateStrategy.h
src/Summary.h
src/version.h
@@ -101,7 +104,6 @@ set(SOURCES
src/core/Miner.cpp
src/net/JobResults.cpp
src/net/Network.cpp
src/net/NetworkState.cpp
src/net/strategies/DonateStrategy.cpp
src/Summary.cpp
src/xmrig.cpp
@@ -175,6 +177,7 @@ find_package(UV REQUIRED)
include(cmake/flags.cmake)
include(cmake/randomx.cmake)
include(cmake/argon2.cmake)
include(cmake/astrobwt.cmake)
include(cmake/OpenSSL.cmake)
include(cmake/asm.cmake)
include(cmake/cn-gpu.cmake)

View File

@@ -1,7 +1,5 @@
# XMRig
**:warning: [Monero will change PoW algorithm to RandomX on November 30.](https://github.com/xmrig/xmrig/issues/1204)**
[![Github All Releases](https://img.shields.io/github/downloads/xmrig/xmrig/total.svg)](https://github.com/xmrig/xmrig/releases)
[![GitHub release](https://img.shields.io/github/release/xmrig/xmrig/all.svg)](https://github.com/xmrig/xmrig/releases)
[![GitHub Release Date](https://img.shields.io/github/release-date-pre/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/releases)
@@ -9,7 +7,7 @@
[![GitHub stars](https://img.shields.io/github/stars/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/network)
XMRig High performance, open source, cross platform RandomX, CryptoNight and Argon2 CPU/GPU miner, with official support for Windows.
XMRig High performance, open source, cross platform RandomX, CryptoNight, AstroBWT and Argon2 CPU/GPU miner, with official support for Windows.
## Mining backends
- **CPU** (x64/x86/ARM)
@@ -38,7 +36,8 @@ Network:
-u, --user=USERNAME username for mining server
-p, --pass=PASSWORD password for mining server
-O, --userpass=U:P username:password pair for mining server
-k, --keepalive send keepalived packet for prevent timeout (needs pool support)
-x, --proxy=HOST:PORT connect through a SOCKS5 proxy
-k, --keepalive send keepalive packet for prevent timeout (needs pool support)
--nicehash enable nicehash.com support
--rig-id=ID rig identifier for pool-side statistics (needs pool support)
--tls enable SSL/TLS support (needs pool support)
@@ -62,11 +61,13 @@ CPU backend:
--cpu-no-yield prefer maximum hashrate rather than system response/stability
--no-huge-pages disable huge pages support
--asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer
--randomx-init=N threads count to initialize RandomX dataset
--randomx-init=N thread count to initialize RandomX dataset
--randomx-no-numa disable NUMA support for RandomX
--randomx-mode=MODE RandomX mode: auto, fast, light
--randomx-1gb-pages use 1GB hugepages for dataset (Linux only)
--randomx-wrmsr=N write value (0-15) to Intel MSR register 0x1a4 or do nothing (-1) (Linux only)
--randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)
--randomx-no-rdmsr disable reverting initial MSR values on exit
--astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200
API:
--api-worker-id=ID custom worker-id for API
@@ -98,6 +99,7 @@ Logging:
--print-time=N print hashrate report every N seconds
--health-print-time=N print health report every N seconds
--no-color disable colored output
--verbose verbose output
Misc:
-c, --config=FILE load a JSON-format configuration file

36
cmake/astrobwt.cmake Normal file
View File

@@ -0,0 +1,36 @@
if (WITH_ASTROBWT)
add_definitions(/DXMRIG_ALGO_ASTROBWT)
list(APPEND HEADERS_CRYPTO
src/crypto/astrobwt/AstroBWT.h
src/crypto/astrobwt/sha3.h
)
list(APPEND SOURCES_CRYPTO
src/crypto/astrobwt/AstroBWT.cpp
src/crypto/astrobwt/sha3.cpp
)
if (XMRIG_ARM)
list(APPEND HEADERS_CRYPTO
src/crypto/astrobwt/salsa20_ref/ecrypt-config.h
src/crypto/astrobwt/salsa20_ref/ecrypt-machine.h
src/crypto/astrobwt/salsa20_ref/ecrypt-portable.h
src/crypto/astrobwt/salsa20_ref/ecrypt-sync.h
)
list(APPEND SOURCES_CRYPTO
src/crypto/astrobwt/salsa20_ref/salsa20.c
)
else()
list(APPEND HEADERS_CRYPTO
src/crypto/astrobwt/Salsa20.hpp
)
list(APPEND SOURCES_CRYPTO
src/crypto/astrobwt/Salsa20.cpp
)
endif()
else()
remove_definitions(/DXMRIG_ALGO_ASTROBWT)
endif()

View File

@@ -79,10 +79,23 @@ if (WITH_RANDOMX)
)
endif()
if (WIN32)
list(APPEND SOURCES_CRYPTO src/crypto/rx/Rx_windows.cpp)
elseif (XMRIG_OS_LINUX AND NOT XMRIG_ARM)
list(APPEND SOURCES_CRYPTO src/crypto/rx/Rx_linux.cpp)
if (WITH_MSR AND NOT XMRIG_ARM AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND (XMRIG_OS_WIN OR XMRIG_OS_LINUX))
add_definitions(/DXMRIG_FEATURE_MSR)
add_definitions(/DXMRIG_FIX_RYZEN)
message("-- WITH_MSR=ON")
if (XMRIG_OS_WIN)
list(APPEND SOURCES_CRYPTO src/crypto/rx/Rx_win.cpp)
elseif (XMRIG_OS_LINUX)
list(APPEND SOURCES_CRYPTO src/crypto/rx/Rx_linux.cpp)
endif()
list(APPEND HEADERS_CRYPTO src/crypto/rx/msr/MsrItem.h)
list(APPEND SOURCES_CRYPTO src/crypto/rx/msr/MsrItem.cpp)
else()
remove_definitions(/DXMRIG_FEATURE_MSR)
remove_definitions(/DXMRIG_FIX_RYZEN)
message("-- WITH_MSR=OFF")
endif()
else()
remove_definitions(/DXMRIG_ALGO_RANDOMX)

View File

@@ -12,6 +12,8 @@ Option `coin` useful for pools without algorithm negotiation support or daemon t
| Name | Memory | Version | Notes |
|------|--------|---------|-------|
| `rx/sfx` | 2 MB | 5.4.0+ | RandomSFX (RandomX variant for Safex). |
| `rx/v` | 2 MB | 5.4.0+ | RandomV (RandomX variant for new MoneroV). |
| `rx/arq` | 256 KB | 4.3.0+ | RandomARQ (RandomX variant for ArQmA). |
| `rx/0` | 2 MB | 3.2.0+ | RandomX (Monero). |
| `argon2/chukwa` | 512 KB | 3.1.0+ | Argon2id (Chukwa). |
@@ -23,7 +25,6 @@ Option `coin` useful for pools without algorithm negotiation support or daemon t
| `cn/zls` | 2 MB | 2.14.0+ | CryptoNight variant 2 with 3/4 iterations. |
| `cn/double` | 2 MB | 2.14.0+ | CryptoNight variant 2 with double iterations. |
| `cn/r` | 2 MB | 2.13.0+ | CryptoNightR (Monero's variant 4). |
| `cn/wow` | 2 MB | 2.12.0+ | CryptoNightR (Wownero). |
| `cn/gpu` | 2 MB | 2.11.0+ | CryptoNight-GPU. |
| `cn-pico` | 256 KB | 2.10.0+ | CryptoNight-Pico. |
| `cn/half` | 2 MB | 2.9.0+ | CryptoNight variant 2 with half iterations. |

View File

@@ -60,6 +60,7 @@ function rx()
'randomx_constants_wow.h',
'randomx_constants_loki.h',
'randomx_constants_arqma.h',
'randomx_constants_keva.h',
'aes.cl',
'blake2b.cl',
'randomx_vm.cl',

View File

@@ -13,7 +13,7 @@ if cat /proc/cpuinfo | grep "AMD Ryzen" > /dev/null;
elif cat /proc/cpuinfo | grep "Intel" > /dev/null;
then
echo "Detected Intel"
wrmsr -a 0x1a4 6
wrmsr -a 0x1a4 0xf
echo "MSR register values for Intel applied"
else
echo "No supported CPU detected"

2342
src/3rdparty/adl/adl_defines.h vendored Normal file

File diff suppressed because it is too large Load Diff

44
src/3rdparty/adl/adl_sdk.h vendored Normal file
View File

@@ -0,0 +1,44 @@
//
// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
//
// MIT LICENSE:
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
/// \file adl_sdk.h
/// \brief Contains the definition of the Memory Allocation Callback.\n <b>Included in ADL SDK</b>
///
/// \n\n
/// This file contains the definition of the Memory Allocation Callback.\n
/// It also includes definitions of the respective structures and constants.\n
/// <b> This is the only header file to be included in a C/C++ project using ADL </b>
#ifndef ADL_SDK_H_
#define ADL_SDK_H_
#include "adl_structures.h"
#if defined (LINUX)
#define __stdcall
#endif /* (LINUX) */
/// Memory Allocation Call back
typedef void* ( __stdcall *ADL_MAIN_MALLOC_CALLBACK )( int );
#endif /* ADL_SDK_H_ */

3440
src/3rdparty/adl/adl_structures.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -381,7 +381,10 @@ enum header_states
, h_transfer_encoding
, h_upgrade
, h_matching_transfer_encoding_token_start
, h_matching_transfer_encoding_chunked
, h_matching_transfer_encoding_token
, h_matching_connection_token_start
, h_matching_connection_keep_alive
, h_matching_connection_close
@@ -1257,9 +1260,9 @@ reexecute:
switch (parser->header_state) {
case h_general: {
size_t limit = data + len - p;
limit = MIN(limit, max_header_size);
while (p+1 < data + limit && TOKEN(p[1])) {
size_t left = data + len - p;
const char* pe = p + MIN(left, max_header_size);
while (p+1 < pe && TOKEN(p[1])) {
p++;
}
break;
@@ -1335,6 +1338,7 @@ reexecute:
parser->header_state = h_general;
} else if (parser->index == sizeof(TRANSFER_ENCODING)-2) {
parser->header_state = h_transfer_encoding;
parser->flags |= F_TRANSFER_ENCODING;
}
break;
@@ -1416,10 +1420,14 @@ reexecute:
if ('c' == c) {
parser->header_state = h_matching_transfer_encoding_chunked;
} else {
parser->header_state = h_general;
parser->header_state = h_matching_transfer_encoding_token;
}
break;
/* Multi-value `Transfer-Encoding` header */
case h_matching_transfer_encoding_token_start:
break;
case h_content_length:
if (UNLIKELY(!IS_NUM(ch))) {
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
@@ -1496,28 +1504,25 @@ reexecute:
switch (h_state) {
case h_general:
{
const char* p_cr;
const char* p_lf;
size_t limit = data + len - p;
{
size_t left = data + len - p;
const char* pe = p + MIN(left, max_header_size);
limit = MIN(limit, max_header_size);
p_cr = (const char*) memchr(p, CR, limit);
p_lf = (const char*) memchr(p, LF, limit);
if (p_cr != NULL) {
if (p_lf != NULL && p_cr >= p_lf)
p = p_lf;
else
p = p_cr;
} else if (UNLIKELY(p_lf != NULL)) {
p = p_lf;
} else {
p = data + len;
for (; p != pe; p++) {
ch = *p;
if (ch == CR || ch == LF) {
--p;
break;
}
if (!lenient && !IS_HEADER_CHAR(ch)) {
SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
goto error;
}
}
if (p == data + len)
--p;
break;
}
--p;
break;
}
case h_connection:
case h_transfer_encoding:
@@ -1566,16 +1571,41 @@ reexecute:
goto error;
/* Transfer-Encoding: chunked */
case h_matching_transfer_encoding_token_start:
/* looking for 'Transfer-Encoding: chunked' */
if ('c' == c) {
h_state = h_matching_transfer_encoding_chunked;
} else if (STRICT_TOKEN(c)) {
/* TODO(indutny): similar code below does this, but why?
* At the very least it seems to be inconsistent given that
* h_matching_transfer_encoding_token does not check for
* `STRICT_TOKEN`
*/
h_state = h_matching_transfer_encoding_token;
} else if (c == ' ' || c == '\t') {
/* Skip lws */
} else {
h_state = h_general;
}
break;
case h_matching_transfer_encoding_chunked:
parser->index++;
if (parser->index > sizeof(CHUNKED)-1
|| c != CHUNKED[parser->index]) {
h_state = h_general;
h_state = h_matching_transfer_encoding_token;
} else if (parser->index == sizeof(CHUNKED)-2) {
h_state = h_transfer_encoding_chunked;
}
break;
case h_matching_transfer_encoding_token:
if (ch == ',') {
h_state = h_matching_transfer_encoding_token_start;
parser->index = 0;
}
break;
case h_matching_connection_token_start:
/* looking for 'Connection: keep-alive' */
if (c == 'k') {
@@ -1634,7 +1664,7 @@ reexecute:
break;
case h_transfer_encoding_chunked:
if (ch != ' ') h_state = h_general;
if (ch != ' ') h_state = h_matching_transfer_encoding_token;
break;
case h_connection_keep_alive:
@@ -1768,12 +1798,17 @@ reexecute:
REEXECUTE();
}
/* Cannot use chunked encoding and a content-length header together
per the HTTP specification. */
if ((parser->flags & F_CHUNKED) &&
/* Cannot us transfer-encoding and a content-length header together
per the HTTP specification. (RFC 7230 Section 3.3.3) */
if ((parser->flags & F_TRANSFER_ENCODING) &&
(parser->flags & F_CONTENTLENGTH)) {
SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
goto error;
/* Allow it for lenient parsing as long as `Transfer-Encoding` is
* not `chunked`
*/
if (!lenient || (parser->flags & F_CHUNKED)) {
SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
goto error;
}
}
UPDATE_STATE(s_headers_done);
@@ -1848,8 +1883,31 @@ reexecute:
UPDATE_STATE(NEW_MESSAGE());
CALLBACK_NOTIFY(message_complete);
} else if (parser->flags & F_CHUNKED) {
/* chunked encoding - ignore Content-Length header */
/* chunked encoding - ignore Content-Length header,
* prepare for a chunk */
UPDATE_STATE(s_chunk_size_start);
} else if (parser->flags & F_TRANSFER_ENCODING) {
if (parser->type == HTTP_REQUEST && !lenient) {
/* RFC 7230 3.3.3 */
/* If a Transfer-Encoding header field
* is present in a request and the chunked transfer coding is not
* the final encoding, the message body length cannot be determined
* reliably; the server MUST respond with the 400 (Bad Request)
* status code and then close the connection.
*/
SET_ERRNO(HPE_INVALID_TRANSFER_ENCODING);
RETURN(p - data); /* Error */
} else {
/* RFC 7230 3.3.3 */
/* If a Transfer-Encoding header field is present in a response and
* the chunked transfer coding is not the final encoding, the
* message body length is determined by reading the connection until
* it is closed by the server.
*/
UPDATE_STATE(s_body_identity_eof);
}
} else {
if (parser->content_length == 0) {
/* Content-Length header given but zero: Content-Length: 0\r\n */
@@ -2103,6 +2161,12 @@ http_message_needs_eof (const http_parser *parser)
return 0;
}
/* RFC 7230 3.3.3, see `s_headers_almost_done` */
if ((parser->flags & F_TRANSFER_ENCODING) &&
(parser->flags & F_CHUNKED) == 0) {
return 1;
}
if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
return 0;
}

View File

@@ -27,7 +27,7 @@ extern "C" {
/* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 9
#define HTTP_PARSER_VERSION_PATCH 0
#define HTTP_PARSER_VERSION_PATCH 3
#include <stddef.h>
#if defined(_WIN32) && !defined(__MINGW32__) && \
@@ -225,6 +225,7 @@ enum flags
, F_UPGRADE = 1 << 5
, F_SKIPBODY = 1 << 6
, F_CONTENTLENGTH = 1 << 7
, F_TRANSFER_ENCODING = 1 << 8
};
@@ -271,6 +272,8 @@ enum flags
"unexpected content-length header") \
XX(INVALID_CHUNK_SIZE, \
"invalid character in chunk size header") \
XX(INVALID_TRANSFER_ENCODING, \
"request has invalid transfer-encoding") \
XX(INVALID_CONSTANT, "invalid constant string") \
XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\
XX(STRICT, "strict mode assertion failed") \
@@ -293,11 +296,11 @@ enum http_errno {
struct http_parser {
/** PRIVATE **/
unsigned int type : 2; /* enum http_parser_type */
unsigned int flags : 8; /* F_* values from 'flags' enum; semi-public */
unsigned int state : 7; /* enum state from http_parser.c */
unsigned int header_state : 7; /* enum header_state from http_parser.c */
unsigned int index : 7; /* index into current matcher */
unsigned int lenient_http_headers : 1;
unsigned int flags : 16; /* F_* values from 'flags' enum; semi-public */
uint32_t nread; /* # bytes read in various scenarios */
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -61,7 +61,7 @@ xmrig::App::~App()
int xmrig::App::exec()
{
if (!m_controller->isReady()) {
LOG_EMERG("no valid configuration found.");
LOG_EMERG("no valid configuration found, try https://xmrig.com/wizard");
return 2;
}

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -159,7 +159,7 @@ static void print_threads(Config *config)
static void print_commands(Config *)
{
if (Log::colors) {
if (Log::isColors()) {
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BG(WHITE_BOLD_S "h") WHITE_BOLD("ashrate, ")
MAGENTA_BG(WHITE_BOLD_S "p") WHITE_BOLD("ause, ")
MAGENTA_BG(WHITE_BOLD_S "r") WHITE_BOLD("esume"));

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -64,13 +64,17 @@ public:
}
inline void nextRound(uint32_t rounds, uint32_t roundSize)
inline bool nextRound(uint32_t rounds, uint32_t roundSize)
{
bool ok = true;
m_rounds[index()]++;
if ((m_rounds[index()] % rounds) == 0) {
for (size_t i = 0; i < N; ++i) {
*nonce(i) = Nonce::next(index(), *nonce(i), rounds * roundSize, currentJob().isNicehash());
*nonce(i) = Nonce::next(index(), *nonce(i), rounds * roundSize, currentJob().isNicehash(), &ok);
if (!ok) {
break;
}
}
}
else {
@@ -78,6 +82,8 @@ public:
*nonce(i) += roundSize;
}
}
return ok;
}
@@ -114,16 +120,19 @@ inline uint32_t *xmrig::WorkerJob<1>::nonce(size_t)
template<>
inline void xmrig::WorkerJob<1>::nextRound(uint32_t rounds, uint32_t roundSize)
inline bool xmrig::WorkerJob<1>::nextRound(uint32_t rounds, uint32_t roundSize)
{
bool ok = true;
m_rounds[index()]++;
if ((m_rounds[index()] % rounds) == 0) {
*nonce() = Nonce::next(index(), *nonce(), rounds * roundSize, currentJob().isNicehash());
*nonce() = Nonce::next(index(), *nonce(), rounds * roundSize, currentJob().isNicehash(), &ok);
}
else {
*nonce() += roundSize;
}
return ok;
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -56,6 +56,7 @@ public:
virtual void execCommand(char command) = 0;
virtual void prepare(const Job &nextJob) = 0;
virtual void printHashrate(bool details) = 0;
virtual void printHealth() = 0;
virtual void setJob(const Job &job) = 0;
virtual void start(IWorker *worker, bool ready) = 0;
virtual void stop() = 0;

View File

@@ -45,6 +45,7 @@ class IRxStorage
public:
virtual ~IRxStorage() = default;
virtual bool isAllocated() const = 0;
virtual HugePagesInfo hugePages() const = 0;
virtual RxDataset *dataset(const Job &job, uint32_t nodeId) const = 0;
virtual void init(const RxSeed &seed, uint32_t threads, bool hugePages, bool oneGbPages, RxConfig::Mode mode, int priority) = 0;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -91,8 +91,6 @@ rapidjson::Value xmrig::Cpu::toJSON(rapidjson::Document &doc)
void xmrig::Cpu::release()
{
assert(cpuInfo != nullptr);
delete cpuInfo;
cpuInfo = nullptr;
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -319,6 +319,11 @@ void xmrig::CpuBackend::printHashrate(bool details)
}
void xmrig::CpuBackend::printHealth()
{
}
void xmrig::CpuBackend::setJob(const Job &job)
{
if (!isEnabled()) {
@@ -411,6 +416,10 @@ rapidjson::Value xmrig::CpuBackend::toJSON(rapidjson::Document &doc) const
out.AddMember("argon2-impl", argon2::Impl::name().toJSON(), allocator);
# endif
# ifdef XMRIG_ALGO_ASTROBWT
out.AddMember("astrobwt-max-size", cpu.astrobwtMaxSize(), allocator);
# endif
out.AddMember("hugepages", d_ptr->hugePages(2, doc), allocator);
out.AddMember("memory", static_cast<uint64_t>(d_ptr->algo.isValid() ? (d_ptr->ways() * d_ptr->algo.l3()) : 0), allocator);

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -59,6 +59,7 @@ protected:
const String &type() const override;
void prepare(const Job &nextJob) override;
void printHashrate(bool details) override;
void printHealth() override;
void setJob(const Job &job) override;
void start(IWorker *worker, bool ready) override;
void stop() override;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,6 +29,8 @@
#include "base/io/json/Json.h"
#include "rapidjson/document.h"
#include <algorithm>
namespace xmrig {
@@ -48,6 +50,11 @@ static const char *kAsm = "asm";
static const char *kArgon2Impl = "argon2-impl";
#endif
#ifdef XMRIG_ALGO_ASTROBWT
static const char* kAstroBWTMaxSize = "astrobwt-max-size";
#endif
extern template class Threads<CpuThreads>;
}
@@ -85,6 +92,10 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
obj.AddMember(StringRef(kArgon2Impl), m_argon2Impl.toJSON(), allocator);
# endif
# ifdef XMRIG_ALGO_ASTROBWT
obj.AddMember(StringRef(kAstroBWTMaxSize), m_astrobwtMaxSize, allocator);
# endif
m_threads.toJSON(obj, doc);
return obj;
@@ -136,6 +147,16 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
m_argon2Impl = Json::getString(value, kArgon2Impl);
# endif
# ifdef XMRIG_ALGO_ASTROBWT
const auto& obj = Json::getValue(value, kAstroBWTMaxSize);
if (obj.IsNull() || !obj.IsInt()) {
m_shouldSave = true;
}
else {
m_astrobwtMaxSize = std::min(std::max(obj.GetInt(), 400), 1200);
}
# endif
m_threads.read(value);
generate();
@@ -165,8 +186,9 @@ void xmrig::CpuConfig::generate()
count += xmrig::generate<Algorithm::CN_PICO>(m_threads, m_limit);
count += xmrig::generate<Algorithm::RANDOM_X>(m_threads, m_limit);
count += xmrig::generate<Algorithm::ARGON2>(m_threads, m_limit);
count += xmrig::generate<Algorithm::ASTROBWT>(m_threads, m_limit);
m_shouldSave = count > 0;
m_shouldSave |= count > 0;
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -59,6 +59,7 @@ public:
inline const Assembly &assembly() const { return m_assembly; }
inline const String &argon2Impl() const { return m_argon2Impl; }
inline const Threads<CpuThreads> &threads() const { return m_threads; }
inline int astrobwtMaxSize() const { return m_astrobwtMaxSize; }
inline int priority() const { return m_priority; }
inline uint32_t limit() const { return m_limit; }
@@ -69,17 +70,18 @@ private:
inline void setPriority(int priority) { m_priority = (priority >= -1 && priority <= 5) ? priority : -1; }
AesMode m_aes = AES_AUTO;
AesMode m_aes = AES_AUTO;
Assembly m_assembly;
bool m_enabled = true;
bool m_hugePages = true;
bool m_shouldSave = false;
bool m_yield = true;
int m_memoryPool = 0;
int m_priority = -1;
bool m_enabled = true;
bool m_hugePages = true;
bool m_shouldSave = false;
bool m_yield = true;
int m_astrobwtMaxSize = 550;
int m_memoryPool = 0;
int m_priority = -1;
String m_argon2Impl;
Threads<CpuThreads> m_threads;
uint32_t m_limit = 100;
uint32_t m_limit = 100;
};

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -109,11 +109,11 @@ template<>
size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32_t limit)
{
size_t count = 0;
auto wow = Cpu::info()->threads(Algorithm::RX_WOW, limit);
auto cpuInfo = Cpu::info();
auto wow = cpuInfo->threads(Algorithm::RX_WOW, limit);
if (!threads.isExist(Algorithm::RX_ARQ)) {
auto arq = Cpu::info()->threads(Algorithm::RX_ARQ, limit);
auto arq = cpuInfo->threads(Algorithm::RX_ARQ, limit);
if (arq == wow) {
threads.setAlias(Algorithm::RX_ARQ, "rx/wow");
++count;
@@ -123,6 +123,17 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32
}
}
if (!threads.isExist(Algorithm::RX_KEVA)) {
auto keva = cpuInfo->threads(Algorithm::RX_KEVA, limit);
if (keva == wow) {
threads.setAlias(Algorithm::RX_KEVA, "rx/wow");
++count;
}
else {
count += threads.move("rx/keva", std::move(keva));
}
}
if (!threads.isExist(Algorithm::RX_WOW)) {
count += threads.move("rx/wow", std::move(wow));
}
@@ -143,6 +154,14 @@ size_t inline generate<Algorithm::ARGON2>(Threads<CpuThreads> &threads, uint32_t
#endif
#ifdef XMRIG_ALGO_ASTROBWT
template<>
size_t inline generate<Algorithm::ASTROBWT>(Threads<CpuThreads>& threads, uint32_t limit)
{
return generate("astrobwt", threads, Algorithm::ASTROBWT_DERO, limit);
}
#endif
} /* namespace xmrig */

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
#include "backend/cpu/CpuLaunchData.h"
#include "backend/common/Tags.h"
#include "backend/cpu/CpuConfig.h"
@@ -39,6 +38,7 @@ xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorit
hugePages(config.isHugePages()),
hwAES(config.isHwAES()),
yield(config.isYield()),
astrobwtMaxSize(config.astrobwtMaxSize()),
priority(config.priority()),
affinity(thread.affinity()),
miner(miner),

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -61,6 +61,7 @@ public:
const bool hugePages;
const bool hwAES;
const bool yield;
const int astrobwtMaxSize;
const int priority;
const int64_t affinity;
const Miner *miner;

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@
#include "core/Miner.h"
#include "crypto/cn/CnCtx.h"
#include "crypto/cn/CryptoNight_test.h"
#include "crypto/cn/CryptoNight.h"
#include "crypto/common/Nonce.h"
#include "crypto/common/VirtualMemory.h"
#include "crypto/rx/Rx.h"
@@ -44,10 +45,29 @@
#endif
#ifdef XMRIG_ALGO_ASTROBWT
# include "crypto/astrobwt/AstroBWT.h"
#endif
namespace xmrig {
static constexpr uint32_t kReserveCount = 32768;
template<size_t N>
inline bool nextRound(WorkerJob<N> &job)
{
if (!job.nextRound(kReserveCount, 1)) {
JobResults::done(job.currentJob());
return false;
}
return true;
}
} // namespace xmrig
@@ -60,6 +80,7 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
m_hwAES(data.hwAES),
m_yield(data.yield),
m_av(data.av()),
m_astrobwtMaxSize(data.astrobwtMaxSize * 1000),
m_miner(data.miner),
m_ctx()
{
@@ -154,7 +175,8 @@ bool xmrig::CpuWorker<N>::selfTest()
# ifdef XMRIG_ALGO_CN_PICO
if (m_algorithm.family() == Algorithm::CN_PICO) {
return verify(Algorithm::CN_PICO_0, test_output_pico_trtl);
return verify(Algorithm::CN_PICO_0, test_output_pico_trtl) &&
verify(Algorithm::CN_PICO_TLO, test_output_pico_tlo);
}
# endif
@@ -165,6 +187,12 @@ bool xmrig::CpuWorker<N>::selfTest()
}
# endif
# ifdef XMRIG_ALGO_ASTROBWT
if (m_algorithm.family() == Algorithm::ASTROBWT) {
return verify(Algorithm::ASTROBWT_DERO, astrobwt_dero_test_out);
}
# endif
return false;
}
@@ -214,29 +242,48 @@ void xmrig::CpuWorker<N>::start()
current_job_nonces[i] = *m_job.nonce(i);
}
bool valid = true;
# ifdef XMRIG_ALGO_RANDOMX
if (job.algorithm().family() == Algorithm::RANDOM_X) {
if (first) {
first = false;
randomx_calculate_hash_first(m_vm->get(), tempHash, m_job.blob(), job.size());
}
m_job.nextRound(kReserveCount, 1);
if (!nextRound(m_job)) {
break;
}
randomx_calculate_hash_next(m_vm->get(), tempHash, m_job.blob(), job.size(), m_hash);
}
else
# endif
{
fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height());
m_job.nextRound(kReserveCount, 1);
}
for (size_t i = 0; i < N; ++i) {
if (*reinterpret_cast<uint64_t*>(m_hash + (i * 32) + 24) < job.target()) {
JobResults::submit(job, current_job_nonces[i], m_hash + (i * 32));
# ifdef XMRIG_ALGO_ASTROBWT
if (job.algorithm().family() == Algorithm::ASTROBWT) {
if (!astrobwt::astrobwt_dero(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash, m_astrobwtMaxSize))
valid = false;
}
else
# endif
{
fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height());
}
if (!nextRound(m_job)) {
break;
};
}
m_count += N;
if (valid) {
for (size_t i = 0; i < N; ++i) {
if (*reinterpret_cast<uint64_t*>(m_hash + (i * 32) + 24) < job.target()) {
JobResults::submit(job, current_job_nonces[i], m_hash + (i * 32));
}
}
m_count += N;
}
if (m_yield) {
std::this_thread::yield();

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -73,6 +73,7 @@ private:
const bool m_hwAES;
const bool m_yield;
const CnHash::AlgoVariant m_av;
const int m_astrobwtMaxSize;
const Miner *m_miner;
cryptonight_ctx *m_ctx[N];
uint8_t m_hash[N * 32]{ 0 };

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,12 +37,20 @@ namespace xmrig {
class ICpuInfo
{
public:
enum Vendor {
enum Vendor : uint32_t {
VENDOR_UNKNOWN,
VENDOR_INTEL,
VENDOR_AMD
};
enum MsrMod : uint32_t {
MSR_MOD_NONE,
MSR_MOD_RYZEN,
MSR_MOD_INTEL,
MSR_MOD_CUSTOM,
MSR_MOD_MAX
};
virtual ~ICpuInfo() = default;
# if defined(__x86_64__) || defined(_M_AMD64) || defined (__arm64__) || defined (__aarch64__)
@@ -54,10 +62,12 @@ public:
virtual Assembly::Id assembly() const = 0;
virtual bool hasAES() const = 0;
virtual bool hasAVX2() const = 0;
virtual bool hasBMI2() const = 0;
virtual bool hasOneGbPages() const = 0;
virtual const char *backend() const = 0;
virtual const char *brand() const = 0;
virtual CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const = 0;
virtual MsrMod msrMod() const = 0;
virtual size_t cores() const = 0;
virtual size_t L2() const = 0;
virtual size_t L3() const = 0;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -139,7 +139,13 @@ xmrig::AdvancedCpuInfo::AdvancedCpuInfo() :
m_aes = true;
if (m_vendor == VENDOR_AMD) {
m_assembly = (data.ext_family >= 23) ? Assembly::RYZEN : Assembly::BULLDOZER;
if (data.ext_family >= 23) {
m_assembly = Assembly::RYZEN;
m_msrMod = MSR_MOD_RYZEN;
}
else {
m_assembly = Assembly::BULLDOZER;
}
}
else if (m_vendor == VENDOR_INTEL) {
m_assembly = Assembly::INTEL;
@@ -147,6 +153,7 @@ xmrig::AdvancedCpuInfo::AdvancedCpuInfo() :
}
m_avx2 = data.flags[CPU_FEATURE_AVX2] && data.flags[CPU_FEATURE_OSXSAVE];
m_bmi2 = data.flags[CPU_FEATURE_BMI2];
}
@@ -165,6 +172,17 @@ xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm, ui
size_t cache = 0;
size_t count = 0;
# ifdef XMRIG_ALGO_ASTROBWT
if (algorithm == Algorithm::ASTROBWT_DERO) {
CpuThreads t;
count = threads();
for (size_t i = 0; i < count; ++i) {
t.add(i, 0);
}
return t;
}
# endif
if (m_L3) {
cache = m_L2_exclusive ? (m_L2 + m_L3) : m_L3;
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -43,9 +43,11 @@ protected:
inline Assembly::Id assembly() const override { return m_assembly; }
inline bool hasAES() const override { return m_aes; }
inline bool hasAVX2() const override { return m_avx2; }
inline bool hasBMI2() const override { return m_bmi2; }
inline bool hasOneGbPages() const override { return m_pdpe1gb; }
inline const char *backend() const override { return m_backend; }
inline const char *brand() const override { return m_brand; }
inline MsrMod msrMod() const override { return m_msrMod; }
inline size_t cores() const override { return m_cores; }
inline size_t L2() const override { return m_L2; }
inline size_t L3() const override { return m_L3; }
@@ -58,10 +60,12 @@ private:
Assembly m_assembly;
bool m_aes = false;
bool m_avx2 = false;
bool m_bmi2 = false;
bool m_L2_exclusive = false;
char m_backend[32]{};
char m_brand[64 + 5]{};
const bool m_pdpe1gb = false;
MsrMod m_msrMod = MSR_MOD_NONE;
size_t m_cores = 0;
size_t m_L2 = 0;
size_t m_L3 = 0;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -45,6 +45,10 @@
# define bit_AVX2 (1 << 5)
#endif
#ifndef bit_BMI2
# define bit_BMI2 (1 << 8)
#endif
#ifndef bit_PDPE1GB
# define bit_PDPE1GB (1 << 26)
#endif
@@ -141,6 +145,12 @@ static inline bool has_avx2()
}
static inline bool has_bmi2()
{
return has_feature(EXTENDED_FEATURES, EBX_Reg, bit_BMI2);
}
static inline bool has_pdpe1gb()
{
return has_feature(PROCESSOR_EXT_INFO, EDX_Reg, bit_PDPE1GB);
@@ -154,6 +164,7 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
m_threads(std::thread::hardware_concurrency()),
m_aes(has_aes_ni()),
m_avx2(has_avx2()),
m_bmi2(has_bmi2()),
m_pdpe1gb(has_pdpe1gb())
{
cpu_brand_string(m_brand);
@@ -175,11 +186,18 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
cpuid(PROCESSOR_INFO, data);
const int32_t family = get_masked(data[EAX_Reg], 12, 8) + get_masked(data[EAX_Reg], 28, 20);
m_assembly = family >= 23 ? Assembly::RYZEN : Assembly::BULLDOZER;
if (family >= 23) {
m_assembly = Assembly::RYZEN;
m_msrMod = MSR_MOD_RYZEN;
}
else {
m_assembly = Assembly::BULLDOZER;
}
}
else if (memcmp(vendor, "GenuineIntel", 12) == 0) {
m_vendor = VENDOR_INTEL;
m_assembly = Assembly::INTEL;
m_msrMod = MSR_MOD_INTEL;
}
}
# endif
@@ -240,5 +258,15 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
}
# endif
# ifdef XMRIG_ALGO_ASTROBWT
if (algorithm.family() == Algorithm::ASTROBWT) {
CpuThreads threads;
for (size_t i = 0; i < count; ++i) {
threads.add(i, 0);
}
return threads;
}
# endif
return CpuThreads(std::max<size_t>(count / 2, 1), 1);
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,8 +44,10 @@ protected:
inline Assembly::Id assembly() const override { return m_assembly; }
inline bool hasAES() const override { return m_aes; }
inline bool hasAVX2() const override { return m_avx2; }
inline bool hasBMI2() const override { return m_bmi2; }
inline bool hasOneGbPages() const override { return m_pdpe1gb; }
inline const char *brand() const override { return m_brand; }
inline MsrMod msrMod() const override { return m_msrMod; }
inline size_t cores() const override { return 0; }
inline size_t L2() const override { return 0; }
inline size_t L3() const override { return 0; }
@@ -62,7 +64,9 @@ private:
Assembly m_assembly = Assembly::NONE;
bool m_aes = false;
const bool m_avx2 = false;
const bool m_bmi2 = false;
const bool m_pdpe1gb = false;
MsrMod m_msrMod = MSR_MOD_NONE;
Vendor m_vendor = VENDOR_UNKNOWN;
};

View File

@@ -216,6 +216,12 @@ bool xmrig::HwlocCpuInfo::membind(hwloc_const_bitmap_t nodeset)
xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint32_t limit) const
{
# ifdef XMRIG_ALGO_ASTROBWT
if (algorithm == Algorithm::ASTROBWT_DERO) {
return BasicCpuInfo::threads(algorithm, limit);
}
# endif
if (L2() == 0 && L3() == 0) {
return BasicCpuInfo::threads(algorithm, limit);
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -254,7 +254,8 @@ public:
}
}
LOG_INFO(CYAN_BOLD("#%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s",
LOG_INFO("%s" CYAN_BOLD(" #%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s",
tag,
device.index(),
device.topology().toString().data(),
health.power,
@@ -338,13 +339,8 @@ const xmrig::String &xmrig::CudaBackend::type() const
}
void xmrig::CudaBackend::execCommand(char command)
void xmrig::CudaBackend::execCommand(char)
{
# ifdef XMRIG_FEATURE_NVML
if (command == 'e' || command == 'E') {
d_ptr->printHealth();
}
# endif
}
@@ -387,6 +383,14 @@ void xmrig::CudaBackend::printHashrate(bool details)
}
void xmrig::CudaBackend::printHealth()
{
# ifdef XMRIG_FEATURE_NVML
d_ptr->printHealth();
# endif
}
void xmrig::CudaBackend::setJob(const Job &job)
{
const auto &cuda = d_ptr->controller->config()->cuda();
@@ -455,15 +459,6 @@ void xmrig::CudaBackend::stop()
void xmrig::CudaBackend::tick(uint64_t ticks)
{
d_ptr->workers.tick(ticks);
# ifdef XMRIG_FEATURE_NVML
if (isEnabled()) {
auto seconds = d_ptr->controller->config()->healthPrintTime();
if (seconds && ticks && (ticks % (seconds * 2)) == 0) {
d_ptr->printHealth();
}
}
# endif
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -59,6 +59,7 @@ protected:
void execCommand(char command) override;
void prepare(const Job &nextJob) override;
void printHashrate(bool details) override;
void printHealth() override;
void setJob(const Job &job) override;
void start(IWorker *worker, bool ready) override;
void stop() override;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -115,6 +115,7 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
auto rx = CudaThreads(devices, Algorithm::RX_0);
auto wow = CudaThreads(devices, Algorithm::RX_WOW);
auto arq = CudaThreads(devices, Algorithm::RX_ARQ);
auto kva = CudaThreads(devices, Algorithm::RX_KEVA);
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
count += threads.move("rx/wow", std::move(wow));
@@ -124,6 +125,10 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
count += threads.move("rx/arq", std::move(arq));
}
if (!threads.isExist(Algorithm::RX_KEVA) && kva != rx) {
count += threads.move("rx/keva", std::move(kva));
}
count += threads.move("rx", std::move(rx));
return count;

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -78,9 +78,15 @@ xmrig::CudaWorker::CudaWorker(size_t id, const CudaLaunchData &data) :
break;
}
if (!m_runner || !m_runner->init()) {
if (!m_runner) {
return;
}
if (!m_runner->init()) {
delete m_runner;
m_runner = nullptr;
}
}
@@ -133,7 +139,9 @@ void xmrig::CudaWorker::start()
}
const size_t batch_size = intensity();
m_job.nextRound(roundSize(batch_size), batch_size);
if (!m_job.nextRound(roundSize(batch_size), batch_size)) {
JobResults::done(m_job.currentJob());
}
storeStats();
std::this_thread::yield();

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -47,7 +47,7 @@ xmrig::CudaBaseRunner::~CudaBaseRunner()
bool xmrig::CudaBaseRunner::init()
{
m_ctx = CudaLib::alloc(m_data.thread.index(), m_data.thread.bfactor(), m_data.thread.bsleep());
if (CudaLib::deviceInfo(m_ctx, m_data.thread.blocks(), m_data.thread.threads(), m_data.algorithm, m_data.thread.datasetHost()) != 0) {
if (!callWrapper(CudaLib::deviceInfo(m_ctx, m_data.thread.blocks(), m_data.thread.threads(), m_data.algorithm, m_data.thread.datasetHost()))) {
return false;
}

View File

@@ -31,8 +31,9 @@
#include "crypto/rx/RxDataset.h"
xmrig::CudaRxRunner::CudaRxRunner(size_t index, const CudaLaunchData &data) : CudaBaseRunner(index, data),
m_datasetHost(data.thread.datasetHost() > 0)
xmrig::CudaRxRunner::CudaRxRunner(size_t index, const CudaLaunchData &data) :
CudaBaseRunner(index, data),
m_datasetHost(data.thread.datasetHost() > 0)
{
m_intensity = m_data.thread.threads() * m_data.thread.blocks();
const size_t scratchpads_size = m_intensity * m_data.algorithm.l3();

View File

@@ -41,7 +41,7 @@ xmrig::CudaDevice::CudaDevice(uint32_t index, int32_t bfactor, int32_t bsleep) :
m_index(index)
{
auto ctx = CudaLib::alloc(index, bfactor, bsleep);
if (CudaLib::deviceInfo(ctx, 0, 0, Algorithm::INVALID) != 0) {
if (!CudaLib::deviceInfo(ctx, 0, 0, Algorithm::INVALID)) {
CudaLib::release(ctx);
return;
@@ -107,7 +107,7 @@ uint32_t xmrig::CudaDevice::smx() const
void xmrig::CudaDevice::generate(const Algorithm &algorithm, CudaThreads &threads) const
{
if (CudaLib::deviceInfo(m_ctx, -1, -1, algorithm) != 0) {
if (!CudaLib::deviceInfo(m_ctx, -1, -1, algorithm)) {
return;
}

View File

@@ -28,6 +28,8 @@
#include "backend/cuda/wrappers/CudaLib.h"
#include "base/kernel/Env.h"
#include "crypto/rx/RxAlgo.h"
namespace xmrig {
@@ -48,6 +50,7 @@ static const char *kAlloc = "alloc";
static const char *kCnHash = "cnHash";
static const char *kDeviceCount = "deviceCount";
static const char *kDeviceInfo = "deviceInfo";
static const char *kDeviceInfo_v2 = "deviceInfo_v2";
static const char *kDeviceInit = "deviceInit";
static const char *kDeviceInt = "deviceInt";
static const char *kDeviceName = "deviceName";
@@ -60,6 +63,7 @@ static const char *kRelease = "release";
static const char *kRxHash = "rxHash";
static const char *kRxPrepare = "rxPrepare";
static const char *kSetJob = "setJob";
static const char *kSetJob_v2 = "setJob_v2";
static const char *kSymbolNotFound = "symbol not found";
static const char *kVersion = "version";
@@ -68,6 +72,7 @@ using alloc_t = nvid_ctx * (*)(uint32_
using cnHash_t = bool (*)(nvid_ctx *, uint32_t, uint64_t, uint64_t, uint32_t *, uint32_t *);
using deviceCount_t = uint32_t (*)();
using deviceInfo_t = int32_t (*)(nvid_ctx *, int32_t, int32_t, int32_t, int32_t);
using deviceInfo_v2_t = bool (*)(nvid_ctx *, int32_t, int32_t, const char *, int32_t);
using deviceInit_t = bool (*)(nvid_ctx *);
using deviceInt_t = int32_t (*)(nvid_ctx *, CudaLib::DeviceProperty);
using deviceName_t = const char * (*)(nvid_ctx *);
@@ -80,6 +85,7 @@ using release_t = void (*)(nvid_ctx *);
using rxHash_t = bool (*)(nvid_ctx *, uint32_t, uint64_t, uint32_t *, uint32_t *);
using rxPrepare_t = bool (*)(nvid_ctx *, const void *, size_t, bool, uint32_t);
using setJob_t = bool (*)(nvid_ctx *, const void *, size_t, int32_t);
using setJob_v2_t = bool (*)(nvid_ctx *, const void *, size_t, const char *);
using version_t = uint32_t (*)(Version);
@@ -87,6 +93,7 @@ static alloc_t pAlloc = nullptr;
static cnHash_t pCnHash = nullptr;
static deviceCount_t pDeviceCount = nullptr;
static deviceInfo_t pDeviceInfo = nullptr;
static deviceInfo_v2_t pDeviceInfo_v2 = nullptr;
static deviceInit_t pDeviceInit = nullptr;
static deviceInt_t pDeviceInt = nullptr;
static deviceName_t pDeviceName = nullptr;
@@ -99,6 +106,7 @@ static release_t pRelease = nullptr;
static rxHash_t pRxHash = nullptr;
static rxPrepare_t pRxPrepare = nullptr;
static setJob_t pSetJob = nullptr;
static setJob_v2_t pSetJob_v2 = nullptr;
static version_t pVersion = nullptr;
@@ -116,7 +124,7 @@ String CudaLib::m_loader;
bool xmrig::CudaLib::init(const char *fileName)
{
if (!m_initialized) {
m_loader = fileName == nullptr ? defaultLoader() : fileName;
m_loader = fileName == nullptr ? defaultLoader() : Env::expand(fileName);
m_ready = uv_dlopen(m_loader, &cudaLib) == 0 && load();
m_initialized = true;
}
@@ -143,6 +151,18 @@ bool xmrig::CudaLib::cnHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t height,
}
bool xmrig::CudaLib::deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm, int32_t dataset_host) noexcept
{
const Algorithm algo = RxAlgo::id(algorithm);
if (pDeviceInfo_v2) {
return pDeviceInfo_v2(ctx, blocks, threads, algo.isValid() ? algo.shortName() : nullptr, dataset_host);
}
return pDeviceInfo(ctx, blocks, threads, algo, dataset_host) == 0;
}
bool xmrig::CudaLib::deviceInit(nvid_ctx *ctx) noexcept
{
return pDeviceInit(ctx);
@@ -163,7 +183,12 @@ bool xmrig::CudaLib::rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datase
bool xmrig::CudaLib::setJob(nvid_ctx *ctx, const void *data, size_t size, const Algorithm &algorithm) noexcept
{
return pSetJob(ctx, data, size, algorithm);
const Algorithm algo = RxAlgo::id(algorithm);
if (pSetJob_v2) {
return pSetJob_v2(ctx, data, size, algo.shortName());
}
return pSetJob(ctx, data, size, algo);
}
@@ -185,12 +210,6 @@ const char *xmrig::CudaLib::pluginVersion() noexcept
}
int xmrig::CudaLib::deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm, int32_t dataset_host) noexcept
{
return pDeviceInfo(ctx, blocks, threads, algorithm, dataset_host);
}
int32_t xmrig::CudaLib::deviceInt(nvid_ctx *ctx, DeviceProperty property) noexcept
{
return pDeviceInt(ctx, property);
@@ -290,11 +309,13 @@ bool xmrig::CudaLib::load()
return false;
}
uv_dlsym(&cudaLib, kDeviceInfo_v2, reinterpret_cast<void**>(&pDeviceInfo_v2));
uv_dlsym(&cudaLib, kSetJob_v2, reinterpret_cast<void**>(&pSetJob_v2));
try {
DLSYM(Alloc);
DLSYM(CnHash);
DLSYM(DeviceCount);
DLSYM(DeviceInfo);
DLSYM(DeviceInit);
DLSYM(DeviceInt);
DLSYM(DeviceName);
@@ -306,8 +327,15 @@ bool xmrig::CudaLib::load()
DLSYM(Release);
DLSYM(RxHash);
DLSYM(RxPrepare);
DLSYM(SetJob);
DLSYM(Version);
if (!pDeviceInfo_v2) {
DLSYM(DeviceInfo);
}
if (!pSetJob_v2) {
DLSYM(SetJob);
}
} catch (std::exception &ex) {
return false;
}
@@ -318,7 +346,7 @@ bool xmrig::CudaLib::load()
}
const char *xmrig::CudaLib::defaultLoader()
xmrig::String xmrig::CudaLib::defaultLoader()
{
# if defined(__APPLE__)
return "/System/Library/Frameworks/OpenCL.framework/OpenCL"; // FIXME

View File

@@ -74,6 +74,7 @@ public:
static inline const String &loader() { return m_loader; }
static bool cnHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t height, uint64_t target, uint32_t *rescount, uint32_t *resnonce);
static bool deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm, int32_t dataset_host = -1) noexcept;
static bool deviceInit(nvid_ctx *ctx) noexcept;
static bool rxHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t target, uint32_t *rescount, uint32_t *resnonce) noexcept;
static bool rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept;
@@ -81,7 +82,6 @@ public:
static const char *deviceName(nvid_ctx *ctx) noexcept;
static const char *lastError(nvid_ctx *ctx) noexcept;
static const char *pluginVersion() noexcept;
static int deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm, int32_t dataset_host = -1) noexcept;
static int32_t deviceInt(nvid_ctx *ctx, DeviceProperty property) noexcept;
static nvid_ctx *alloc(uint32_t id, int32_t bfactor, int32_t bsleep) noexcept;
static std::string version(uint32_t version);
@@ -95,7 +95,7 @@ public:
private:
static bool load();
static const char *defaultLoader();
static String defaultLoader();
static bool m_initialized;
static bool m_ready;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,11 +27,11 @@
#include <string>
#include "backend/opencl/OclBackend.h"
#include "backend/common/Hashrate.h"
#include "backend/common/interfaces/IWorker.h"
#include "backend/common/Tags.h"
#include "backend/common/Workers.h"
#include "backend/opencl/OclBackend.h"
#include "backend/opencl/OclConfig.h"
#include "backend/opencl/OclLaunchData.h"
#include "backend/opencl/OclWorker.h"
@@ -52,6 +52,13 @@
#endif
#ifdef XMRIG_FEATURE_ADL
#include "backend/opencl/wrappers/AdlLib.h"
namespace xmrig { static const char *kAdlLabel = "ADL"; }
#endif
namespace xmrig {
@@ -59,14 +66,15 @@ extern template class Threads<OclThreads>;
constexpr const size_t oneMiB = 1024U * 1024U;
static const char *kLabel = "OPENCL";
static const char *tag = MAGENTA_BG_BOLD(WHITE_BOLD_S " ocl ");
static const String kType = "opencl";
static std::mutex mutex;
static void printDisabled(const char *reason)
static void printDisabled(const char *label, const char *reason)
{
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled") "%s", "OPENCL", reason);
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled") "%s", label, reason);
}
@@ -129,11 +137,11 @@ public:
void init(const OclConfig &cl)
{
if (!cl.isEnabled()) {
return printDisabled("");
return printDisabled(kLabel, "");
}
if (!OclLib::init(cl.loader())) {
return printDisabled(RED_S " (failed to load OpenCL runtime)");
return printDisabled(kLabel, RED_S " (failed to load OpenCL runtime)");
}
if (platform.isValid()) {
@@ -142,14 +150,30 @@ public:
platform = cl.platform();
if (!platform.isValid()) {
return printDisabled(RED_S " (selected OpenCL platform NOT found)");
return printDisabled(kLabel, RED_S " (selected OpenCL platform NOT found)");
}
devices = platform.devices();
if (devices.empty()) {
return printDisabled(RED_S " (no devices)");
return printDisabled(kLabel, RED_S " (no devices)");
}
# ifdef XMRIG_FEATURE_ADL
if (cl.isAdlEnabled()) {
if (AdlLib::init()) {
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "press " MAGENTA_BG(WHITE_BOLD_S "e") " for health report",
kAdlLabel
);
}
else {
printDisabled(kAdlLabel, RED_S " (failed to load ADL)");
}
}
else {
printDisabled(kAdlLabel, "");
}
# endif
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("#%zu ") WHITE_BOLD("%s") "/" WHITE_BOLD("%s"), "OPENCL", platform.index(), platform.name().data(), platform.version().data());
for (const OclDevice &device : devices) {
@@ -204,6 +228,32 @@ public:
}
# ifdef XMRIG_FEATURE_ADL
void printHealth()
{
if (!AdlLib::isReady()) {
return;
}
for (const auto &device : devices) {
const auto health = AdlLib::health(device);
LOG_INFO("%s" CYAN_BOLD(" #%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CYAN_BOLD(" %4u") CYAN("RPM") WHITE_BOLD(" %u/%u") "MHz",
tag,
device.index(),
device.topology().toString().data(),
health.power,
health.temperature < 60 ? 32 : (health.temperature > 85 ? 31 : 33),
health.temperature,
health.rpm,
health.clock,
health.memClock
);
}
}
# endif
Algorithm algo;
Controller *controller;
OclContext context;
@@ -237,6 +287,10 @@ xmrig::OclBackend::~OclBackend()
delete d_ptr;
OclLib::close();
# ifdef XMRIG_FEATURE_ADL
AdlLib::close();
# endif
}
@@ -270,6 +324,11 @@ const xmrig::String &xmrig::OclBackend::type() const
}
void xmrig::OclBackend::execCommand(char)
{
}
void xmrig::OclBackend::prepare(const Job &)
{
}
@@ -309,6 +368,14 @@ void xmrig::OclBackend::printHashrate(bool details)
}
void xmrig::OclBackend::printHealth()
{
# ifdef XMRIG_FEATURE_ADL
d_ptr->printHealth();
# endif
}
void xmrig::OclBackend::setJob(const Job &job)
{
const auto &cl = d_ptr->controller->config()->cl();

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,15 +51,15 @@ public:
~OclBackend() override;
protected:
inline void execCommand(char) override {}
bool isEnabled() const override;
bool isEnabled(const Algorithm &algorithm) const override;
const Hashrate *hashrate() const override;
const String &profileName() const override;
const String &type() const override;
void execCommand(char command) override;
void prepare(const Job &nextJob) override;
void printHashrate(bool details) override;
void printHealth() override;
void setJob(const Job &job) override;
void start(IWorker *worker, bool ready) override;
void stop() override;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,14 +35,21 @@
namespace xmrig {
static const char *kAMD = "AMD";
static const char *kCache = "cache";
static const char *kDevicesHint = "devices-hint";
static const char *kEnabled = "enabled";
static const char *kINTEL = "INTEL";
static const char *kLoader = "loader";
#ifndef XMRIG_OS_APPLE
static const char *kAMD = "AMD";
static const char *kINTEL = "INTEL";
static const char *kNVIDIA = "NVIDIA";
static const char *kPlatform = "platform";
#endif
#ifdef XMRIG_FEATURE_ADL
static const char *kAdl = "adl";
#endif
extern template class Threads<OclThreads>;
@@ -51,10 +58,11 @@ extern template class Threads<OclThreads>;
}
xmrig::OclConfig::OclConfig() :
m_platformVendor(kAMD)
{
}
#ifndef XMRIG_OS_APPLE
xmrig::OclConfig::OclConfig() : m_platformVendor(kAMD) {}
#else
xmrig::OclConfig::OclConfig() = default;
#endif
xmrig::OclPlatform xmrig::OclConfig::platform() const
@@ -64,6 +72,7 @@ xmrig::OclPlatform xmrig::OclConfig::platform() const
return {};
}
# ifndef XMRIG_OS_APPLE
if (!m_platformVendor.isEmpty()) {
String search;
String vendor = m_platformVendor;
@@ -93,6 +102,9 @@ xmrig::OclPlatform xmrig::OclConfig::platform() const
}
return {};
# else
return platforms[0];
# endif
}
@@ -106,7 +118,14 @@ rapidjson::Value xmrig::OclConfig::toJSON(rapidjson::Document &doc) const
obj.AddMember(StringRef(kEnabled), m_enabled, allocator);
obj.AddMember(StringRef(kCache), m_cache, allocator);
obj.AddMember(StringRef(kLoader), m_loader.toJSON(), allocator);
# ifndef XMRIG_OS_APPLE
obj.AddMember(StringRef(kPlatform), m_platformVendor.isEmpty() ? Value(m_platformIndex) : m_platformVendor.toJSON(), allocator);
# endif
# ifdef XMRIG_FEATURE_ADL
obj.AddMember(StringRef(kAdl), m_adl, allocator);
# endif
m_threads.toJSON(obj, doc);
@@ -152,9 +171,16 @@ void xmrig::OclConfig::read(const rapidjson::Value &value)
m_cache = Json::getBool(value, kCache, m_cache);
m_loader = Json::getString(value, kLoader);
# ifndef XMRIG_OS_APPLE
setPlatform(Json::getValue(value, kPlatform));
# endif
setDevicesHint(Json::getString(value, kDevicesHint));
# ifdef XMRIG_FEATURE_ADL
m_adl = Json::getBool(value, kAdl, m_adl);
# endif
m_threads.read(value);
generate();
@@ -214,6 +240,7 @@ void xmrig::OclConfig::setDevicesHint(const char *devicesHint)
}
#ifndef XMRIG_OS_APPLE
void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform)
{
if (platform.IsString()) {
@@ -224,3 +251,4 @@ void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform)
m_platformIndex = platform.GetUint();
}
}
#endif

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,19 +51,31 @@ public:
inline const String &loader() const { return m_loader; }
inline const Threads<OclThreads> &threads() const { return m_threads; }
# ifdef XMRIG_FEATURE_ADL
inline bool isAdlEnabled() const { return m_adl; }
# endif
private:
void generate();
void setDevicesHint(const char *devicesHint);
void setPlatform(const rapidjson::Value &platform);
bool m_cache = true;
bool m_enabled = false;
bool m_shouldSave = false;
std::vector<uint32_t> m_devicesHint;
String m_loader;
String m_platformVendor;
Threads<OclThreads> m_threads;
# ifndef XMRIG_OS_APPLE
void setPlatform(const rapidjson::Value &platform);
String m_platformVendor;
uint32_t m_platformIndex = 0;
# endif
# ifdef XMRIG_FEATURE_ADL
bool m_adl = true;
# endif
};

View File

@@ -25,7 +25,6 @@
#include "backend/opencl/OclLaunchData.h"
#include "backend/common/Tags.h"
#include "backend/opencl/OclConfig.h"

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
#include "backend/opencl/OclWorker.h"
#include "backend/common/Tags.h"
#include "backend/opencl/runners/OclCnRunner.h"
#include "backend/opencl/runners/tools/OclSharedData.h"
@@ -187,7 +186,9 @@ void xmrig::OclWorker::start()
JobResults::submit(m_job.currentJob(), results, results[0xFF]);
}
m_job.nextRound(roundSize(m_intensity), m_intensity);
if (!m_job.nextRound(roundSize(m_intensity), m_intensity)) {
JobResults::done(m_job.currentJob());
}
storeStats(t);
std::this_thread::yield();

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -16,12 +16,16 @@
#define ALGO_CN_HEAVY_TUBE 15
#define ALGO_CN_HEAVY_XHV 16
#define ALGO_CN_PICO_0 17
#define ALGO_RX_0 18
#define ALGO_RX_WOW 19
#define ALGO_RX_LOKI 20
#define ALGO_RX_ARQMA 21
#define ALGO_AR2_CHUKWA 22
#define ALGO_AR2_WRKZ 23
#define ALGO_CN_PICO_TLO 18
#define ALGO_RX_0 19
#define ALGO_RX_WOW 20
#define ALGO_RX_LOKI 21
#define ALGO_RX_ARQMA 22
#define ALGO_RX_SFX 23
#define ALGO_RX_KEVA 24
#define ALGO_AR2_CHUKWA 25
#define ALGO_AR2_WRKZ 26
#define ALGO_ASTROBWT_DERO 27
#define FAMILY_UNKNOWN 0
#define FAMILY_CN 1
@@ -30,3 +34,4 @@
#define FAMILY_CN_PICO 4
#define FAMILY_RANDOM_X 5
#define FAMILY_ARGON2 6
#define FAMILY_ASTROBWT 7

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,8 @@
#include "randomx_constants_loki.h"
#elif (ALGO == ALGO_RX_ARQMA)
#include "randomx_constants_arqma.h"
#elif (ALGO == ALGO_RX_KEVA)
#include "randomx_constants_keva.h"
#endif
#include "aes.cl"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,96 @@
/*
Copyright (c) 2019 SChernykh
This file is part of RandomX OpenCL.
RandomX OpenCL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
RandomX OpenCL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
*/
//Dataset base size in bytes. Must be a power of 2.
#define RANDOMX_DATASET_BASE_SIZE 2147483648
//Dataset extra size. Must be divisible by 64.
#define RANDOMX_DATASET_EXTRA_SIZE 33554368
//Scratchpad L3 size in bytes. Must be a power of 2.
#define RANDOMX_SCRATCHPAD_L3 1048576
//Scratchpad L2 size in bytes. Must be a power of two and less than or equal to RANDOMX_SCRATCHPAD_L3.
#define RANDOMX_SCRATCHPAD_L2 131072
//Scratchpad L1 size in bytes. Must be a power of two (minimum 64) and less than or equal to RANDOMX_SCRATCHPAD_L2.
#define RANDOMX_SCRATCHPAD_L1 16384
//Jump condition mask size in bits.
#define RANDOMX_JUMP_BITS 8
//Jump condition mask offset in bits. The sum of RANDOMX_JUMP_BITS and RANDOMX_JUMP_OFFSET must not exceed 16.
#define RANDOMX_JUMP_OFFSET 8
//Integer instructions
#define RANDOMX_FREQ_IADD_RS 16
#define RANDOMX_FREQ_IADD_M 7
#define RANDOMX_FREQ_ISUB_R 16
#define RANDOMX_FREQ_ISUB_M 7
#define RANDOMX_FREQ_IMUL_R 16
#define RANDOMX_FREQ_IMUL_M 4
#define RANDOMX_FREQ_IMULH_R 4
#define RANDOMX_FREQ_IMULH_M 1
#define RANDOMX_FREQ_ISMULH_R 4
#define RANDOMX_FREQ_ISMULH_M 1
#define RANDOMX_FREQ_IMUL_RCP 8
#define RANDOMX_FREQ_INEG_R 2
#define RANDOMX_FREQ_IXOR_R 15
#define RANDOMX_FREQ_IXOR_M 5
#define RANDOMX_FREQ_IROR_R 8
#define RANDOMX_FREQ_IROL_R 2
#define RANDOMX_FREQ_ISWAP_R 4
//Floating point instructions
#define RANDOMX_FREQ_FSWAP_R 4
#define RANDOMX_FREQ_FADD_R 16
#define RANDOMX_FREQ_FADD_M 5
#define RANDOMX_FREQ_FSUB_R 16
#define RANDOMX_FREQ_FSUB_M 5
#define RANDOMX_FREQ_FSCAL_R 6
#define RANDOMX_FREQ_FMUL_R 32
#define RANDOMX_FREQ_FDIV_M 4
#define RANDOMX_FREQ_FSQRT_R 6
//Control instructions
#define RANDOMX_FREQ_CBRANCH 25
#define RANDOMX_FREQ_CFROUND 1
//Store instruction
#define RANDOMX_FREQ_ISTORE 16
//No-op instruction
#define RANDOMX_FREQ_NOP 0
#define RANDOMX_DATASET_ITEM_SIZE 64
#define RANDOMX_PROGRAM_SIZE 256
#define HASH_SIZE 64
#define ENTROPY_SIZE (128 + RANDOMX_PROGRAM_SIZE * 8)
#define REGISTERS_SIZE 256
#define IMM_BUF_SIZE (RANDOMX_PROGRAM_SIZE * 4 - REGISTERS_SIZE)
#define IMM_INDEX_COUNT ((IMM_BUF_SIZE / 4) - 2)
#define VM_STATE_SIZE (REGISTERS_SIZE + IMM_BUF_SIZE + RANDOMX_PROGRAM_SIZE * 4)
#define ROUNDING_MODE (RANDOMX_FREQ_CFROUND ? -1 : 0)
// Scratchpad L1/L2/L3 bits
#define LOC_L1 (32 - 14)
#define LOC_L2 (32 - 17)
#define LOC_L3 (32 - 20)

View File

@@ -43,6 +43,62 @@ along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
#define RANDOMX_JUMP_BITS 8
#define RANDOMX_JUMP_OFFSET 8
#if GCN_VERSION >= 15
#define S_SETPC_B64_S12_13 0xbe80200cu
#define V_AND_B32_CALC_ADDRESS 0x3638000eu
#define GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD 0xdc348000u
#define S_WAITCNT_SCRATCHPAD_LOAD2 0xbf8c3f70u
#define V_READLANE_B32_SCRATCHPAD_LOAD2 0xd7600000u
#define S_MUL_HI_U32_IMUL_R 0x9a8f1010u
#define S_MUL_I32_IMUL 0x93000000u
#define S_MUL_HI_U32_IMUL_R_2 0x9a8fff10u
#define S_MUL_HI_U32_IMUL_M 0x9aa10e10u
#define S_MOV_B32_IMUL_RCP 0xbea003ffu
#define S_MUL_HI_U32_IMUL_RCP 0x9a8f2010u
#define S_XOR_B32_64 0x89000000u
#define S_MOV_B32_XOR_R 0xbebe03ffu
#define S_LSHR 0x90000000u
#define S_LSHL 0x8f000000u
#define S_OR 0x88000000u
#define S_AND 0x87000000u
#define S_BFE 0x94000000u
#define DS_SWIZZLE_B32_FSWAP_R 0xd8d48001u
#define V_ADD_F64 0xd564003cu
#define V_AND_B32 0x36000000u
#define GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP 0xdc308000u
#define V_XOR_B32 0x3a000000u
#define V_MUL_F64 0xd5650044u
#else
#define S_SETPC_B64_S12_13 0xbe801d0cu
#define V_AND_B32_CALC_ADDRESS 0x2638000eu
#define GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD 0xdc548000u
#define S_WAITCNT_SCRATCHPAD_LOAD2 0xbf8c0f70u
#define V_READLANE_B32_SCRATCHPAD_LOAD2 0xd2890000u
#define S_MUL_HI_U32_IMUL_R 0x960f1010u
#define S_MUL_I32_IMUL 0x92000000u
#define S_MUL_HI_U32_IMUL_R_2 0x960fff10u
#define S_MUL_HI_U32_IMUL_M 0x96210e10u
#define S_MOV_B32_IMUL_RCP 0xbea000ffu
#define S_MUL_HI_U32_IMUL_RCP 0x960f2010u
#define S_XOR_B32_64 0x88000000u
#define S_MOV_B32_XOR_R 0xbebe00ffu
#define S_LSHR 0x8f000000u
#define S_LSHL 0x8e000000u
#define S_OR 0x87000000u
#define S_AND 0x86000000u
#define S_BFE 0x93000000u
#define DS_SWIZZLE_B32_FSWAP_R 0xd87a8001u
#define V_ADD_F64 0xd280003cu
#define V_AND_B32 0x26000000u
#define GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP 0xdc508000u
#define V_XOR_B32 0x2a000000u
#define V_MUL_F64 0xd2810044u
#endif
__global uint* jit_scratchpad_calc_address(__global uint* p, uint src, uint imm32, uint mask_reg, uint batch_size)
{
// s_add_i32 s14, s(16 + src * 2), imm32
@@ -50,7 +106,7 @@ __global uint* jit_scratchpad_calc_address(__global uint* p, uint src, uint imm3
*(p++) = imm32;
// v_and_b32 v28, s14, mask_reg
*(p++) = 0x2638000eu | (mask_reg << 9);
*(p++) = V_AND_B32_CALC_ADDRESS | (mask_reg << 9);
return p;
}
@@ -70,7 +126,7 @@ __global uint* jit_scratchpad_load(__global uint* p, uint vgpr_index)
#if GCN_VERSION >= 14
// global_load_dwordx2 v[vgpr_index:vgpr_index+1], v28, s[0:1]
*(p++) = 0xdc548000u;
*(p++) = GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD;
*(p++) = 0x0000001cu | (vgpr_index << 24);
#else
*(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28
@@ -87,14 +143,14 @@ __global uint* jit_scratchpad_load2(__global uint* p, uint vgpr_index, int vmcnt
{
// s_waitcnt vmcnt(N)
if (vmcnt >= 0)
*(p++) = 0xbf8c0f70u | (vmcnt & 15) | ((vmcnt >> 4) << 14);
*(p++) = S_WAITCNT_SCRATCHPAD_LOAD2 | (vmcnt & 15) | ((vmcnt >> 4) << 14);
// v_readlane_b32 s14, vgpr_index, 0
*(p++) = 0xd289000eu;
*(p++) = V_READLANE_B32_SCRATCHPAD_LOAD2 | 14;
*(p++) = 0x00010100u | vgpr_index;
// v_readlane_b32 s15, vgpr_index + 1, 0
*(p++) = 0xd289000fu;
*(p++) = V_READLANE_B32_SCRATCHPAD_LOAD2 | 15;
*(p++) = 0x00010100u | (vgpr_index + 1);
return p;
@@ -107,9 +163,12 @@ __global uint* jit_scratchpad_calc_address_fp(__global uint* p, uint src, uint i
*(p++) = imm32;
// v_and_b32 v28, s14, mask_reg
*(p++) = 0x2638000eu | (mask_reg << 9);
*(p++) = V_AND_B32 | 0x38000eu | (mask_reg << 9);
#if GCN_VERSION >= 14
#if GCN_VERSION >= 15
// v_add_nc_u32 v28, v28, v44
*(p++) = 0x4a38591cu;
#elif GCN_VERSION == 14
// v_add_u32 v28, v28, v44
*(p++) = 0x6838591cu;
#else
@@ -126,7 +185,7 @@ __global uint* jit_scratchpad_load_fp(__global uint* p, uint vgpr_index)
#if GCN_VERSION >= 14
// global_load_dword v(vgpr_index), v28, s[0:1]
*(p++) = 0xdc508000u;
*(p++) = GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP;
*(p++) = 0x0000001cu | (vgpr_index << 24);
#else
*(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28
@@ -143,7 +202,7 @@ __global uint* jit_scratchpad_load2_fp(__global uint* p, uint vgpr_index, int vm
{
// s_waitcnt vmcnt(N)
if (vmcnt >= 0)
*(p++) = 0xbf8c0f70u | (vmcnt & 15) | ((vmcnt >> 4) << 14);
*(p++) = S_WAITCNT_SCRATCHPAD_LOAD2 | (vmcnt & 15) | ((vmcnt >> 4) << 14);
// v_cvt_f64_i32 v[28:29], vgpr_index
*(p++) = 0x7e380900u | vgpr_index;
@@ -164,7 +223,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (shift > 0) // p = 3/4
{
// s_lshl_b64 s[14:15], s[(16 + src * 2):(17 + src * 2)], shift
*(p++) = 0x8e8e8010u | (src << 1) | (shift << 8);
*(p++) = S_LSHL | 0x8e8010u | (src << 1) | (shift << 8);
// s_add_u32 s(16 + dst * 2), s(16 + dst * 2), s14
*(p++) = 0x80100e10u | (dst << 1) | (dst << 17);
@@ -283,7 +342,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{
#if GCN_VERSION >= 14
// s_mul_hi_u32 s15, s(16 + dst * 2), s(16 + src * 2)
*(p++) = 0x960f1010u | (dst << 1) | (src << 9);
*(p++) = S_MUL_HI_U32_IMUL_R | (dst << 1) | (src << 9);
#else
// v_mov_b32 v28, s(16 + dst * 2)
*(p++) = 0x7e380210u | (dst << 1);
@@ -296,25 +355,25 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
#endif
// s_mul_i32 s14, s(16 + dst * 2), s(17 + src * 2)
*(p++) = 0x920e1110u | (dst << 1) | (src << 9);
*(p++) = S_MUL_I32_IMUL | 0x0e1110u | (dst << 1) | (src << 9);
// s_add_u32 s15, s15, s14
*(p++) = 0x800f0e0fu;
// s_mul_i32 s14, s(17 + dst * 2), s(16 + src * 2)
*(p++) = 0x920e1011u | (dst << 1) | (src << 9);
*(p++) = S_MUL_I32_IMUL | 0x0e1011u | (dst << 1) | (src << 9);
// s_add_u32 s(17 + dst * 2), s15, s14
*(p++) = 0x80110e0fu | (dst << 17);
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s(16 + src * 2)
*(p++) = 0x92101010u | (dst << 1) | (dst << 17) | (src << 9);
*(p++) = S_MUL_I32_IMUL | 0x101010u | (dst << 1) | (dst << 17) | (src << 9);
}
else // p = 1/8
{
#if GCN_VERSION >= 14
// s_mul_hi_u32 s15, s(16 + dst * 2), imm32
*(p++) = 0x960fff10u | (dst << 1);
*(p++) = S_MUL_HI_U32_IMUL_R_2 | (dst << 1);
*(p++) = inst.y;
#else
// v_mov_b32 v28, imm32
@@ -335,14 +394,14 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
}
// s_mul_i32 s14, s(17 + dst * 2), imm32
*(p++) = 0x920eff11u | (dst << 1);
*(p++) = S_MUL_I32_IMUL | 0x0eff11u | (dst << 1);
*(p++) = inst.y;
// s_add_u32 s(17 + dst * 2), s15, s14
*(p++) = 0x80110e0fu | (dst << 17);
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), imm32
*(p++) = 0x9210ff10u | (dst << 1) | (dst << 17);
*(p++) = S_MUL_I32_IMUL | 0x10ff10u | (dst << 1) | (dst << 17);
*(p++) = inst.y;
}
@@ -369,7 +428,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
#if GCN_VERSION >= 14
// s_mul_hi_u32 s33, s(16 + dst * 2), s14
*(p++) = 0x96210e10u | (dst << 1);
*(p++) = S_MUL_HI_U32_IMUL_M | (dst << 1);
#else
// v_mov_b32 v28, s(16 + dst * 2)
*(p++) = 0x7e380210u | (dst << 1);
@@ -382,19 +441,19 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
#endif
// s_mul_i32 s32, s(16 + dst * 2), s15
*(p++) = 0x92200f10u | (dst << 1);
*(p++) = S_MUL_I32_IMUL | 0x200f10u | (dst << 1);
// s_add_u32 s33, s33, s32
*(p++) = 0x80212021u;
// s_mul_i32 s32, s(17 + dst * 2), s14
*(p++) = 0x92200e11u | (dst << 1);
*(p++) = S_MUL_I32_IMUL | 0x200e11u | (dst << 1);
// s_add_u32 s(17 + dst * 2), s33, s32
*(p++) = 0x80112021u | (dst << 17);
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s14
*(p++) = 0x92100e10u | (dst << 1) | (dst << 17);
*(p++) = S_MUL_I32_IMUL | 0x100e10u | (dst << 1) | (dst << 17);
}
// (12*7/8 + 8*1/8 + 28) + 24 = 63.5 bytes on average
@@ -404,10 +463,17 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_IMULH_R)
{
#if GCN_VERSION >= 15
*(p++) = 0xbe8e0410u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60410u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc213au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
// 16 bytes
return p;
@@ -430,9 +496,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
#if GCN_VERSION >= 15
*(p++) = 0xbea60410u | (dst << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc213au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
}
// (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average
@@ -442,10 +514,17 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_ISMULH_R)
{
#if GCN_VERSION >= 15
*(p++) = 0xbe8e0410u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60410u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc2138u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
// 16 bytes
return p;
@@ -468,9 +547,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
#if GCN_VERSION >= 15
*(p++) = 0xbea60410u | (dst << 1); // s_mov_b64 s[38:39], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbebc2138u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#else
*(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57]
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
#endif
}
// (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average
@@ -484,10 +569,10 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{
const uint2 rcp_value = as_uint2(imul_rcp_value(inst.y));
*(p++) = 0xbea000ffu; // s_mov_b32 s32, imm32
*(p++) = S_MOV_B32_IMUL_RCP; // s_mov_b32 s32, imm32
*(p++) = rcp_value.x;
#if GCN_VERSION >= 14
*(p++) = 0x960f2010u | (dst << 1); // s_mul_hi_u32 s15, s(16 + dst * 2), s32
*(p++) = S_MUL_HI_U32_IMUL_RCP | (dst << 1); // s_mul_hi_u32 s15, s(16 + dst * 2), s32
#else
// v_mov_b32 v28, s32
*(p++) = 0x7e380220u;
@@ -498,12 +583,12 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
*(p++) = 0xd289000fu;
*(p++) = 0x0001011cu;
#endif
*(p++) = 0x920eff10u | (dst << 1); // s_mul_i32 s14, s(16 + dst * 2), imm32
*(p++) = S_MUL_I32_IMUL | 0x0eff10u | (dst << 1); // s_mul_i32 s14, s(16 + dst * 2), imm32
*(p++) = rcp_value.y;
*(p++) = 0x800f0e0fu; // s_add_u32 s15, s15, s14
*(p++) = 0x920e2011u | (dst << 1); // s_mul_i32 s14, s(17 + dst * 2), s32
*(p++) = S_MUL_I32_IMUL | 0x0e2011u | (dst << 1); // s_mul_i32 s14, s(17 + dst * 2), s32
*(p++) = 0x80110e0fu | (dst << 17); // s_add_u32 s(17 + dst * 2), s15, s14
*(p++) = 0x92102010u | (dst << 1) | (dst << 17);// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s32
*(p++) = S_MUL_I32_IMUL | 0x102010u | (dst << 1) | (dst << 17);// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s32
}
// 36 bytes
@@ -526,23 +611,23 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (src != dst) // p = 7/8
{
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
*(p++) = 0x88901010u | (dst << 1) | (dst << 17) | (src << 9);
*(p++) = S_XOR_B32_64 | 0x901010u | (dst << 1) | (dst << 17) | (src << 9);
}
else // p = 1/8
{
if (as_int(inst.y) < 0) // p = 1/2
{
// s_mov_b32 s62, imm32
*(p++) = 0xbebe00ffu;
*(p++) = S_MOV_B32_XOR_R;
*(p++) = inst.y;
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[62:63]
*(p++) = 0x88903e10u | (dst << 1) | (dst << 17);
*(p++) = S_XOR_B32_64 | 0x903e10u | (dst << 1) | (dst << 17);
}
else
{
// s_xor_b32 s(16 + dst * 2), s(16 + dst * 2), imm32
*(p++) = 0x8810ff10u | (dst << 1) | (dst << 17);
*(p++) = S_XOR_B32_64 | 0x10ff10u | (dst << 1) | (dst << 17);
*(p++) = inst.y;
}
}
@@ -569,7 +654,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[14:15]
*(p++) = 0x88900e10u | (dst << 1) | (dst << 17);
*(p++) = S_XOR_B32_64 | 0x900e10u | (dst << 1) | (dst << 17);
}
// (12*7/8 + 8*1/8 + 28) + 4 = 43.5 bytes on average
@@ -584,24 +669,24 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_IROR_R)
{
// s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2)
*(p++) = 0x8fa01010u | (dst << 1) | (src << 9);
*(p++) = S_LSHR | 0xa01010u | (dst << 1) | (src << 9);
// s_sub_u32 s15, 64, s(16 + src * 2)
*(p++) = 0x808f10c0u | (src << 9);
// s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15
*(p++) = 0x8ea20f10u | (dst << 1);
*(p++) = S_LSHL | 0xa20f10u | (dst << 1);
}
else
{
// s_lshl_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2)
*(p++) = 0x8ea01010u | (dst << 1) | (src << 9);
*(p++) = S_LSHL | 0xa01010u | (dst << 1) | (src << 9);
// s_sub_u32 s15, 64, s(16 + src * 2)
*(p++) = 0x808f10c0u | (src << 9);
// s_lshr_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15
*(p++) = 0x8fa20f10u | (dst << 1);
*(p++) = S_LSHR | 0xa20f10u | (dst << 1);
}
}
else // p = 1/8
@@ -609,14 +694,14 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
const uint shift = ((opcode < RANDOMX_FREQ_IROR_R) ? inst.y : -inst.y) & 63;
// s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], shift
*(p++) = 0x8fa08010u | (dst << 1) | (shift << 8);
*(p++) = S_LSHR | 0xa08010u | (dst << 1) | (shift << 8);
// s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], 64 - shift
*(p++) = 0x8ea28010u | (dst << 1) | ((64 - shift) << 8);
*(p++) = S_LSHL | 0xa28010u | (dst << 1) | ((64 - shift) << 8);
}
// s_or_b64 s[16 + dst * 2:17 + dst * 2], s[32:33], s[34:35]
*(p++) = 0x87902220u | (dst << 17);
*(p++) = S_OR | 0x902220u | (dst << 17);
// 12*7/8 + 8/8 + 4 = 15.5 bytes on average
return p;
@@ -627,9 +712,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
{
if (src != dst)
{
#if GCN_VERSION >= 15
*(p++) = 0xbea00410u | (dst << 1); // s_mov_b64 s[32:33], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbe900410u | (src << 1) | (dst << 17);// s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbe900420u | (src << 17); // s_mov_b64 s[16 + src * 2:17 + Src * 2], s[32:33]
#else
*(p++) = 0xbea00110u | (dst << 1); // s_mov_b64 s[32:33], s[16 + dst * 2:17 + dst * 2]
*(p++) = 0xbe900110u | (src << 1) | (dst << 17);// s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
*(p++) = 0xbe900120u | (src << 17); // s_mov_b64 s[16 + src * 2:17 + Src * 2], s[32:33]
#endif
}
// 12*7/8 = 10.5 bytes on average
@@ -640,11 +731,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSWAP_R)
{
// ds_swizzle_b32 v(60 + dst * 2), v(60 + dst * 2) offset:0x8001
*(p++) = 0xd87a8001u;
*(p++) = DS_SWIZZLE_B32_FSWAP_R;
*(p++) = 0x3c00003cu + (dst << 1) + (dst << 25);
// ds_swizzle_b32 v(61 + dst * 2), v(61 + dst * 2) offset:0x8001
*(p++) = 0xd87a8001u;
*(p++) = DS_SWIZZLE_B32_FSWAP_R;
*(p++) = 0x3d00003du + (dst << 1) + (dst << 25);
// s_waitcnt lgkmcnt(0)
@@ -658,7 +749,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FADD_R)
{
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[52 + src * 2:53 + src * 2]
*(p++) = 0xd280003cu + ((dst & 3) << 1);
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x0002693cu + ((dst & 3) << 1) + ((src & 3) << 10);
// 8 bytes
@@ -679,7 +770,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[28:29]
*(p++) = 0xd280003cu + ((dst & 3) << 1);
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x0002393cu + ((dst & 3) << 1);
}
@@ -691,7 +782,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSUB_R)
{
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[52 + src * 2:53 + src * 2]
*(p++) = 0xd280003cu + ((dst & 3) << 1);
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x4002693cu + ((dst & 3) << 1) + ((src & 3) << 10);
// 8 bytes
@@ -712,7 +803,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[28:29]
*(p++) = 0xd280003cu + ((dst & 3) << 1);
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
*(p++) = 0x4002393cu + ((dst & 3) << 1);
}
@@ -724,7 +815,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSCAL_R)
{
// v_xor_b32 v(61 + dst * 2), v(61 + dst * 2), v51
*(p++) = 0x2a7a673du + ((dst & 3) << 1) + ((dst & 3) << 18);
*(p++) = (V_XOR_B32 | 0x7a673du) + ((dst & 3) << 1) + ((dst & 3) << 18);
// 4 bytes
return p;
@@ -734,7 +825,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FMUL_R)
{
// v_mul_f64 v[68 + dst * 2:69 + dst * 2], v[68 + dst * 2:69 + dst * 2], v[52 + src * 2:53 + src * 2]
*(p++) = 0xd2810044u + ((dst & 3) << 1);
*(p++) = V_MUL_F64 + ((dst & 3) << 1);
*(p++) = 0x00026944u + ((dst & 3) << 1) + ((src & 3) << 10);
// 8 bytes
@@ -755,7 +846,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
// s_swappc_b64 s[60:61], s[48 + dst * 2:49 + dst * 2]
#if GCN_VERSION >= 15
*(p++) = 0xbebc2130u + ((dst & 3) << 1);
#else
*(p++) = 0xbebc1e30u + ((dst & 3) << 1);
#endif
}
// 32 + 4 = 36 bytes
@@ -766,7 +861,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
if (opcode < RANDOMX_FREQ_FSQRT_R)
{
// s_swappc_b64 s[60:61], s[40 + dst * 2:41 + dst * 2]
#if GCN_VERSION >= 15
*(p++) = 0xbebc2128u + ((dst & 3) << 1);
#else
*(p++) = 0xbebc1e28u + ((dst & 3) << 1);
#endif
// 4 bytes
return p;
@@ -789,7 +888,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
const uint conditionMaskReg = 70 + (mod >> 4);
// s_and_b32 s14, s(16 + dst * 2), conditionMaskReg
*(p++) = 0x860e0010u | (dst << 1) | (conditionMaskReg << 8);
*(p++) = S_AND | 0x0e0010u | (dst << 1) | (conditionMaskReg << 8);
// s_cbranch_scc0 target
const int delta = ((last_branch_target - p) - 1);
@@ -805,26 +904,30 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
const uint shift = inst.y & 63;
if (shift == 63)
{
*(p++) = 0x8e0e8110u | (src << 1); // s_lshl_b32 s14, s(16 + src * 2), 1
*(p++) = 0x8f0f9f11u | (src << 1); // s_lshr_b32 s15, s(17 + src * 2), 31
*(p++) = 0x870e0f0eu; // s_or_b32 s14, s14, s15
*(p++) = 0x860e830eu; // s_and_b32 s14, s14, 3
*(p++) = S_LSHL | 0x0e8110u | (src << 1); // s_lshl_b32 s14, s(16 + src * 2), 1
*(p++) = S_LSHR | 0x0f9f11u | (src << 1); // s_lshr_b32 s15, s(17 + src * 2), 31
*(p++) = S_OR | 0x0e0f0eu; // s_or_b32 s14, s14, s15
*(p++) = S_AND | 0x0e830eu; // s_and_b32 s14, s14, 3
}
else
{
// s_bfe_u64 s[14:15], s[16:17], (shift,width=2)
*(p++) = 0x938eff10u | (src << 1);
*(p++) = S_BFE | 0x8eff10u | (src << 1);
*(p++) = shift | (2 << 16);
}
// s_brev_b32 s14, s14
*(p++) = 0xbe8e080eu;
// s_lshr_b32 s66, s14, 30
*(p++) = 0x8f429e0eu;
// s_setreg_b32 hwreg(mode, 2, 2), s66
#if GCN_VERSION >= 15
*(p++) = 0xbe8e0b0eu;
*(p++) = 0x90429e0eu;
*(p++) = 0xb9c20881u;
#else
*(p++) = 0xbe8e080eu;
*(p++) = 0x8f429e0eu;
*(p++) = 0xb9420881u;
#endif
// 20 bytes
return p;
@@ -843,6 +946,10 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
// v28 = offset
#if GCN_VERSION >= 14
#if GCN_VERSION >= 15
// s_waitcnt vmcnt(0)
*(p++) = 0xbf8c3f70u;
#endif
// global_store_dwordx2 v28, v[vgpr_id:vgpr_id + 1], s[0:1]
*(p++) = 0xdc748000u;
*(p++) = 0x0000001cu | (vgpr_id << 8);
@@ -903,7 +1010,7 @@ __global uint* generate_jit_code(__global uint2* e, __global uint2* p0, __global
int prefetch_data_count;
#pragma unroll 1
for (int pass = 0; pass < 2; ++pass)
for (volatile int pass = 0; pass < 2; ++pass)
{
#if RANDOMX_PROGRAM_SIZE > 256
int registerLastChanged[8] = { -1, -1, -1, -1, -1, -1, -1, -1 };
@@ -1419,14 +1526,14 @@ __global uint* generate_jit_code(__global uint2* e, __global uint2* p0, __global
{
// Code size limit exceeded!!!
// Jump back to randomx_run kernel
*(p++) = 0xbe801d0cu; // s_setpc_b64 s[12:13]
*(p++) = S_SETPC_B64_S12_13; // s_setpc_b64 s[12:13]
return p;
}
} while (!done);
}
// Jump back to randomx_run kernel
*(p++) = 0xbe801d0cu; // s_setpc_b64 s[12:13]
*(p++) = S_SETPC_B64_S12_13; // s_setpc_b64 s[12:13]
return p;
}

View File

@@ -0,0 +1,742 @@
/*
Copyright (c) 2019-2020 SChernykh
This file is part of RandomX OpenCL.
RandomX OpenCL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
RandomX OpenCL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
*/
.rocm
.gpu GFX1010
.arch_minor 1
.arch_stepping 0
.eflags 53
.llvm10binfmt
.metadatav3
.md_version 1, 0
.globaldata
.fill 64, 1, 0
.kernel randomx_run
.config
.dims x
.sgprsnum 96
.vgprsnum 128
.shared_vgprs 0
.dx10clamp
.ieeemode
.floatmode 0xf0
.priority 0
.exceptions 0
.userdatanum 6
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc1-gfx6-gfx10-table
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc2-gfx6-gfx10-table
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc3-gfx10-table
.pgmrsrc1 0x40af0105
.pgmrsrc2 0x0000008c
.pgmrsrc3 0x00000000
.group_segment_fixed_size 256
.private_segment_fixed_size 0
.kernel_code_entry_offset 0x10c0
.use_private_segment_buffer
.use_kernarg_segment_ptr
.use_wave32
.config
.md_symname "randomx_run.kd"
.md_language "OpenCL C", 1, 2
.reqd_work_group_size 32, 1, 1
.md_kernarg_segment_size 104
.md_kernarg_segment_align 8
.md_group_segment_fixed_size 256
.md_private_segment_fixed_size 0
.md_wavefront_size 32
.md_sgprsnum 96
.md_vgprsnum 128
.spilledsgprs 0
.spilledvgprs 0
.max_flat_work_group_size 32
.arg dataset, "uchar*", 8, 0, globalbuf, u8, global, default const
.arg scratchpad, "uchar*", 8, 8, globalbuf, u8, global, default
.arg registers, "ulong*", 8, 16, globalbuf, u64, global, default
.arg rounding_modes, "uint*", 8, 24, globalbuf, u32, global, default
.arg programs, "uint*", 8, 32, globalbuf, u32, global, default
.arg batch_size, "uint", 4, 40, value, u32
.arg rx_parameters, "uint", 4, 44, value, u32
.arg , "", 8, 48, gox, i64
.arg , "", 8, 56, goy, i64
.arg , "", 8, 64, goz, i64
.arg , "", 8, 72, none, i8
.arg , "", 8, 80, none, i8
.arg , "", 8, 88, none, i8
.arg , "", 8, 96, multigridsyncarg, i8
.text
randomx_run:
# clear all caches
s_dcache_wb
s_waitcnt vmcnt(0) & lgkmcnt(0)
s_waitcnt_vscnt null, 0x0
s_icache_inv
s_branch begin
# pgmrsrc2 = 0x0000008c, bits 1:5 = 6, so first 6 SGPRs (s0-s7) contain user data
# s6 contains group id
# v0 contains local id
begin:
# s[0:1] - pointer to registers
# s[2:3] - pointer to rounding modes
s_load_dwordx4 s[0:3], s[4:5], 0x10
# s[8:9] - group_id*group_size
s_mov_b32 s9, 0
s_lshl_b32 s8, s6, 5
# v0 - local id (sub)
# v39 - R[sub]
v_lshlrev_b32 v39, 3, v0
s_mov_b32 s12, s7
# vcc_lo = "if (sub < 8)"
v_cmp_gt_u32 vcc_lo, 8, v0
s_waitcnt lgkmcnt(0)
# load rounding mode
s_lshl_b32 s16, s6, 2
s_add_u32 s64, s2, s16
s_addc_u32 s65, s3, 0
v_mov_b32 v1, 0
global_load_dword v1, v1, s[64:65]
s_waitcnt vmcnt(0)
v_readlane_b32 s66, v1, 0
s_setreg_b32 hwreg(mode, 2, 2), s66
s_mov_b32 s67, 0
# ((__local ulong*) R)[sub] = ((__global ulong*) registers)[sub];
s_lshl_b64 s[2:3], s[8:9], 3
s_mov_b32 s32, s12
s_add_u32 s0, s0, s2
s_addc_u32 s1, s1, s3
v_add_co_u32 v1, s0, s0, v39
v_add_co_ci_u32 v2, s0, s1, 0, s0
global_load_dwordx2 v[4:5], v[1:2], off
s_waitcnt vmcnt(0)
ds_write_b64 v39, v[4:5]
s_waitcnt vmcnt(0) & lgkmcnt(0)
s_waitcnt_vscnt null, 0x0
# "if (sub >= 8) return"
s_and_saveexec_b32 s0, vcc_lo
s_cbranch_execz program_end
# s[8:9] - pointer to dataset
# s[10:11] - pointer to scratchpads
# s[0:1] - pointer to programs
s_load_dwordx4 s[8:11], s[4:5], 0x0
s_load_dwordx2 s[0:1], s[4:5], 0x20
# rx_parameters
s_load_dword s20, s[4:5], 0x2c
v_mov_b32 v5, 0
v_mov_b32 v10, 0
s_waitcnt_vscnt null, 0x0
ds_read_b64 v[8:9], v39
v_cmp_gt_u32 vcc_lo, 4, v0
v_lshlrev_b32 v0, 3, v0
ds_read2_b64 v[25:28], v5 offset0:16 offset1:17
ds_read_b32 v11, v5 offset:152
ds_read_b64 v[35:36], v5 offset:168
ds_read2_b64 v[20:23], v5 offset0:18 offset1:20
v_cndmask_b32 v4, 0xffffff, -1, vcc_lo
v_add_nc_u32 v5, v39, v0
s_waitcnt lgkmcnt(0)
v_mov_b32 v13, s11
v_mov_b32 v7, s1
v_mov_b32 v6, s0
# Scratchpad L1 size
s_bfe_u32 s21, s20, 0x050000
s_lshl_b32 s21, 1, s21
# Scratchpad L2 size
s_bfe_u32 s22, s20, 0x050005
s_lshl_b32 s22, 1, s22
# Scratchpad L3 size
s_bfe_u32 s0, s20, 0x05000A
s_lshl_b32 s23, 1, s0
# program iterations
s_bfe_u32 s24, s20, 0x04000F
s_lshl_b32 s24, 1, s24
v_mov_b32 v12, s10
v_mad_u64_u32 v[6:7], s2, 10048, s6, v[6:7]
# s[4:5] - pointer to current program
v_readlane_b32 s4, v6, 0
v_readlane_b32 s5, v7, 0
s_lshl_b32 s2, 1, s0
v_add_co_u32 v14, s0, s8, v11
v_cndmask_b32 v34, v36, 0, vcc_lo
v_cndmask_b32 v24, v23, 0, vcc_lo
v_cndmask_b32 v3, v22, 0, vcc_lo
s_add_i32 s3, s2, 64
v_add_co_ci_u32 v29, s0, s9, v10, s0
v_cndmask_b32 v35, v35, 0, vcc_lo
v_add_co_u32 v22, vcc_lo, v14, v0
# v[12:13] - pointer to current scratchpad
v_mad_u64_u32 v[12:13], s2, s3, s6, v[12:13]
v_mov_b32 v10, v26
v_mov_b32 v11, v25
v_lshlrev_b32 v36, 3, v27
v_lshlrev_b32 v37, 3, v28
v_lshlrev_b32 v20, 3, v20
v_lshlrev_b32 v21, 3, v21
v_add_co_ci_u32 v23, vcc_lo, 0, v29, vcc_lo
# rename registers
# v6 - R[sub]
v_mov_b32 v6, v39
# loop counter
s_sub_u32 s2, s24, 1
# used in IXOR_R instruction
s_mov_b32 s63, -1
# used in CBRANCH instruction
s_mov_b32 s70, (0xFF << 8)
s_mov_b32 s71, (0xFF << 9)
s_mov_b32 s72, (0xFF << 10)
s_mov_b32 s73, (0xFF << 11)
s_mov_b32 s74, (0xFF << 12)
s_mov_b32 s75, (0xFF << 13)
s_mov_b32 s76, (0xFF << 14)
s_mov_b32 s77, (0xFF << 15)
s_mov_b32 s78, (0xFF << 16)
s_mov_b32 s79, (0xFF << 17)
s_mov_b32 s80, (0xFF << 18)
s_mov_b32 s81, (0xFF << 19)
s_mov_b32 s82, (0xFF << 20)
s_mov_b32 s83, (0xFF << 21)
s_mov_b32 s84, (0xFF << 22)
s_mov_b32 s85, (0xFF << 23)
# ScratchpadL3Mask64
s_sub_u32 s86, s23, 64
# Scratchpad masks for scratchpads
v_sub_nc_u32 v38, s21, 8
v_sub_nc_u32 v39, s22, 8
v_sub_nc_u32 v50, s23, 8
# mask for FSCAL_R
v_mov_b32 v51, 0x80F00000
# load scratchpad base address
v_readlane_b32 s0, v12, 0
v_readlane_b32 s1, v13, 0
# v41, v44 = 0
v_mov_b32 v41, 0
v_mov_b32 v44, 0
# v41 = 0 on lane 0, set it to 8 on lane 1
# v44 = 0 on lane 0, set it to 4 on lane 1
s_mov_b64 exec, 2
v_mov_b32 v41, 8
v_mov_b32 v44, 4
# load group A registers
# Read low 8 bytes into lane 0 and high 8 bytes into lane 1
s_mov_b64 exec, 3
ds_read2_b64 v[52:55], v41 offset0:24 offset1:26
ds_read2_b64 v[56:59], v41 offset0:28 offset1:30
# xmantissaMask
v_mov_b32 v77, (1 << 24) - 1
# xexponentMask
ds_read_b64 v[78:79], v41 offset:160
# Restore execution mask
s_mov_b64 exec, 255
# sign mask (used in FSQRT_R)
v_mov_b32 v82, 0x80000000
# used in FSQRT_R to check for "positive normal value" (v_cmpx_class_f64)
s_mov_b32 s68, 256
s_mov_b32 s69, 0
# High 32 bits of "1.0" constant (used in FDIV_M)
v_mov_b32 v83, (1023 << 20)
# Used to multiply FP64 values by 0.5
v_mov_b32 v84, (1 << 20)
s_getpc_b64 s[14:15]
cur_addr:
# get addresses of FSQRT_R subroutines
s_add_u32 s40, s14, fsqrt_r_sub0 - cur_addr
s_addc_u32 s41, s15, 0
s_add_u32 s42, s14, fsqrt_r_sub1 - cur_addr
s_addc_u32 s43, s15, 0
s_add_u32 s44, s14, fsqrt_r_sub2 - cur_addr
s_addc_u32 s45, s15, 0
s_add_u32 s46, s14, fsqrt_r_sub3 - cur_addr
s_addc_u32 s47, s15, 0
# get addresses of FDIV_M subroutines
s_add_u32 s48, s14, fdiv_m_sub0 - cur_addr
s_addc_u32 s49, s15, 0
s_add_u32 s50, s14, fdiv_m_sub1 - cur_addr
s_addc_u32 s51, s15, 0
s_add_u32 s52, s14, fdiv_m_sub2 - cur_addr
s_addc_u32 s53, s15, 0
s_add_u32 s54, s14, fdiv_m_sub3 - cur_addr
s_addc_u32 s55, s15, 0
# get address for ISMULH_R subroutine
s_add_u32 s56, s14, ismulh_r_sub - cur_addr
s_addc_u32 s57, s15, 0
# get address for IMULH_R subroutine
s_add_u32 s58, s14, imulh_r_sub - cur_addr
s_addc_u32 s59, s15, 0
/*
used: v0-v6, v8-v37
not used: v7
*/
main_loop:
s_waitcnt_vscnt null, 0x0
# v[27:28] = R[readReg0]
# v[29:30] = R[readReg1]
ds_read_b64 v[27:28], v37
ds_read_b64 v[29:30], v36
s_waitcnt lgkmcnt(0)
# R[readReg0] ^ R[readReg0] (high 32 bits)
v_xor_b32 v28, v28, v30
# spAddr1
v_xor_b32 v25, v28, v25
v_and_b32 v25, s86, v25
v_add_nc_u32 v25, v25, v0
v_add_co_u32 v16, vcc_lo, s0, v25
# R[readReg0] ^ R[readReg0] (low 32 bits)
v_xor_b32 v25, v27, v29
v_mov_b32 v29, v11
v_add_co_ci_u32 v17, vcc_lo, 0, s1, vcc_lo
v_xor_b32 v25, v25, v26
# load from spAddr1
global_load_dwordx2 v[27:28], v[16:17], off
# spAddr0
v_and_b32 v25, s86, v25
v_add_nc_u32 v25, v25, v0
v_add_co_u32 v31, vcc_lo, s0, v25
v_add_co_ci_u32 v32, vcc_lo, 0, s1, vcc_lo
v_add_co_u32 v29, vcc_lo, v22, v29
# load from spAddr0
global_load_dwordx2 v[25:26], v[31:32], off
v_add_co_ci_u32 v30, vcc_lo, 0, v23, vcc_lo
v_mov_b32 v33, v11
s_and_b32 vcc_lo, exec_lo, vcc_lo
s_waitcnt vmcnt(1)
v_cvt_f64_i32 v[14:15], v28
v_cvt_f64_i32 v[12:13], v27
v_or_b32 v14, v14, v35
s_waitcnt vmcnt(0)
# R[sub] ^= *p0;
v_xor_b32 v8, v25, v8
v_xor_b32 v9, v26, v9
v_and_b32 v26, v4, v15
v_and_b32 v19, v4, v13
v_or_b32 v15, v26, v34
v_or_b32 v18, v12, v3
v_mov_b32 v26, 0
v_or_b32 v19, v19, v24
v_mov_b32 v25, v26
ds_write2_b64 v5, v[18:19], v[14:15] offset0:8 offset1:9
# load from dataset
global_load_dwordx2 v[18:19], v[29:30], off
# load group F,E registers
# Read low 8 bytes into lane 0 and high 8 bytes into lane 1
s_mov_b64 exec, 3
s_waitcnt lgkmcnt(0)
ds_read2_b64 v[60:63], v41 offset0:8 offset1:10
ds_read2_b64 v[64:67], v41 offset0:12 offset1:14
ds_read2_b64 v[68:71], v41 offset0:16 offset1:18
ds_read2_b64 v[72:75], v41 offset0:20 offset1:22
# load VM integer registers
v_readlane_b32 s16, v8, 0
v_readlane_b32 s17, v9, 0
v_readlane_b32 s18, v8, 1
v_readlane_b32 s19, v9, 1
v_readlane_b32 s20, v8, 2
v_readlane_b32 s21, v9, 2
v_readlane_b32 s22, v8, 3
v_readlane_b32 s23, v9, 3
v_readlane_b32 s24, v8, 4
v_readlane_b32 s25, v9, 4
v_readlane_b32 s26, v8, 5
v_readlane_b32 s27, v9, 5
v_readlane_b32 s28, v8, 6
v_readlane_b32 s29, v9, 6
v_readlane_b32 s30, v8, 7
v_readlane_b32 s31, v9, 7
s_waitcnt lgkmcnt(0)
# Use only first 2 lanes for the program
s_mov_b64 exec, 3
# call JIT code
s_swappc_b64 s[12:13], s[4:5]
# Write out group F,E registers
# Write low 8 bytes from lane 0 and high 8 bytes from lane 1
ds_write2_b64 v41, v[60:61], v[62:63] offset0:8 offset1:10
ds_write2_b64 v41, v[64:65], v[66:67] offset0:12 offset1:14
ds_write2_b64 v41, v[68:69], v[70:71] offset0:16 offset1:18
ds_write2_b64 v41, v[72:73], v[74:75] offset0:20 offset1:22
# store VM integer registers
v_writelane_b32 v8, s16, 0
v_writelane_b32 v9, s17, 0
v_writelane_b32 v8, s18, 1
v_writelane_b32 v9, s19, 1
v_writelane_b32 v8, s20, 2
v_writelane_b32 v9, s21, 2
v_writelane_b32 v8, s22, 3
v_writelane_b32 v9, s23, 3
v_writelane_b32 v8, s24, 4
v_writelane_b32 v9, s25, 4
v_writelane_b32 v8, s26, 5
v_writelane_b32 v9, s27, 5
v_writelane_b32 v8, s28, 6
v_writelane_b32 v9, s29, 6
v_writelane_b32 v8, s30, 7
v_writelane_b32 v9, s31, 7
# Turn back on 8 execution lanes
s_mov_b64 exec, 255
# Write out VM integer registers
ds_write_b64 v6, v[8:9]
s_waitcnt lgkmcnt(0)
# R[readReg2], R[readReg3]
ds_read_b32 v11, v21
ds_read_b32 v27, v20
s_waitcnt lgkmcnt(0)
# mx ^= R[readReg2] ^ R[readReg3];
v_xor_b32 v11, v11, v27
v_xor_b32 v10, v10, v11
# v[27:28] = R[sub]
# v[29:30] = F[sub]
ds_read2_b64 v[27:30], v6 offset1:8
# mx &= CacheLineAlignMask;
v_and_b32 v11, 0x7fffffc0, v10
v_mov_b32 v10, v33
s_waitcnt lgkmcnt(0)
# const ulong next_r = R[sub] ^ data;
s_waitcnt lgkmcnt(0)
v_xor_b32 v8, v27, v18
v_xor_b32 v9, v28, v19
# *p1 = next_r;
global_store_dwordx2 v[16:17], v[8:9], off
# v[27:28] = E[sub]
ds_read_b64 v[27:28], v6 offset:128
# R[sub] = next_r;
ds_write_b64 v6, v[8:9]
s_waitcnt lgkmcnt(1)
# *p0 = as_ulong(F[sub]) ^ as_ulong(E[sub]);
v_xor_b32 v29, v27, v29
v_xor_b32 v30, v28, v30
global_store_dwordx2 v[31:32], v[29:30], off
s_sub_u32 s2, s2, 1
s_cbranch_scc0 main_loop
main_loop_end:
global_store_dwordx2 v[1:2], v[8:9], off
global_store_dwordx2 v[1:2], v[29:30], off inst_offset:64
global_store_dwordx2 v[1:2], v[27:28], off inst_offset:128
# store rounding mode
v_mov_b32 v0, 0
v_mov_b32 v1, s66
global_store_dword v0, v1, s[64:65]
program_end:
s_endpgm
fsqrt_r_sub0:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[68:69]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[68:69]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[68:69]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[68:69]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[68:69], s[68:69]
v_mov_b32 v68, v42
v_mov_b32 v69, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fsqrt_r_sub1:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[70:71]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[70:71]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[70:71]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[70:71]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[70:71], s[68:69]
v_mov_b32 v70, v42
v_mov_b32 v71, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fsqrt_r_sub2:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[72:73]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[72:73]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[72:73]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[72:73]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[72:73], s[68:69]
v_mov_b32 v72, v42
v_mov_b32 v73, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fsqrt_r_sub3:
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rsq_f64 v[28:29], v[74:75]
# Improve initial approximation (can be skipped)
#v_mul_f64 v[42:43], v[28:29], v[74:75]
#v_mul_f64 v[48:49], v[28:29], -0.5
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
v_mul_f64 v[42:43], v[28:29], v[74:75]
v_mov_b32 v48, v28
v_sub_nc_u32 v49, v29, v84
v_mov_b32 v46, v28
v_xor_b32 v47, v49, v82
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[74:75]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
v_cmpx_class_f64 v[74:75], s[68:69]
v_mov_b32 v74, v42
v_mov_b32 v75, v43
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
fdiv_m_sub0:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[68:69], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[68:69]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[68:69]
v_cmpx_eq_f64 v[68:69], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v68, v80
v_mov_b32 v69, v81
s_setpc_b64 s[60:61]
fdiv_m_sub1:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[70:71], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[70:71]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[70:71]
v_cmpx_eq_f64 v[70:71], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v70, v80
v_mov_b32 v71, v81
s_setpc_b64 s[60:61]
fdiv_m_sub2:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[72:73], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[72:73]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[72:73]
v_cmpx_eq_f64 v[72:73], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v72, v80
v_mov_b32 v73, v81
s_setpc_b64 s[60:61]
fdiv_m_sub3:
v_or_b32 v28, v28, v78
v_and_or_b32 v29, v29, v77, v79
s_setreg_b32 hwreg(mode, 2, 2), s67
v_rcp_f64 v[48:49], v[28:29]
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
v_mul_f64 v[80:81], v[74:75], v[48:49]
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[74:75]
s_setreg_b32 hwreg(mode, 2, 2), s66
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[74:75]
v_cmpx_eq_f64 v[74:75], v[28:29]
v_mov_b32 v80, 0
v_mov_b32 v81, v83
s_mov_b64 exec, 3
v_mov_b32 v74, v80
v_mov_b32 v75, v81
s_setpc_b64 s[60:61]
ismulh_r_sub:
s_mov_b64 exec, 1
v_mov_b32 v45, s14
v_mul_hi_u32 v40, s38, v45
v_mov_b32 v47, s15
v_mad_u64_u32 v[42:43], s32, s38, v47, v[40:41]
v_mov_b32 v40, v42
v_mad_u64_u32 v[45:46], s32, s39, v45, v[40:41]
v_mad_u64_u32 v[42:43], s32, s39, v47, v[43:44]
v_add_co_u32 v42, vcc_lo, v42, v46
v_add_co_ci_u32 v43, vcc_lo, 0, v43, vcc_lo
v_readlane_b32 s32, v42, 0
v_readlane_b32 s33, v43, 0
s_cmp_lt_i32 s15, 0
s_cselect_b64 s[34:35], s[38:39], 0
s_sub_u32 s32, s32, s34
s_subb_u32 s33, s33, s35
s_cmp_lt_i32 s39, 0
s_cselect_b64 s[34:35], s[14:15], 0
s_sub_u32 s14, s32, s34
s_subb_u32 s15, s33, s35
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]
imulh_r_sub:
s_mov_b64 exec, 1
v_mov_b32 v45, s38
v_mul_hi_u32 v40, s14, v45
v_mov_b32 v47, s39
v_mad_u64_u32 v[42:43], s32, s14, v47, v[40:41]
v_mov_b32 v40, v42
v_mad_u64_u32 v[45:46], s32, s15, v45, v[40:41]
v_mad_u64_u32 v[42:43], s32, s15, v47, v[43:44]
v_add_co_u32 v42, vcc_lo, v42, v46
v_add_co_ci_u32 v43, vcc_lo, 0, v43, vcc_lo
v_readlane_b32 s14, v42, 0
v_readlane_b32 s15, v43, 0
s_mov_b64 exec, 3
s_setpc_b64 s[60:61]

View File

@@ -0,0 +1,303 @@
/*
This file was auto-generated from randomx_run_gfx1010.asm:
clrxasm randomx_run_gfx1010.asm -o randomx_run_gfx1010.bin
bin2h -c randomx_run_gfx1010_bin < randomx_run_gfx1010.bin > randomx_run_gfx1010.h
clrxasm can be downloaded here: https://github.com/CLRX/CLRX-mirror/releases
bin2h can be downloaded here: http://www.deadnode.org/sw/bin2h/
*/
static unsigned char randomx_run_gfx1010_bin[]={
0x7f,0x45,0x4c,0x46,0x02,0x01,0x01,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xe0,0x00,0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x40
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x40,0x00,0x38,0x00,0x08,0x00,0x40,0x00,0x0c,0x00,0x0a,0x00,0x06
,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0
,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x02
,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0xe5,0x74,0x64,0x04,0x00,0x00,0x00,0x00
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0xe5,0x74,0x64,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07
,0x00,0x00,0x00,0x20,0x06,0x00,0x00,0x20,0x00,0x00,0x00,0x41,0x4d,0x44,0x47,0x50,0x55,0x00,0x00,0x82,0xae,0x61,0x6d,0x64,0x68,0x73,0x61,0x2e,0x6b,0x65,0x72,0x6e
,0x65,0x6c,0x73,0x91,0xde,0x00,0x10,0xa5,0x2e,0x61,0x72,0x67,0x73,0x9e,0x88,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67
,0x6c,0x6f,0x62,0x61,0x6c,0xa9,0x2e,0x69,0x73,0x5f,0x63,0x6f,0x6e,0x73,0x74,0xc3,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xa7,0x64,0x61,0x74,0x61,0x73,0x65,0x74,0xa7,0x2e
,0x6f,0x66,0x66,0x73,0x65,0x74,0x00,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75,0x63,0x68,0x61,0x72,0x2a
,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75
,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x75,0x38,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c
,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xaa,0x73,0x63,0x72,0x61,0x74,0x63,0x68,0x70,0x61,0x64,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x08,0xa5,0x2e,0x73,0x69,0x7a,0x65
,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75,0x63,0x68,0x61,0x72,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad
,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x75,0x38,0x87,0xae,0x2e,0x61
,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xa9,0x72,0x65,0x67,0x69,0x73,0x74
,0x65,0x72,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x10,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75
,0x6c,0x6f,0x6e,0x67,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab
,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x36,0x34,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6
,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xae,0x72,0x6f,0x75,0x6e,0x64,0x69,0x6e,0x67,0x5f,0x6d,0x6f,0x64,0x65,0x73,0xa7,0x2e,0x6f,0x66,0x66
,0x73,0x65,0x74,0x18,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa5,0x75,0x69,0x6e,0x74,0x2a,0xab,0x2e,0x76,0x61
,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79
,0x70,0x65,0xa3,0x75,0x33,0x32,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e
,0x61,0x6d,0x65,0xa8,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79
,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa5,0x75,0x69,0x6e,0x74,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c
,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x86,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xaa,0x62
,0x61,0x74,0x63,0x68,0x5f,0x73,0x69,0x7a,0x65,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x04,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f
,0x6e,0x61,0x6d,0x65,0xa4,0x75,0x69,0x6e,0x74,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xa8,0x62,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0xab,0x2e
,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x86,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xad,0x72,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x65,0x74
,0x65,0x72,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x2c,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x04,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa4,0x75
,0x69,0x6e,0x74,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xa8,0x62,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f
,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x30,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65
,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x78,0xab,0x2e,0x76,0x61
,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x38,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76
,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x79
,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x40,0xa5,0x2e,0x73,0x69,0x7a,0x65
,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73
,0x65,0x74,0x5f,0x7a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x48,0xa5,0x2e
,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76
,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x50,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76
,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70
,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x58,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e
,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f
,0x66,0x66,0x73,0x65,0x74,0x60,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb9,0x68,0x69,0x64,0x64,0x65,0x6e
,0x5f,0x6d,0x75,0x6c,0x74,0x69,0x67,0x72,0x69,0x64,0x5f,0x73,0x79,0x6e,0x63,0x5f,0x61,0x72,0x67,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2
,0x69,0x38,0xb9,0x2e,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x66,0x69,0x78,0x65,0x64,0x5f,0x73,0x69,0x7a,0x65,0xcd,0x01,0x00,0xb6
,0x2e,0x6b,0x65,0x72,0x6e,0x61,0x72,0x67,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x61,0x6c,0x69,0x67,0x6e,0x08,0xb5,0x2e,0x6b,0x65,0x72,0x6e,0x61,0x72,0x67
,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,0x68,0xa9,0x2e,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0xa8,0x4f,0x70,0x65,0x6e,0x43,0x4c,0x20
,0x43,0xb1,0x2e,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x5f,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x92,0x01,0x02,0xb8,0x2e,0x6d,0x61,0x78,0x5f,0x66,0x6c,0x61,0x74
,0x5f,0x77,0x6f,0x72,0x6b,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x20,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xab,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72
,0x75,0x6e,0xbb,0x2e,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x66,0x69,0x78,0x65,0x64,0x5f,0x73,0x69,0x7a,0x65,0x00,0xb4
,0x2e,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x93,0x20,0x01,0x01,0xab,0x2e,0x73,0x67,0x70,0x72,0x5f,0x63
,0x6f,0x75,0x6e,0x74,0x60,0xb1,0x2e,0x73,0x67,0x70,0x72,0x5f,0x73,0x70,0x69,0x6c,0x6c,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x00,0xa7,0x2e,0x73,0x79,0x6d,0x62,0x6f,0x6c
,0xae,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0xab,0x2e,0x76,0x67,0x70,0x72,0x5f,0x63,0x6f,0x75,0x6e,0x74,0xcc,0x80,0xb1,0x2e,0x76
,0x67,0x70,0x72,0x5f,0x73,0x70,0x69,0x6c,0x6c,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x00,0xaf,0x2e,0x77,0x61,0x76,0x65,0x66,0x72,0x6f,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65
,0x20,0xae,0x61,0x6d,0x64,0x68,0x73,0x61,0x2e,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x92,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x12,0x03,0x06,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x11,0x03,0x05,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f
,0x72,0x75,0x6e,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xcf,0x03,0xaf,0x40,0x8c,0x00,0x00,0x00,0x09,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x84,0xf4,0x00,0x00,0x00,0x00,0x70,0x00,0x8c,0xbf,0x00,0x00,0xfd,0xbb,0x00,0x00,0x93,0xbf,0x00,0x00,0x82,0xbf,0x02,0x00,0x08,0xf4,0x10,0x00,0x00,0xfa,0x80
,0x03,0x89,0xbe,0x06,0x85,0x08,0x8f,0x83,0x00,0x4e,0x34,0x07,0x03,0x8c,0xbe,0x88,0x00,0x88,0x7d,0x7f,0xc0,0x8c,0xbf,0x06,0x82,0x10,0x8f,0x02,0x10,0x40,0x80,0x03
,0x80,0x41,0x82,0x80,0x02,0x02,0x7e,0x00,0x80,0x30,0xdc,0x01,0x00,0x40,0x01,0x70,0x3f,0x8c,0xbf,0x42,0x00,0x60,0xd7,0x01,0x01,0x01,0x00,0x81,0x08,0xc2,0xb9,0x80
,0x03,0xc3,0xbe,0x08,0x83,0x82,0x8f,0x0c,0x03,0xa0,0xbe,0x00,0x02,0x00,0x80,0x01,0x03,0x01,0x82,0x01,0x00,0x0f,0xd7,0x00,0x4e,0x02,0x00,0x02,0x00,0x28,0xd5,0x01
,0x00,0x01,0x00,0x00,0x80,0x34,0xdc,0x01,0x00,0x7d,0x04,0x70,0x3f,0x8c,0xbf,0x00,0x00,0x34,0xd9,0x27,0x04,0x00,0x00,0x70,0x00,0x8c,0xbf,0x00,0x00,0xfd,0xbb,0x6a
,0x3c,0x80,0xbe,0x65,0x01,0x88,0xbf,0x02,0x02,0x08,0xf4,0x00,0x00,0x00,0xfa,0x02,0x00,0x04,0xf4,0x20,0x00,0x00,0xfa,0x02,0x05,0x00,0xf4,0x2c,0x00,0x00,0xfa,0x80
,0x02,0x0a,0x7e,0x80,0x02,0x14,0x7e,0x00,0x00,0xfd,0xbb,0x00,0x00,0xd8,0xd9,0x27,0x00,0x00,0x08,0x84,0x00,0x88,0x7d,0x83,0x00,0x00,0x34,0x10,0x11,0xdc,0xd9,0x05
,0x00,0x00,0x19,0x98,0x00,0xd8,0xd8,0x05,0x00,0x00,0x0b,0xa8,0x00,0xd8,0xd9,0x05,0x00,0x00,0x23,0x12,0x14,0xdc,0xd9,0x05,0x00,0x00,0x14,0x04,0x00,0x01,0xd5,0xff
,0x82,0xa9,0x01,0xff,0xff,0xff,0x00,0x27,0x01,0x0a,0x4a,0x7f,0xc0,0x8c,0xbf,0x0b,0x02,0x1a,0x7e,0x01,0x02,0x0e,0x7e,0x00,0x02,0x0c,0x7e,0x14,0xff,0x95,0x93,0x00
,0x00,0x05,0x00,0x81,0x15,0x15,0x8f,0x14,0xff,0x96,0x93,0x05,0x00,0x05,0x00,0x81,0x16,0x16,0x8f,0x14,0xff,0x80,0x93,0x0a,0x00,0x05,0x00,0x81,0x00,0x17,0x8f,0x14
,0xff,0x98,0x93,0x0f,0x00,0x04,0x00,0x81,0x18,0x18,0x8f,0x0a,0x02,0x18,0x7e,0x06,0x02,0x76,0xd5,0xff,0x0c,0x18,0x04,0x40,0x27,0x00,0x00,0x04,0x00,0x60,0xd7,0x06
,0x01,0x01,0x00,0x05,0x00,0x60,0xd7,0x07,0x01,0x01,0x00,0x81,0x00,0x02,0x8f,0x0e,0x00,0x0f,0xd7,0x08,0x16,0x02,0x00,0x22,0x00,0x01,0xd5,0x24,0x01,0xa9,0x01,0x18
,0x00,0x01,0xd5,0x17,0x01,0xa9,0x01,0x03,0x00,0x01,0xd5,0x16,0x01,0xa9,0x01,0x02,0xc0,0x03,0x81,0x1d,0x00,0x28,0xd5,0x09,0x14,0x02,0x00,0x23,0x00,0x01,0xd5,0x23
,0x01,0xa9,0x01,0x16,0x6a,0x0f,0xd7,0x0e,0x01,0x02,0x00,0x0c,0x02,0x76,0xd5,0x03,0x0c,0x30,0x04,0x1a,0x03,0x14,0x7e,0x19,0x03,0x16,0x7e,0x83,0x36,0x48,0x34,0x83
,0x38,0x4a,0x34,0x83,0x28,0x28,0x34,0x83,0x2a,0x2a,0x34,0x80,0x3a,0x2e,0x50,0x27,0x03,0x0c,0x7e,0x18,0x81,0x82,0x80,0xc1,0x03,0xbf,0xbe,0xff,0x03,0xc6,0xbe,0x00
,0xff,0x00,0x00,0xff,0x03,0xc7,0xbe,0x00,0xfe,0x01,0x00,0xff,0x03,0xc8,0xbe,0x00,0xfc,0x03,0x00,0xff,0x03,0xc9,0xbe,0x00,0xf8,0x07,0x00,0xff,0x03,0xca,0xbe,0x00
,0xf0,0x0f,0x00,0xff,0x03,0xcb,0xbe,0x00,0xe0,0x1f,0x00,0xff,0x03,0xcc,0xbe,0x00,0xc0,0x3f,0x00,0xff,0x03,0xcd,0xbe,0x00,0x80,0x7f,0x00,0xff,0x03,0xce,0xbe,0x00
,0x00,0xff,0x00,0xff,0x03,0xcf,0xbe,0x00,0x00,0xfe,0x01,0xff,0x03,0xd0,0xbe,0x00,0x00,0xfc,0x03,0xff,0x03,0xd1,0xbe,0x00,0x00,0xf8,0x07,0xff,0x03,0xd2,0xbe,0x00
,0x00,0xf0,0x0f,0xff,0x03,0xd3,0xbe,0x00,0x00,0xe0,0x1f,0xff,0x03,0xd4,0xbe,0x00,0x00,0xc0,0x3f,0xff,0x03,0xd5,0xbe,0x00,0x00,0x80,0x7f,0x17,0xc0,0xd6,0x80,0x26
,0x00,0x26,0xd5,0x15,0x10,0x01,0x00,0x27,0x00,0x26,0xd5,0x16,0x10,0x01,0x00,0x32,0x00,0x26,0xd5,0x17,0x10,0x01,0x00,0xff,0x02,0x66,0x7e,0x00,0x00,0xf0,0x80,0x00
,0x00,0x60,0xd7,0x0c,0x01,0x01,0x00,0x01,0x00,0x60,0xd7,0x0d,0x01,0x01,0x00,0x80,0x02,0x52,0x7e,0x80,0x02,0x58,0x7e,0x82,0x04,0xfe,0xbe,0x88,0x02,0x52,0x7e,0x84
,0x02,0x58,0x7e,0x83,0x04,0xfe,0xbe,0x18,0x1a,0xdc,0xd9,0x29,0x00,0x00,0x34,0x1c,0x1e,0xdc,0xd9,0x29,0x00,0x00,0x38,0xff,0x02,0x9a,0x7e,0xff,0xff,0xff,0x00,0xa0
,0x00,0xd8,0xd9,0x29,0x00,0x00,0x4e,0xff,0x04,0xfe,0xbe,0xff,0x00,0x00,0x00,0xff,0x02,0xa4,0x7e,0x00,0x00,0x00,0x80,0xff,0x03,0xc4,0xbe,0x00,0x01,0x00,0x00,0x80
,0x03,0xc5,0xbe,0xff,0x02,0xa6,0x7e,0x00,0x00,0xf0,0x3f,0xff,0x02,0xa8,0x7e,0x00,0x00,0x10,0x00,0x00,0x1f,0x8e,0xbe,0x0e,0xff,0x28,0x80,0x48,0x03,0x00,0x00,0x0f
,0x80,0x29,0x82,0x0e,0xff,0x2a,0x80,0xac,0x03,0x00,0x00,0x0f,0x80,0x2b,0x82,0x0e,0xff,0x2c,0x80,0x10,0x04,0x00,0x00,0x0f,0x80,0x2d,0x82,0x0e,0xff,0x2e,0x80,0x74
,0x04,0x00,0x00,0x0f,0x80,0x2f,0x82,0x0e,0xff,0x30,0x80,0xd8,0x04,0x00,0x00,0x0f,0x80,0x31,0x82,0x0e,0xff,0x32,0x80,0x3c,0x05,0x00,0x00,0x0f,0x80,0x33,0x82,0x0e
,0xff,0x34,0x80,0xa0,0x05,0x00,0x00,0x0f,0x80,0x35,0x82,0x0e,0xff,0x36,0x80,0x04,0x06,0x00,0x00,0x0f,0x80,0x37,0x82,0x0e,0xff,0x38,0x80,0x68,0x06,0x00,0x00,0x0f
,0x80,0x39,0x82,0x0e,0xff,0x3a,0x80,0xdc,0x06,0x00,0x00,0x0f,0x80,0x3b,0x82,0x00,0x00,0xfd,0xbb,0x00,0x00,0xd8,0xd9,0x25,0x00,0x00,0x1b,0x00,0x00,0xd8,0xd9,0x24
,0x00,0x00,0x1d,0x7f,0xc0,0x8c,0xbf,0x1c,0x3d,0x38,0x3a,0x1c,0x33,0x32,0x3a,0x56,0x32,0x32,0x36,0x19,0x01,0x32,0x4a,0x10,0x6a,0x0f,0xd7,0x00,0x32,0x02,0x00,0x1b
,0x3b,0x32,0x3a,0x0b,0x03,0x3a,0x7e,0x11,0x6a,0x28,0xd5,0x80,0x02,0xa8,0x01,0x19,0x35,0x32,0x3a,0x00,0x80,0x34,0xdc,0x10,0x00,0x7d,0x1b,0x56,0x32,0x32,0x36,0x19
,0x01,0x32,0x4a,0x1f,0x6a,0x0f,0xd7,0x00,0x32,0x02,0x00,0x20,0x6a,0x28,0xd5,0x80,0x02,0xa8,0x01,0x1d,0x6a,0x0f,0xd7,0x16,0x3b,0x02,0x00,0x00,0x80,0x34,0xdc,0x1f
,0x00,0x7d,0x19,0x80,0x2e,0x3c,0x50,0x0b,0x03,0x42,0x7e,0x7e,0x6a,0x6a,0x87,0x71,0x3f,0x8c,0xbf,0x1c,0x09,0x1c,0x7e,0x1b,0x09,0x18,0x7e,0x0e,0x47,0x1c,0x38,0x70
,0x3f,0x8c,0xbf,0x19,0x11,0x10,0x3a,0x1a,0x13,0x12,0x3a,0x04,0x1f,0x34,0x36,0x04,0x1b,0x26,0x36,0x1a,0x45,0x1e,0x38,0x0c,0x07,0x24,0x38,0x80,0x02,0x34,0x7e,0x13
,0x31,0x26,0x38,0x1a,0x03,0x32,0x7e,0x08,0x09,0x38,0xd9,0x05,0x12,0x0e,0x00,0x00,0x80,0x34,0xdc,0x1d,0x00,0x7d,0x12,0x83,0x04,0xfe,0xbe,0x7f,0xc0,0x8c,0xbf,0x08
,0x0a,0xdc,0xd9,0x29,0x00,0x00,0x3c,0x0c,0x0e,0xdc,0xd9,0x29,0x00,0x00,0x40,0x10,0x12,0xdc,0xd9,0x29,0x00,0x00,0x44,0x14,0x16,0xdc,0xd9,0x29,0x00,0x00,0x48,0x10
,0x00,0x60,0xd7,0x08,0x01,0x01,0x00,0x11,0x00,0x60,0xd7,0x09,0x01,0x01,0x00,0x12,0x00,0x60,0xd7,0x08,0x03,0x01,0x00,0x13,0x00,0x60,0xd7,0x09,0x03,0x01,0x00,0x14
,0x00,0x60,0xd7,0x08,0x05,0x01,0x00,0x15,0x00,0x60,0xd7,0x09,0x05,0x01,0x00,0x16,0x00,0x60,0xd7,0x08,0x07,0x01,0x00,0x17,0x00,0x60,0xd7,0x09,0x07,0x01,0x00,0x18
,0x00,0x60,0xd7,0x08,0x09,0x01,0x00,0x19,0x00,0x60,0xd7,0x09,0x09,0x01,0x00,0x1a,0x00,0x60,0xd7,0x08,0x0b,0x01,0x00,0x1b,0x00,0x60,0xd7,0x09,0x0b,0x01,0x00,0x1c
,0x00,0x60,0xd7,0x08,0x0d,0x01,0x00,0x1d,0x00,0x60,0xd7,0x09,0x0d,0x01,0x00,0x1e,0x00,0x60,0xd7,0x08,0x0f,0x01,0x00,0x1f,0x00,0x60,0xd7,0x09,0x0f,0x01,0x00,0x7f
,0xc0,0x8c,0xbf,0x83,0x04,0xfe,0xbe,0x04,0x21,0x8c,0xbe,0x08,0x0a,0x38,0xd9,0x29,0x3c,0x3e,0x00,0x0c,0x0e,0x38,0xd9,0x29,0x40,0x42,0x00,0x10,0x12,0x38,0xd9,0x29
,0x44,0x46,0x00,0x14,0x16,0x38,0xd9,0x29,0x48,0x4a,0x00,0x08,0x00,0x61,0xd7,0x10,0x00,0x01,0x00,0x09,0x00,0x61,0xd7,0x11,0x00,0x01,0x00,0x08,0x00,0x61,0xd7,0x12
,0x02,0x01,0x00,0x09,0x00,0x61,0xd7,0x13,0x02,0x01,0x00,0x08,0x00,0x61,0xd7,0x14,0x04,0x01,0x00,0x09,0x00,0x61,0xd7,0x15,0x04,0x01,0x00,0x08,0x00,0x61,0xd7,0x16
,0x06,0x01,0x00,0x09,0x00,0x61,0xd7,0x17,0x06,0x01,0x00,0x08,0x00,0x61,0xd7,0x18,0x08,0x01,0x00,0x09,0x00,0x61,0xd7,0x19,0x08,0x01,0x00,0x08,0x00,0x61,0xd7,0x1a
,0x0a,0x01,0x00,0x09,0x00,0x61,0xd7,0x1b,0x0a,0x01,0x00,0x08,0x00,0x61,0xd7,0x1c,0x0c,0x01,0x00,0x09,0x00,0x61,0xd7,0x1d,0x0c,0x01,0x00,0x08,0x00,0x61,0xd7,0x1e
,0x0e,0x01,0x00,0x09,0x00,0x61,0xd7,0x1f,0x0e,0x01,0x00,0xff,0x04,0xfe,0xbe,0xff,0x00,0x00,0x00,0x00,0x00,0x34,0xd9,0x06,0x08,0x00,0x00,0x7f,0xc0,0x8c,0xbf,0x00
,0x00,0xd8,0xd8,0x15,0x00,0x00,0x0b,0x00,0x00,0xd8,0xd8,0x14,0x00,0x00,0x1b,0x7f,0xc0,0x8c,0xbf,0x0b,0x37,0x16,0x3a,0x0a,0x17,0x14,0x3a,0x00,0x08,0xdc,0xd9,0x06
,0x00,0x00,0x1b,0xff,0x14,0x16,0x36,0xc0,0xff,0xff,0x7f,0x21,0x03,0x14,0x7e,0x7f,0xc0,0x8c,0xbf,0x7f,0xc0,0x8c,0xbf,0x1b,0x25,0x10,0x3a,0x1c,0x27,0x12,0x3a,0x00
,0x80,0x74,0xdc,0x10,0x08,0x7d,0x00,0x80,0x00,0xd8,0xd9,0x06,0x00,0x00,0x1b,0x00,0x00,0x34,0xd9,0x06,0x08,0x00,0x00,0x7f,0xc1,0x8c,0xbf,0x1b,0x3b,0x3a,0x3a,0x1c
,0x3d,0x3c,0x3a,0x00,0x80,0x74,0xdc,0x1f,0x1d,0x7d,0x00,0x02,0x81,0x82,0x80,0x57,0xff,0x84,0xbf,0x00,0x80,0x74,0xdc,0x01,0x08,0x7d,0x00,0x40,0x80,0x74,0xdc,0x01
,0x1d,0x7d,0x00,0x80,0x80,0x74,0xdc,0x01,0x1b,0x7d,0x00,0x80,0x02,0x00,0x7e,0x42,0x02,0x02,0x7e,0x00,0x80,0x70,0xdc,0x00,0x01,0x40,0x00,0x00,0x00,0x81,0xbf,0x81
,0x08,0xc3,0xb9,0x44,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x89,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e
,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a,0x55,0x12,0x25,0x81
,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x44,0x89,0x00,0x00,0x2a,0x03,0x88,0x7e,0x2b,0x03,0x8a,0x7e,0x83,0x04,0xfe,0xbe,0x3c
,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x46,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x8d,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31
,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a
,0x55,0x1a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x46,0x89,0x00,0x00,0x2a,0x03,0x8c,0x7e,0x2b,0x03,0x8e,0x7e,0x83
,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x48,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x91,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c
,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e
,0x00,0x4c,0xd5,0x2a,0x55,0x22,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x48,0x89,0x00,0x00,0x2a,0x03,0x90,0x7e,0x2b
,0x03,0x92,0x7e,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x4a,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x95,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d
,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30
,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a,0x55,0x2a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x4a,0x89,0x00,0x00,0x2a
,0x03,0x94,0x7e,0x2b,0x03,0x96,0x7e,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c
,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x44,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c
,0xa1,0x12,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x12,0x05,0x44,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53
,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x88,0x7e,0x51,0x03,0x8a,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81
,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x46,0x61,0x02,0x00,0x2a
,0x00,0x4c,0xd5,0x1c,0xa1,0x1a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x1a,0x05,0x46,0x39,0x64,0x7c,0x80
,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x8c,0x7e,0x51,0x03,0x8e,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d
,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x48
,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c,0xa1,0x22,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x22,0x05,0x48
,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x90,0x7e,0x51,0x03,0x92,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d
,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50
,0x00,0x65,0xd5,0x4a,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c,0xa1,0x2a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a
,0x39,0x2a,0x05,0x4a,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x94,0x7e,0x51,0x03,0x96,0x7e,0x3c,0x20,0x80,0xbe,0x81
,0x04,0xfe,0xbe,0x0e,0x02,0x5a,0x7e,0x28,0x00,0x6a,0xd5,0x26,0x5a,0x02,0x00,0x0f,0x02,0x5e,0x7e,0x2a,0x20,0x76,0xd5,0x26,0x5e,0xa2,0x04,0x2a,0x03,0x50,0x7e,0x2d
,0x20,0x76,0xd5,0x27,0x5a,0xa2,0x04,0x2a,0x20,0x76,0xd5,0x27,0x5e,0xae,0x04,0x2a,0x6a,0x0f,0xd7,0x2a,0x5d,0x02,0x00,0x80,0x56,0x56,0x50,0x20,0x00,0x60,0xd7,0x2a
,0x01,0x01,0x00,0x21,0x00,0x60,0xd7,0x2b,0x01,0x01,0x00,0x0f,0x80,0x04,0xbf,0x26,0x80,0xa2,0x85,0x20,0x22,0xa0,0x80,0x21,0x23,0xa1,0x82,0x27,0x80,0x04,0xbf,0x0e
,0x80,0xa2,0x85,0x20,0x22,0x8e,0x80,0x21,0x23,0x8f,0x82,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x04,0xfe,0xbe,0x26,0x02,0x5a,0x7e,0x28,0x00,0x6a,0xd5,0x0e
,0x5a,0x02,0x00,0x27,0x02,0x5e,0x7e,0x2a,0x20,0x76,0xd5,0x0e,0x5e,0xa2,0x04,0x2a,0x03,0x50,0x7e,0x2d,0x20,0x76,0xd5,0x0f,0x5a,0xa2,0x04,0x2a,0x20,0x76,0xd5,0x0f
,0x5e,0xae,0x04,0x2a,0x6a,0x0f,0xd7,0x2a,0x5d,0x02,0x00,0x80,0x56,0x56,0x50,0x0e,0x00,0x60,0xd7,0x2a,0x01,0x01,0x00,0x0f,0x00,0x60,0xd7,0x2b,0x01,0x01,0x00,0x83
,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43
,0x4c,0x52,0x58,0x20,0x52,0x4f,0x43,0x6d,0x42,0x69,0x6e,0x47,0x65,0x6e,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x30,0x2e,0x31,0x2e,0x39,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x07,0x00,0x00
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x12,0x03,0x06,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x11,0x03,0x05,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x2e,0x6e,0x6f,0x74,0x65,0x00,0x2e,0x64,0x79,0x6e,0x73,0x79,0x6d,0x00,0x2e,0x68,0x61,0x73,0x68,0x00,0x2e,0x64,0x79,0x6e,0x73,0x74,0x72,0x00,0x2e,0x72,0x6f,0x64
,0x61,0x74,0x61,0x00,0x2e,0x74,0x65,0x78,0x74,0x00,0x2e,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x00,0x2e,0x63,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x00,0x2e,0x73,0x79,0x6d
,0x74,0x61,0x62,0x00,0x2e,0x73,0x68,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x2e,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x00,0x5f,0x44,0x59,0x4e,0x41,0x4d,0x49,0x43,0x00
,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x34
,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07
,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x48
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f
,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x18
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x1c
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1d
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x40
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x28
,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2b
,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x1b
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d
,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x57
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4f
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x25
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
const int randomx_run_gfx1010_bin_size=9312;

View File

@@ -316,7 +316,7 @@ __kernel void init_vm(__global const void* entropy_data, __global void* vm_state
uint64_t registerLatencyFP = 0;
uint64_t registerReadCycleFP = 0;
uint32_t ScratchpadHighLatency = 0;
uint32_t ScratchpadLatency = 0;
volatile uint32_t ScratchpadLatency = 0;
int32_t first_available_slot = 0;
int32_t first_allowed_slot_cfround = 0;
@@ -1425,15 +1425,18 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
}
const uint64_t mantissa_size = 52;
const uint64_t mantissa_mask = (1UL << mantissa_size) - 1;
const uint64_t mantissa_high_bit = 1UL << mantissa_size;
const uint64_t mantissa_mask = (1UL << 52) - 1;
const uint64_t exponent_size = 11;
const uint64_t exponent_mask = (1 << exponent_size) - 1;
const uint32_t exponent_a = (as_uint2(a).y >> 20) & exponent_mask;
const uint32_t exponent_b = (as_uint2(b).y >> 20) & exponent_mask;
const uint32_t exponent_c = (as_uint2(c).y >> 20) & exponent_mask;
uint2 a2 = as_uint2(a);
uint2 b2 = as_uint2(b);
uint2 c2 = as_uint2(c);
const uint32_t exponent_a = (a2.y >> 20) & exponent_mask;
const uint32_t exponent_b = (b2.y >> 20) & exponent_mask;
const uint32_t exponent_c = (c2.y >> 20) & exponent_mask;
if ((exponent_a == 2047) || (exponent_b == 2047) || (exponent_c == 2047))
{
@@ -1441,13 +1444,17 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
return as_double(inf);
}
const uint64_t mantissa_a = (as_ulong(a) & mantissa_mask) | mantissa_high_bit;
const uint64_t mantissa_b = (as_ulong(b) & mantissa_mask) | mantissa_high_bit;
const uint64_t mantissa_c = (as_ulong(c) & mantissa_mask) | mantissa_high_bit;
const uint32_t sign_a = a2.y >> 31;
const uint32_t sign_b = b2.y >> 31;
const uint32_t sign_c = c2.y >> 31;
const uint32_t sign_a = as_uint2(a).y >> 31;
const uint32_t sign_b = as_uint2(b).y >> 31;
const uint32_t sign_c = as_uint2(c).y >> 31;
a2.y = (a2.y & ((1U << 20) - 1)) | (1U << 20);
b2.y = (b2.y & ((1U << 20) - 1)) | (1U << 20);
c2.y = (c2.y & ((1U << 20) - 1)) | (1U << 20);
uint64_t mantissa_a = as_ulong(a2);
uint64_t mantissa_b = as_ulong(b2);
uint64_t mantissa_c = as_ulong(c2);
uint64_t mul_result[2];
mul_result[0] = mantissa_a * mantissa_b;
@@ -1585,7 +1592,7 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
if (rounding_mode + sign_fma_result == 2)
{
fma_result[1] += round_up;
if (fma_result[1] == mantissa_high_bit)
if (fma_result[1] == (1UL << mantissa_size))
{
fma_result[1] = 0;
++exponent_fma_result;

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,9 +40,16 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
return false;
}
// Mobile Ryzen APUs
if (device.type() == OclDevice::Raven) {
threads.add(OclThread(device.index(), (device.computeUnits() > 4) ? 256 : 128, 8, 1, true, true, 6));
return true;
}
const size_t mem = device.globalMemSize();
auto config = RxAlgo::base(algorithm);
bool gcnAsm = false;
bool isNavi = false;
switch (device.type()) {
case OclDevice::Baffin:
@@ -53,6 +60,13 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
gcnAsm = true;
break;
case OclDevice::Navi_10:
case OclDevice::Navi_12:
case OclDevice::Navi_14:
gcnAsm = true;
isNavi = true;
break;
default:
break;
}
@@ -69,8 +83,9 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
uint32_t intensity = static_cast<uint32_t>((mem - (datasetHost ? 0 : dataset_mem)) / per_thread_mem / 2);
// Too high intensity makes hashrate worse
if (intensity > device.computeUnits() * 16) {
intensity = device.computeUnits() * 16;
const uint32_t intensityCoeff = isNavi ? 64 : 16;
if (intensity > device.computeUnits() * intensityCoeff) {
intensity = device.computeUnits() * intensityCoeff;
}
intensity -= intensity % 64;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,12 +30,10 @@
#include "crypto/rx/RxAlgo.h"
void xmrig::RxRunKernel::enqueue(cl_command_queue queue, size_t threads)
void xmrig::RxRunKernel::enqueue(cl_command_queue queue, size_t threads, size_t workgroup_size)
{
const size_t gthreads = threads * 64;
static const size_t lthreads = 64;
enqueueNDRange(queue, 1, nullptr, &gthreads, &lthreads);
const size_t gthreads = threads * workgroup_size;
enqueueNDRange(queue, 1, nullptr, &gthreads, &workgroup_size);
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ class RxRunKernel : public OclKernel
public:
inline RxRunKernel(cl_program program) : OclKernel(program, "randomx_run") {}
void enqueue(cl_command_queue queue, size_t threads);
void enqueue(cl_command_queue queue, size_t threads, size_t workgroup_size);
void setArgs(cl_mem dataset, cl_mem scratchpads, cl_mem registers, cl_mem rounding, cl_mem programs, uint32_t batch_size, const Algorithm &algorithm);
};

View File

@@ -31,7 +31,7 @@ if (WITH_OPENCL)
src/backend/opencl/wrappers/OclLib.h
src/backend/opencl/wrappers/OclPlatform.h
src/backend/opencl/wrappers/OclVendor.h
)
)
set(SOURCES_BACKEND_OPENCL
src/backend/opencl/cl/OclSource.cpp
@@ -59,75 +59,93 @@ if (WITH_OPENCL)
src/backend/opencl/wrappers/OclKernel.cpp
src/backend/opencl/wrappers/OclLib.cpp
src/backend/opencl/wrappers/OclPlatform.cpp
)
)
if (WIN32)
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_win.cpp)
else()
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_unix.cpp)
endif()
if (WIN32)
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_win.cpp)
else()
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_unix.cpp)
endif()
if (WITH_RANDOMX)
list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.h
src/backend/opencl/kernels/rx/ExecuteVmKernel.h
src/backend/opencl/kernels/rx/FillAesKernel.h
src/backend/opencl/kernels/rx/FindSharesKernel.h
src/backend/opencl/kernels/rx/HashAesKernel.cpp
src/backend/opencl/kernels/rx/InitVmKernel.h
src/backend/opencl/kernels/rx/RxJitKernel.h
src/backend/opencl/kernels/rx/RxRunKernel.h
src/backend/opencl/runners/OclRxBaseRunner.h
src/backend/opencl/runners/OclRxJitRunner.h
src/backend/opencl/runners/OclRxVmRunner.h
)
if (WITH_RANDOMX)
list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.h
src/backend/opencl/kernels/rx/ExecuteVmKernel.h
src/backend/opencl/kernels/rx/FillAesKernel.h
src/backend/opencl/kernels/rx/FindSharesKernel.h
src/backend/opencl/kernels/rx/HashAesKernel.cpp
src/backend/opencl/kernels/rx/InitVmKernel.h
src/backend/opencl/kernels/rx/RxJitKernel.h
src/backend/opencl/kernels/rx/RxRunKernel.h
src/backend/opencl/runners/OclRxBaseRunner.h
src/backend/opencl/runners/OclRxJitRunner.h
src/backend/opencl/runners/OclRxVmRunner.h
)
list(APPEND SOURCES_BACKEND_OPENCL
src/backend/opencl/generators/ocl_generic_rx_generator.cpp
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.cpp
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.cpp
src/backend/opencl/kernels/rx/ExecuteVmKernel.cpp
src/backend/opencl/kernels/rx/FillAesKernel.cpp
src/backend/opencl/kernels/rx/FindSharesKernel.cpp
src/backend/opencl/kernels/rx/HashAesKernel.cpp
src/backend/opencl/kernels/rx/InitVmKernel.cpp
src/backend/opencl/kernels/rx/RxJitKernel.cpp
src/backend/opencl/kernels/rx/RxRunKernel.cpp
src/backend/opencl/runners/OclRxBaseRunner.cpp
src/backend/opencl/runners/OclRxJitRunner.cpp
src/backend/opencl/runners/OclRxVmRunner.cpp
)
endif()
list(APPEND SOURCES_BACKEND_OPENCL
src/backend/opencl/generators/ocl_generic_rx_generator.cpp
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.cpp
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.cpp
src/backend/opencl/kernels/rx/ExecuteVmKernel.cpp
src/backend/opencl/kernels/rx/FillAesKernel.cpp
src/backend/opencl/kernels/rx/FindSharesKernel.cpp
src/backend/opencl/kernels/rx/HashAesKernel.cpp
src/backend/opencl/kernels/rx/InitVmKernel.cpp
src/backend/opencl/kernels/rx/RxJitKernel.cpp
src/backend/opencl/kernels/rx/RxRunKernel.cpp
src/backend/opencl/runners/OclRxBaseRunner.cpp
src/backend/opencl/runners/OclRxJitRunner.cpp
src/backend/opencl/runners/OclRxVmRunner.cpp
)
endif()
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/kernels/Cn00RyoKernel.h
src/backend/opencl/kernels/Cn1RyoKernel.h
src/backend/opencl/kernels/Cn2RyoKernel.h
src/backend/opencl/runners/OclRyoRunner.h
)
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/kernels/Cn00RyoKernel.h
src/backend/opencl/kernels/Cn1RyoKernel.h
src/backend/opencl/kernels/Cn2RyoKernel.h
src/backend/opencl/runners/OclRyoRunner.h
)
list(APPEND SOURCES_BACKEND_OPENCL
src/backend/opencl/generators/ocl_generic_cn_gpu_generator.cpp
src/backend/opencl/kernels/Cn00RyoKernel.cpp
src/backend/opencl/kernels/Cn1RyoKernel.cpp
src/backend/opencl/kernels/Cn2RyoKernel.cpp
src/backend/opencl/runners/OclRyoRunner.cpp
)
endif()
list(APPEND SOURCES_BACKEND_OPENCL
src/backend/opencl/generators/ocl_generic_cn_gpu_generator.cpp
src/backend/opencl/kernels/Cn00RyoKernel.cpp
src/backend/opencl/kernels/Cn1RyoKernel.cpp
src/backend/opencl/kernels/Cn2RyoKernel.cpp
src/backend/opencl/runners/OclRyoRunner.cpp
)
endif()
if (WITH_STRICT_CACHE)
add_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
else()
remove_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
endif()
if (WITH_STRICT_CACHE)
add_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
else()
remove_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
endif()
if (WITH_INTERLEAVE_DEBUG_LOG)
add_definitions(/DXMRIG_INTERLEAVE_DEBUG)
endif()
if (WITH_INTERLEAVE_DEBUG_LOG)
add_definitions(/DXMRIG_INTERLEAVE_DEBUG)
endif()
if (WITH_ADL AND (XMRIG_OS_WIN OR XMRIG_OS_LINUX))
add_definitions(/DXMRIG_FEATURE_ADL)
list(APPEND HEADERS_BACKEND_OPENCL
src/backend/opencl/wrappers/AdlHealth.h
src/backend/opencl/wrappers/AdlLib.h
)
if (XMRIG_OS_WIN)
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/wrappers/AdlLib.cpp)
else()
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/wrappers/AdlLib_linux.cpp)
endif()
else()
remove_definitions(/DXMRIG_FEATURE_ADL)
endif()
else()
remove_definitions(/DXMRIG_FEATURE_OPENCL)
remove_definitions(/DXMRIG_FEATURE_ADL)
set(HEADERS_BACKEND_OPENCL "")
set(SOURCES_BACKEND_OPENCL "")

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
*/
#include "backend/opencl/runners/OclRxBaseRunner.h"
#include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h"
#include "backend/opencl/kernels/rx/Blake2bInitialHashKernel.h"
#include "backend/opencl/kernels/rx/FillAesKernel.h"
@@ -52,11 +51,15 @@ xmrig::OclRxBaseRunner::OclRxBaseRunner(size_t index, const OclLaunchData &data)
m_worksize = 8;
}
if (data.device.type() == OclDevice::Vega_10 || data.device.type() == OclDevice::Vega_20) {
if (data.device.type() == OclDevice::Vega_10 || data.device.type() == OclDevice::Vega_20 || data.device.type() == OclDevice::Raven) {
m_gcn_version = 14;
}
m_options += " -DALGO=" + std::to_string(m_algorithm.id());
if (data.device.type() == OclDevice::Navi_10 || data.device.type() == OclDevice::Navi_12 || data.device.type() == OclDevice::Navi_14) {
m_gcn_version = 15;
}
m_options += " -DALGO=" + std::to_string(RxAlgo::id(m_algorithm));
m_options += " -DWORKERS_PER_HASH=" + std::to_string(m_worksize);
m_options += " -DGCN_VERSION=" + std::to_string(m_gcn_version);
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,9 +23,9 @@
*/
#include "backend/opencl/runners/OclRxJitRunner.h"
#include "backend/opencl/cl/rx/randomx_run_gfx803.h"
#include "backend/opencl/cl/rx/randomx_run_gfx900.h"
#include "backend/opencl/cl/rx/randomx_run_gfx1010.h"
#include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h"
#include "backend/opencl/kernels/rx/HashAesKernel.h"
#include "backend/opencl/kernels/rx/RxJitKernel.h"
@@ -84,7 +84,7 @@ void xmrig::OclRxJitRunner::execute(uint32_t iteration)
OclLib::finish(m_queue);
m_randomx_run->enqueue(m_queue, m_intensity);
m_randomx_run->enqueue(m_queue, m_intensity, (m_gcn_version == 15) ? 32 : 64);
}
@@ -120,8 +120,23 @@ bool xmrig::OclRxJitRunner::loadAsmProgram()
elf_header_flags = *reinterpret_cast<uint32_t*>((binary_data.data() + elf_header_flags_offset));
}
const size_t len = (m_gcn_version == 14) ? randomx_run_gfx900_bin_size : randomx_run_gfx803_bin_size;
unsigned char *binary = (m_gcn_version == 14) ? randomx_run_gfx900_bin : randomx_run_gfx803_bin;
size_t len;
unsigned char *binary;
switch (m_gcn_version) {
case 14:
len = randomx_run_gfx900_bin_size;
binary = randomx_run_gfx900_bin;
break;
case 15:
len = randomx_run_gfx1010_bin_size;
binary = randomx_run_gfx1010_bin;
break;
default:
len = randomx_run_gfx803_bin_size;
binary = randomx_run_gfx803_bin;
break;
}
// Set correct internal device ID in the pre-compiled binary
if (elf_header_flags) {

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -0,0 +1,38 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_ADLHEALTH_H
#define XMRIG_ADLHEALTH_H
#include <cstdint>
#include <vector>
struct AdlHealth
{
uint32_t clock = 0;
uint32_t memClock = 0;
uint32_t power = 0;
uint32_t rpm = 0;
uint32_t temperature = 0;
};
#endif /* XMRIG_ADLHEALTH_H */

View File

@@ -0,0 +1,265 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdexcept>
#include <uv.h>
#include "backend/opencl/wrappers/AdlLib.h"
#include "3rdparty/adl/adl_sdk.h"
#include "3rdparty/adl/adl_structures.h"
#include "backend/opencl/wrappers/OclDevice.h"
namespace xmrig {
static std::vector<AdapterInfo> adapters;
static uv_lib_t adlLib;
static const char *kSymbolNotFound = "symbol not found";
static const char *kADL_Main_Control_Create = "ADL_Main_Control_Create";
static const char *kADL_Main_Control_Destroy = "ADL_Main_Control_Destroy";
static const char *kADL_Adapter_NumberOfAdapters_Get = "ADL_Adapter_NumberOfAdapters_Get";
static const char *kADL_Adapter_AdapterInfo_Get = "ADL_Adapter_AdapterInfo_Get";
static const char *kADL2_Overdrive_Caps = "ADL2_Overdrive_Caps";
static const char *kADL2_OverdriveN_FanControl_Get = "ADL2_OverdriveN_FanControl_Get";
static const char *kADL2_New_QueryPMLogData_Get = "ADL2_New_QueryPMLogData_Get";
static const char *kADL2_OverdriveN_Temperature_Get = "ADL2_OverdriveN_Temperature_Get";
static const char *kADL2_OverdriveN_PerformanceStatus_Get = "ADL2_OverdriveN_PerformanceStatus_Get";
static const char *kADL2_Overdrive6_CurrentPower_Get = "ADL2_Overdrive6_CurrentPower_Get";
using ADL_MAIN_CONTROL_CREATE = int (*)(ADL_MAIN_MALLOC_CALLBACK, int);
using ADL_MAIN_CONTROL_DESTROY = int (*)();
using ADL_ADAPTER_NUMBEROFADAPTERS_GET = int (*)(int *);
using ADL_ADAPTER_ADAPTERINFO_GET = int (*)(LPAdapterInfo, int);
using ADL2_OVERDRIVE_CAPS = int (*)(ADL_CONTEXT_HANDLE, int, int *, int *, int *);
using ADL2_OVERDRIVEN_FANCONTROL_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLODNFanControl *);
using ADL2_NEW_QUERYPMLOGDATA_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLPMLogDataOutput *);
using ADL2_OVERDRIVEN_TEMPERATURE_GET = int (*)(ADL_CONTEXT_HANDLE, int, int, int *);
using ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLODNPerformanceStatus *);
using ADL2_OVERDRIVE6_CURRENTPOWER_GET = int (*)(ADL_CONTEXT_HANDLE, int, int, int *);
ADL_MAIN_CONTROL_CREATE ADL_Main_Control_Create = nullptr;
ADL_MAIN_CONTROL_DESTROY ADL_Main_Control_Destroy = nullptr;
ADL_ADAPTER_NUMBEROFADAPTERS_GET ADL_Adapter_NumberOfAdapters_Get = nullptr;
ADL_ADAPTER_ADAPTERINFO_GET ADL_Adapter_AdapterInfo_Get = nullptr;
ADL2_OVERDRIVE_CAPS ADL2_Overdrive_Caps = nullptr;
ADL2_OVERDRIVEN_FANCONTROL_GET ADL2_OverdriveN_FanControl_Get = nullptr;
ADL2_NEW_QUERYPMLOGDATA_GET ADL2_New_QueryPMLogData_Get = nullptr;
ADL2_OVERDRIVEN_TEMPERATURE_GET ADL2_OverdriveN_Temperature_Get = nullptr;
ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET ADL2_OverdriveN_PerformanceStatus_Get = nullptr;
ADL2_OVERDRIVE6_CURRENTPOWER_GET ADL2_Overdrive6_CurrentPower_Get = nullptr;
#define DLSYM(x) if (uv_dlsym(&adlLib, k##x, reinterpret_cast<void**>(&(x))) == -1) { throw std::runtime_error(kSymbolNotFound); }
bool AdlLib::m_initialized = false;
bool AdlLib::m_ready = false;
static void * __stdcall ADL_Main_Memory_Alloc(int iSize)
{
return malloc(iSize);
}
static inline bool matchTopology(const PciTopology &topology, const AdapterInfo &adapter)
{
return adapter.iBusNumber > -1 && topology.bus() == adapter.iBusNumber && topology.device() == adapter.iDeviceNumber && topology.function() == adapter.iFunctionNumber;
}
static void getFan_v7(const AdapterInfo &adapter, AdlHealth &health)
{
ADLODNFanControl data;
memset(&data, 0, sizeof(ADLODNFanControl));
if (ADL2_OverdriveN_FanControl_Get(nullptr, adapter.iAdapterIndex, &data) == ADL_OK) {
health.rpm = data.iCurrentFanSpeed;
}
}
static void getTemp_v7(const AdapterInfo &adapter, AdlHealth &health)
{
int temp = 0;
if (ADL2_OverdriveN_Temperature_Get(nullptr, adapter.iAdapterIndex, 1, &temp) == ADL_OK) {
health.temperature = temp / 1000;
}
}
static void getClocks_v7(const AdapterInfo &adapter, AdlHealth &health)
{
ADLODNPerformanceStatus data;
memset(&data, 0, sizeof(ADLODNPerformanceStatus));
if (ADL2_OverdriveN_PerformanceStatus_Get(nullptr, adapter.iAdapterIndex, &data) == ADL_OK) {
health.clock = data.iCoreClock / 100;
health.memClock = data.iMemoryClock / 100;
}
}
static void getPower_v7(const AdapterInfo &adapter, AdlHealth &health)
{
int power = 0;
if (ADL2_Overdrive6_CurrentPower_Get && ADL2_Overdrive6_CurrentPower_Get(nullptr, adapter.iAdapterIndex, 0, &power) == ADL_OK) {
health.power = static_cast<uint32_t>(power / 256.0);
}
}
static void getSensorsData_v8(const AdapterInfo &adapter, AdlHealth &health)
{
if (!ADL2_New_QueryPMLogData_Get) {
return;
}
ADLPMLogDataOutput data;
memset(&data, 0, sizeof(ADLPMLogDataOutput));
if (ADL2_New_QueryPMLogData_Get(nullptr, adapter.iAdapterIndex, &data) != ADL_OK) {
return;
}
auto sensorValue = [&data](ADLSensorType type) { return data.sensors[type].supported ? data.sensors[type].value : 0; };
health.clock = sensorValue(PMLOG_CLK_GFXCLK);
health.memClock = sensorValue(PMLOG_CLK_MEMCLK);
health.power = sensorValue(PMLOG_ASIC_POWER);
health.rpm = sensorValue(PMLOG_FAN_RPM);
health.temperature = sensorValue(PMLOG_TEMPERATURE_HOTSPOT);
}
} // namespace xmrig
bool xmrig::AdlLib::init()
{
if (!m_initialized) {
m_ready = dlopen() && load();
m_initialized = true;
}
return m_ready;
}
const char *xmrig::AdlLib::lastError() noexcept
{
return uv_dlerror(&adlLib);
}
void xmrig::AdlLib::close()
{
if (m_ready) {
ADL_Main_Control_Destroy();
}
uv_dlclose(&adlLib);
}
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
{
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
return {};
}
int supported, enabled, version;
AdlHealth health;
for (const auto &adapter : adapters) {
if (matchTopology(device.topology(), adapter)) {
if (ADL2_Overdrive_Caps(nullptr, adapter.iAdapterIndex, &supported, &enabled, &version) != ADL_OK) {
continue;
}
if (version == 7) {
getFan_v7(adapter, health);
getTemp_v7(adapter, health);
getClocks_v7(adapter, health);
getPower_v7(adapter, health);
}
else if (version == 8) {
getSensorsData_v8(adapter, health);
}
break;
}
}
return health;
}
bool xmrig::AdlLib::dlopen()
{
return uv_dlopen("atiadlxx.dll", &adlLib) == 0;
}
bool xmrig::AdlLib::load()
{
try {
DLSYM(ADL_Main_Control_Create);
DLSYM(ADL_Main_Control_Destroy);
DLSYM(ADL_Adapter_NumberOfAdapters_Get);
DLSYM(ADL_Adapter_AdapterInfo_Get);
DLSYM(ADL2_Overdrive_Caps);
DLSYM(ADL2_OverdriveN_FanControl_Get);
DLSYM(ADL2_OverdriveN_Temperature_Get);
DLSYM(ADL2_OverdriveN_PerformanceStatus_Get);
} catch (std::exception &ex) {
return false;
}
try {
DLSYM(ADL2_Overdrive6_CurrentPower_Get);
DLSYM(ADL2_New_QueryPMLogData_Get);
} catch (std::exception &ex) {}
if (ADL_Main_Control_Create(ADL_Main_Memory_Alloc, 1) != ADL_OK) {
return false;
}
int count = 0;
if (ADL_Adapter_NumberOfAdapters_Get(&count) != ADL_OK) {
return false;
}
if (count == 0) {
return false;
}
adapters.resize(count);
const size_t size = sizeof(adapters[0]) * adapters.size();
memset(adapters.data(), 0, size);
return ADL_Adapter_AdapterInfo_Get(adapters.data(), size) == ADL_OK;
}

View File

@@ -0,0 +1,57 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_ADLLIB_H
#define XMRIG_ADLLIB_H
#include "backend/opencl/wrappers/AdlHealth.h"
namespace xmrig {
class OclDevice;
class AdlLib
{
public:
static bool init();
static const char *lastError() noexcept;
static void close();
static AdlHealth health(const OclDevice &device);
static inline bool isInitialized() noexcept { return m_initialized; }
static inline bool isReady() noexcept { return m_ready; }
private:
static bool dlopen();
static bool load();
static bool m_initialized;
static bool m_ready;
};
} // namespace xmrig
#endif /* XMRIG_ADLLIB_H */

View File

@@ -0,0 +1,138 @@
/* XMRig
* Copyright 2008-2018 Advanced Micro Devices, Inc.
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "backend/opencl/wrappers/AdlLib.h"
#include "backend/opencl/wrappers/OclDevice.h"
#include <fstream>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
namespace xmrig {
bool AdlLib::m_initialized = false;
bool AdlLib::m_ready = false;
static const std::string kPrefix = "/sys/bus/pci/drivers/amdgpu/";
static inline bool sysfs_is_file(const char *path)
{
struct stat sb;
return stat(path, &sb) == 0 && ((sb.st_mode & S_IFMT) == S_IFREG);
}
static inline std::string sysfs_prefix(const PciTopology &topology)
{
std::string path = kPrefix + "0000:" + topology.toString().data() + "/hwmon/hwmon";
if (sysfs_is_file((path + "2/name").c_str())) {
return path + "2/";
}
if (sysfs_is_file((path + "3/name").c_str())) {
return path + "3/";
}
return {};
}
uint32_t sysfs_read(const std::string &path)
{
std::ifstream file(path);
if (!file.is_open()) {
return 0;
}
uint32_t value = 0;
file >> value;
return value;
}
} // namespace xmrig
bool xmrig::AdlLib::init()
{
if (!m_initialized) {
m_ready = dlopen() && load();
m_initialized = true;
}
return m_ready;
}
const char *xmrig::AdlLib::lastError() noexcept
{
return nullptr;
}
void xmrig::AdlLib::close()
{
}
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
{
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
return {};
}
const auto prefix = sysfs_prefix(device.topology());
if (prefix.empty()) {
return {};
}
AdlHealth health;
health.clock = sysfs_read(prefix + "freq1_input") / 1000000;
health.memClock = sysfs_read(prefix + "freq2_input") / 1000000;
health.power = sysfs_read(prefix + "power1_average") / 1000000;
health.rpm = sysfs_read(prefix + "fan1_input");
health.temperature = sysfs_read(prefix + "temp2_input") / 1000;
return health;
}
bool xmrig::AdlLib::dlopen()
{
struct stat sb;
if (stat(kPrefix.c_str(), &sb) == -1) {
return false;
}
return (sb.st_mode & S_IFMT) == S_IFDIR;
}
bool xmrig::AdlLib::load()
{
return true;
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
#include "backend/opencl/wrappers/OclDevice.h"
#include "backend/opencl/OclGenerator.h"
#include "backend/opencl/OclThreads.h"
#include "backend/opencl/wrappers/OclLib.h"
@@ -33,6 +32,10 @@
#include "crypto/common/Algorithm.h"
#include "rapidjson/document.h"
#ifdef XMRIG_FEATURE_ADL
# include "backend/opencl/wrappers/AdlLib.h"
#endif
#include <algorithm>
@@ -107,6 +110,14 @@ static OclDevice::Type getType(const String &name)
return OclDevice::Navi_10;
}
if (name == "gfx1011") {
return OclDevice::Navi_12;
}
if (name == "gfx1012") {
return OclDevice::Navi_14;
}
if (name == "gfx804") {
return OclDevice::Lexa;
}
@@ -200,5 +211,20 @@ void xmrig::OclDevice::toJSON(rapidjson::Value &out, rapidjson::Document &doc) c
out.AddMember("bus_id", topology().toString().toJSON(doc), allocator);
out.AddMember("cu", computeUnits(), allocator);
out.AddMember("global_mem", static_cast<uint64_t>(globalMemSize()), allocator);
# ifdef XMRIG_FEATURE_ADL
if (AdlLib::isReady()) {
auto data = AdlLib::health(*this);
Value health(kObjectType);
health.AddMember("temperature", data.temperature, allocator);
health.AddMember("power", data.power, allocator);
health.AddMember("clock", data.clock, allocator);
health.AddMember("mem_clock", data.memClock, allocator);
health.AddMember("rpm", data.rpm, allocator);
out.AddMember("health", health, allocator);
}
# endif
}
#endif

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -56,7 +56,9 @@ public:
Vega_10,
Vega_20,
Raven,
Navi_10
Navi_10,
Navi_12,
Navi_14
};
OclDevice() = delete;

View File

@@ -28,10 +28,12 @@
#include <uv.h>
#include "backend/opencl/wrappers/OclLib.h"
#include "backend/common/Tags.h"
#include "backend/opencl/wrappers/OclError.h"
#include "backend/opencl/wrappers/OclLib.h"
#include "base/io/log/Log.h"
#include "base/kernel/Env.h"
#if defined(OCL_DEBUG_REFERENCE_COUNT)
# define LOG_REFS(x, ...) xmrig::Log::print(xmrig::Log::WARNING, x, ##__VA_ARGS__)
@@ -188,7 +190,7 @@ static String getOclString(FUNC fn, OBJ obj, PARAM param)
bool xmrig::OclLib::init(const char *fileName)
{
if (!m_initialized) {
m_loader = fileName == nullptr ? defaultLoader() : fileName;
m_loader = fileName == nullptr ? defaultLoader() : Env::expand(fileName);
m_ready = uv_dlopen(m_loader, &oclLib) == 0 && load();
m_initialized = true;
}
@@ -257,7 +259,7 @@ bool xmrig::OclLib::load()
}
const char *xmrig::OclLib::defaultLoader()
xmrig::String xmrig::OclLib::defaultLoader()
{
# if defined(__APPLE__)
return "/System/Library/Frameworks/OpenCL.framework/OpenCL";

View File

@@ -102,7 +102,7 @@ public:
private:
static bool load();
static const char *defaultLoader();
static String defaultLoader();
static bool m_initialized;
static bool m_ready;

View File

@@ -26,17 +26,13 @@
#include <uv.h>
#ifndef _WIN32
# include <unistd.h>
#endif
#include "base/api/Api.h"
#include "3rdparty/http-parser/http_parser.h"
#include "base/api/interfaces/IApiListener.h"
#include "base/api/requests/HttpApiRequest.h"
#include "base/io/json/Json.h"
#include "base/kernel/Base.h"
#include "base/kernel/Env.h"
#include "base/tools/Buffer.h"
#include "base/tools/Chrono.h"
#include "core/config/Config.h"
@@ -158,7 +154,7 @@ void xmrig::Api::exec(IApiRequest &request)
auto &reply = request.reply();
reply.AddMember("id", StringRef(m_id), allocator);
reply.AddMember("worker_id", StringRef(m_workerId), allocator);
reply.AddMember("worker_id", m_workerId.toJSON(), allocator);
reply.AddMember("uptime", (Chrono::currentMSecsSinceEpoch() - m_timestamp) / 1000, allocator);
reply.AddMember("restricted", request.isRestricted(), allocator);
reply.AddMember("resources", getResources(request.doc()), allocator);
@@ -245,12 +241,8 @@ void xmrig::Api::genId(const String &id)
void xmrig::Api::genWorkerId(const String &id)
{
memset(m_workerId, 0, sizeof(m_workerId));
if (id.size() > 0) {
strncpy(m_workerId, id.data(), sizeof(m_workerId) - 1);
}
else {
gethostname(m_workerId, sizeof(m_workerId) - 1);
m_workerId = Env::expand(id);
if (m_workerId.isEmpty()) {
m_workerId = Env::hostname();
}
}

View File

@@ -32,6 +32,7 @@
#include "base/kernel/interfaces/IBaseListener.h"
#include "base/tools/Object.h"
#include "base/tools/String.h"
namespace xmrig {
@@ -71,7 +72,7 @@ private:
Base *m_base;
char m_id[32]{};
char m_workerId[128]{};
String m_workerId;
const uint64_t m_timestamp;
Httpd *m_httpd = nullptr;
std::vector<IApiListener *> m_listeners;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,7 +38,6 @@
namespace xmrig {
static const char *kAuthorization = "authorization";
static const char *kContentType = "content-type";
#ifdef _WIN32
static const char *favicon = nullptr;
@@ -54,6 +53,8 @@ xmrig::Httpd::Httpd(Base *base) :
m_server(nullptr),
m_port(0)
{
m_httpListener = std::make_shared<HttpListener>(this);
base->addListener(this);
}
@@ -69,7 +70,7 @@ bool xmrig::Httpd::start()
return true;
}
m_http = new HttpServer(this);
m_http = new HttpServer(m_httpListener);
m_server = new TcpServer(config.host(), config.port(), m_http);
const int rc = m_server->bind();
@@ -136,7 +137,7 @@ void xmrig::Httpd::onHttpData(const HttpData &data)
# ifdef _WIN32
if (favicon != nullptr) {
HttpResponse response(data.id());
response.setHeader("Content-Type", "image/x-icon");
response.setHeader(HttpData::kContentType, "image/x-icon");
return response.end(favicon, faviconSize);
}
@@ -159,7 +160,7 @@ void xmrig::Httpd::onHttpData(const HttpData &data)
return HttpApiResponse(data.id(), HTTP_STATUS_FORBIDDEN).end();
}
if (!data.headers.count(kContentType) || data.headers.at(kContentType) != "application/json") {
if (!data.headers.count(HttpData::kContentTypeL) || data.headers.at(HttpData::kContentTypeL) != HttpData::kApplicationJson) {
return HttpApiResponse(data.id(), HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE).end();
}
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,14 +26,15 @@
#define XMRIG_HTTPD_H
#include <cstdint>
#include "base/kernel/interfaces/IBaseListener.h"
#include "base/kernel/interfaces/IHttpListener.h"
#include "base/net/http/HttpListener.h"
#include "base/tools/Object.h"
#include <cstdint>
#include <memory>
namespace xmrig {
@@ -62,6 +63,7 @@ private:
Base *m_base;
HttpServer *m_http;
std::shared_ptr<IHttpListener> m_httpListener;
TcpServer *m_server;
uint16_t m_port;
};

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,21 +69,23 @@ public:
virtual ~IApiRequest() = default;
virtual bool accept() = 0;
virtual bool hasParseError() const = 0;
virtual bool isDone() const = 0;
virtual bool isNew() const = 0;
virtual bool isRestricted() const = 0;
virtual const rapidjson::Value &json() const = 0;
virtual const String &rpcMethod() const = 0;
virtual const String &url() const = 0;
virtual int version() const = 0;
virtual Method method() const = 0;
virtual rapidjson::Document &doc() = 0;
virtual rapidjson::Value &reply() = 0;
virtual RequestType type() const = 0;
virtual Source source() const = 0;
virtual void done(int status) = 0;
virtual bool accept() = 0;
virtual bool hasParseError() const = 0;
virtual bool isDone() const = 0;
virtual bool isNew() const = 0;
virtual bool isRestricted() const = 0;
virtual const rapidjson::Value &json() const = 0;
virtual const String &rpcMethod() const = 0;
virtual const String &url() const = 0;
virtual int version() const = 0;
virtual Method method() const = 0;
virtual rapidjson::Document &doc() = 0;
virtual rapidjson::Value &reply() = 0;
virtual RequestType type() const = 0;
virtual Source source() const = 0;
virtual void done(int status) = 0;
virtual void setRpcError(int code, const char *message = nullptr) = 0;
virtual void setRpcResult(rapidjson::Value &result) = 0;
};

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,6 +53,10 @@ static inline const char *rpcError(int code) {
return "Invalid params";
}
if (code >= HTTP_STATUS_BAD_REQUEST && code <= HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED) {
return http_status_str(static_cast<http_status>(code));
}
return "Internal error";
}
@@ -82,7 +86,7 @@ xmrig::HttpApiRequest::HttpApiRequest(const HttpData &req, bool restricted) :
return;
}
m_rpcMethod = Json::getString(json(), "method");
m_rpcMethod = Json::getString(m_body, "method");
if (m_rpcMethod.isEmpty()) {
done(RPC_INVALID_REQUEST);
@@ -129,6 +133,10 @@ bool xmrig::HttpApiRequest::accept()
const rapidjson::Value &xmrig::HttpApiRequest::json() const
{
if (type() == REQ_JSON_RPC) {
return Json::getValue(m_body, "params");
}
return m_body;
}
@@ -150,25 +158,14 @@ void xmrig::HttpApiRequest::done(int status)
m_res.setStatus(HTTP_STATUS_OK);
if (status != HTTP_STATUS_OK) {
if (status == HTTP_STATUS_NOT_FOUND) {
status = RPC_METHOD_NOT_FOUND;
}
Value error(kObjectType);
error.AddMember("code", status, allocator);
error.AddMember("message", StringRef(rpcError(status)), allocator);
reply().AddMember(StringRef(kError), error, allocator);
setRpcError(status == HTTP_STATUS_NOT_FOUND ? RPC_METHOD_NOT_FOUND : status);
}
else if (!reply().HasMember(kResult)) {
Value result(kObjectType);
result.AddMember("status", "OK", allocator);
reply().AddMember(StringRef(kResult), result, allocator);
setRpcResult(result);
}
reply().AddMember("jsonrpc", "2.0", allocator);
reply().AddMember(StringRef(kId), Value().CopyFrom(Json::getValue(json(), kId), allocator), allocator);
}
else {
m_res.setStatus(status);
@@ -176,3 +173,38 @@ void xmrig::HttpApiRequest::done(int status)
m_res.end();
}
void xmrig::HttpApiRequest::setRpcError(int code, const char *message)
{
using namespace rapidjson;
auto &allocator = doc().GetAllocator();
Value error(kObjectType);
error.AddMember("code", code, allocator);
error.AddMember("message", message ? StringRef(message) : StringRef(rpcError(code)), allocator);
rpcDone(kError, error);
}
void xmrig::HttpApiRequest::setRpcResult(rapidjson::Value &result)
{
rpcDone(kResult, result);
}
void xmrig::HttpApiRequest::rpcDone(const char *key, rapidjson::Value &value)
{
ApiRequest::done(0);
using namespace rapidjson;
auto &allocator = doc().GetAllocator();
reply().AddMember(StringRef(key), value, allocator);
reply().AddMember("jsonrpc", "2.0", allocator);
reply().AddMember(StringRef(kId), Value().CopyFrom(Json::getValue(m_body, kId), allocator), allocator);
m_res.setStatus(HTTP_STATUS_OK);
m_res.end();
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,8 +53,12 @@ protected:
const rapidjson::Value &json() const override;
Method method() const override;
void done(int status) override;
void setRpcError(int code, const char *message = nullptr) override;
void setRpcResult(rapidjson::Value &result) override;
private:
void rpcDone(const char *key, rapidjson::Value &value);
const HttpData &m_req;
HttpApiResponse m_res;
int m_parsed = 0;

View File

@@ -6,12 +6,14 @@ set(HEADERS_BASE
src/base/io/json/JsonRequest.h
src/base/io/log/backends/ConsoleLog.h
src/base/io/log/backends/FileLog.h
src/base/io/log/FileLogWriter.h
src/base/io/log/Log.h
src/base/io/Watcher.h
src/base/kernel/Base.h
src/base/kernel/config/BaseConfig.h
src/base/kernel/config/BaseTransform.h
src/base/kernel/Entry.h
src/base/kernel/Env.h
src/base/kernel/interfaces/IBaseListener.h
src/base/kernel/interfaces/IClient.h
src/base/kernel/interfaces/IClientListener.h
@@ -33,13 +35,18 @@ set(HEADERS_BASE
src/base/net/dns/Dns.h
src/base/net/dns/DnsRecord.h
src/base/net/http/Http.h
src/base/net/http/HttpListener.h
src/base/net/stratum/BaseClient.h
src/base/net/stratum/Client.h
src/base/net/stratum/Job.h
src/base/net/stratum/NetworkState.h
src/base/net/stratum/Pool.h
src/base/net/stratum/Pools.h
src/base/net/stratum/ProxyUrl.h
src/base/net/stratum/Socks5.h
src/base/net/stratum/strategies/FailoverStrategy.h
src/base/net/stratum/strategies/SinglePoolStrategy.h
src/base/net/stratum/strategies/StrategyProxy.h
src/base/net/stratum/SubmitResult.h
src/base/net/stratum/Url.h
src/base/net/tools/RecvBuf.h
@@ -60,12 +67,14 @@ set(SOURCES_BASE
src/base/io/json/JsonRequest.cpp
src/base/io/log/backends/ConsoleLog.cpp
src/base/io/log/backends/FileLog.cpp
src/base/io/log/FileLogWriter.cpp
src/base/io/log/Log.cpp
src/base/io/Watcher.cpp
src/base/kernel/Base.cpp
src/base/kernel/config/BaseConfig.cpp
src/base/kernel/config/BaseTransform.cpp
src/base/kernel/Entry.cpp
src/base/kernel/Env.cpp
src/base/kernel/Platform.cpp
src/base/kernel/Process.cpp
src/base/kernel/Signals.cpp
@@ -75,8 +84,11 @@ set(SOURCES_BASE
src/base/net/stratum/BaseClient.cpp
src/base/net/stratum/Client.cpp
src/base/net/stratum/Job.cpp
src/base/net/stratum/NetworkState.cpp
src/base/net/stratum/Pool.cpp
src/base/net/stratum/Pools.cpp
src/base/net/stratum/ProxyUrl.cpp
src/base/net/stratum/Socks5.cpp
src/base/net/stratum/strategies/FailoverStrategy.cpp
src/base/net/stratum/strategies/SinglePoolStrategy.cpp
src/base/net/stratum/Url.cpp
@@ -132,6 +144,7 @@ if (WITH_HTTP)
src/base/kernel/interfaces/IHttpListener.h
src/base/kernel/interfaces/IJsonReader.h
src/base/kernel/interfaces/ITcpServerListener.h
src/base/net/http/Fetch.h
src/base/net/http/HttpApiResponse.h
src/base/net/http/HttpClient.h
src/base/net/http/HttpContext.h
@@ -149,9 +162,12 @@ if (WITH_HTTP)
src/base/api/Httpd.cpp
src/base/api/requests/ApiRequest.cpp
src/base/api/requests/HttpApiRequest.cpp
src/base/net/http/Fetch.cpp
src/base/net/http/HttpApiResponse.cpp
src/base/net/http/HttpClient.cpp
src/base/net/http/HttpContext.cpp
src/base/net/http/HttpData.cpp
src/base/net/http/HttpListener.cpp
src/base/net/http/HttpResponse.cpp
src/base/net/http/HttpServer.cpp
src/base/net/stratum/DaemonClient.cpp
@@ -167,3 +183,15 @@ else()
remove_definitions(/DXMRIG_FEATURE_HTTP)
remove_definitions(/DXMRIG_FEATURE_API)
endif()
if (WITH_ENV_VARS AND CMAKE_CXX_COMPILER_ID MATCHES GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
set(WITH_ENV_VARS OFF)
endif()
if (WITH_ENV_VARS)
add_definitions(/DXMRIG_FEATURE_ENV)
else()
remove_definitions(/DXMRIG_FEATURE_ENV)
endif()

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,7 +40,9 @@ static const rapidjson::Value kNullValue;
bool xmrig::Json::getBool(const rapidjson::Value &obj, const char *key, bool defaultValue)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return defaultValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsBool()) {
@@ -51,9 +53,17 @@ bool xmrig::Json::getBool(const rapidjson::Value &obj, const char *key, bool def
}
bool xmrig::Json::isEmpty(const rapidjson::Value &obj)
{
return !obj.IsObject() || obj.ObjectEmpty();
}
const char *xmrig::Json::getString(const rapidjson::Value &obj, const char *key, const char *defaultValue)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return defaultValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsString()) {
@@ -66,7 +76,9 @@ const char *xmrig::Json::getString(const rapidjson::Value &obj, const char *key,
const rapidjson::Value &xmrig::Json::getArray(const rapidjson::Value &obj, const char *key)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return kNullValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsArray()) {
@@ -79,7 +91,9 @@ const rapidjson::Value &xmrig::Json::getArray(const rapidjson::Value &obj, const
const rapidjson::Value &xmrig::Json::getObject(const rapidjson::Value &obj, const char *key)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return kNullValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsObject()) {
@@ -92,7 +106,9 @@ const rapidjson::Value &xmrig::Json::getObject(const rapidjson::Value &obj, cons
const rapidjson::Value &xmrig::Json::getValue(const rapidjson::Value &obj, const char *key)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return kNullValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd()) {
@@ -105,7 +121,9 @@ const rapidjson::Value &xmrig::Json::getValue(const rapidjson::Value &obj, const
int xmrig::Json::getInt(const rapidjson::Value &obj, const char *key, int defaultValue)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return defaultValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsInt()) {
@@ -118,7 +136,9 @@ int xmrig::Json::getInt(const rapidjson::Value &obj, const char *key, int defaul
int64_t xmrig::Json::getInt64(const rapidjson::Value &obj, const char *key, int64_t defaultValue)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return defaultValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsInt64()) {
@@ -131,7 +151,9 @@ int64_t xmrig::Json::getInt64(const rapidjson::Value &obj, const char *key, int6
uint64_t xmrig::Json::getUint64(const rapidjson::Value &obj, const char *key, uint64_t defaultValue)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return defaultValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsUint64()) {
@@ -144,7 +166,9 @@ uint64_t xmrig::Json::getUint64(const rapidjson::Value &obj, const char *key, ui
unsigned xmrig::Json::getUint(const rapidjson::Value &obj, const char *key, unsigned defaultValue)
{
assert(obj.IsObject());
if (isEmpty(obj)) {
return defaultValue;
}
auto i = obj.FindMember(key);
if (i != obj.MemberEnd() && i->value.IsUint()) {
@@ -169,5 +193,5 @@ rapidjson::Value xmrig::Json::normalize(double value, bool zero)
bool xmrig::JsonReader::isEmpty() const
{
return !m_obj.IsObject() || m_obj.ObjectEmpty();
return Json::isEmpty(m_obj);
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ class Json
{
public:
static bool getBool(const rapidjson::Value &obj, const char *key, bool defaultValue = false);
static bool isEmpty(const rapidjson::Value &obj);
static const char *getString(const rapidjson::Value &obj, const char *key, const char *defaultValue = nullptr);
static const rapidjson::Value &getArray(const rapidjson::Value &obj, const char *key);
static const rapidjson::Value &getObject(const rapidjson::Value &obj, const char *key);

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,12 +27,40 @@
#include "rapidjson/document.h"
void xmrig::JsonRequest::create(rapidjson::Document &doc, int64_t id, const char *method, rapidjson::Value &params)
namespace xmrig {
static const char *k2_0 = "2.0";
static const char *kId = "id";
static const char *kJsonRPC = "jsonrpc";
static const char *kMethod = "method";
const char *JsonRequest::kParams = "params";
} // namespace xmrig
rapidjson::Document xmrig::JsonRequest::create(int64_t id, const char *method)
{
using namespace rapidjson;
Document doc(kObjectType);
auto &allocator = doc.GetAllocator();
doc.AddMember("id", id, allocator);
doc.AddMember("jsonrpc", "2.0", allocator);
doc.AddMember("method", rapidjson::StringRef(method), allocator);
doc.AddMember("params", params, allocator);
doc.AddMember(StringRef(kId), id, allocator);
doc.AddMember(StringRef(kJsonRPC), StringRef(k2_0), allocator);
doc.AddMember(StringRef(kMethod), StringRef(method), allocator);
return doc;
}
void xmrig::JsonRequest::create(rapidjson::Document &doc, int64_t id, const char *method, rapidjson::Value &params)
{
using namespace rapidjson;
auto &allocator = doc.GetAllocator();
doc.AddMember(StringRef(kId), id, allocator);
doc.AddMember(StringRef(kJsonRPC), StringRef(k2_0), allocator);
doc.AddMember(StringRef(kMethod), StringRef(method), allocator);
doc.AddMember(StringRef(kParams), params, allocator);
}

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,6 +35,9 @@ namespace xmrig {
class JsonRequest
{
public:
static const char *kParams;
static rapidjson::Document create(int64_t id, const char *method);
static void create(rapidjson::Document &doc, int64_t id, const char *method, rapidjson::Value &params);
};

View File

@@ -0,0 +1,94 @@
/* XMRig
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "base/io/log/FileLogWriter.h"
#include "base/kernel/Env.h"
#include <cassert>
#include <uv.h>
namespace xmrig {
static void fsWriteCallback(uv_fs_t *req)
{
delete [] static_cast<char *>(req->data);
uv_fs_req_cleanup(req);
delete req;
}
static const char *kNewLine = "\n";
} // namespace xmrig
bool xmrig::FileLogWriter::open(const char *fileName)
{
assert(fileName != nullptr);
if (!fileName) {
return false;
}
uv_fs_t req;
m_file = uv_fs_open(uv_default_loop(), &req, Env::expand(fileName), O_CREAT | O_APPEND | O_WRONLY, 0644, nullptr);
uv_fs_req_cleanup(&req);
return isOpen();
}
bool xmrig::FileLogWriter::write(const char *data, size_t size)
{
if (!isOpen()) {
return false;
}
uv_buf_t buf = uv_buf_init(new char[size], size);
memcpy(buf.base, data, size);
auto req = new uv_fs_t;
req->data = buf.base;
uv_fs_write(uv_default_loop(), req, m_file, &buf, 1, -1, fsWriteCallback);
return true;
}
bool xmrig::FileLogWriter::writeLine(const char *data, size_t size)
{
uv_buf_t buf[2] = {
uv_buf_init(new char[size], size),
uv_buf_init(const_cast<char *>(kNewLine), 1)
};
memcpy(buf[0].base, data, size);
auto req = new uv_fs_t;
req->data = buf[0].base;
uv_fs_write(uv_default_loop(), req, m_file, buf, 2, -1, fsWriteCallback);
return true;
}

View File

@@ -0,0 +1,49 @@
/* XMRig
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_FILELOGWRITER_H
#define XMRIG_FILELOGWRITER_H
#include <cstddef>
namespace xmrig {
class FileLogWriter
{
public:
FileLogWriter() = default;
FileLogWriter(const char *fileName) { open(fileName); }
inline bool isOpen() const { return m_file >= 0; }
bool open(const char *fileName);
bool write(const char *data, size_t size);
bool writeLine(const char *data, size_t size);
private:
int m_file = -1;
};
} /* namespace xmrig */
#endif /* XMRIG_FILELOGWRITER_H */

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -92,7 +92,7 @@ public:
std::lock_guard<std::mutex> lock(m_mutex);
if (Log::background && m_backends.empty()) {
if (Log::isBackground() && m_backends.empty()) {
return;
}
@@ -189,15 +189,16 @@ private:
}
char m_buf[4096]{};
char m_buf[Log::kMaxBufferSize]{};
std::mutex m_mutex;
std::vector<ILogBackend*> m_backends;
};
bool Log::background = false;
bool Log::colors = true;
LogPrivate *Log::d = new LogPrivate();
bool Log::m_background = false;
bool Log::m_colors = true;
LogPrivate *Log::d = new LogPrivate();
uint32_t Log::m_verbose = 0;
} /* namespace xmrig */

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +27,10 @@
#define XMRIG_LOG_H
#include <cstddef>
#include <cstdint>
namespace xmrig {
@@ -49,15 +53,26 @@ public:
DEBUG, // debug-level messages
};
constexpr static size_t kMaxBufferSize = 16384;
static void add(ILogBackend *backend);
static void destroy();
static void print(const char *fmt, ...);
static void print(Level level, const char *fmt, ...);
static bool background;
static bool colors;
static inline bool isBackground() { return m_background; }
static inline bool isColors() { return m_colors; }
static inline bool isVerbose() { return m_verbose > 0; }
static inline uint32_t verbose() { return m_verbose; }
static inline void setBackground(bool background) { m_background = background; }
static inline void setColors(bool colors) { m_colors = colors; }
static inline void setVerbose(uint32_t verbose) { m_verbose = verbose; }
private:
static bool m_background;
static bool m_colors;
static uint32_t m_verbose;
static LogPrivate *d;
};
@@ -119,13 +134,14 @@ private:
#define CYAN_BG_BOLD(x) CYAN_BG_BOLD_S x CLEAR
#define LOG_EMERG(x, ...) xmrig::Log::print(xmrig::Log::EMERG, x, ##__VA_ARGS__)
#define LOG_ALERT(x, ...) xmrig::Log::print(xmrig::Log::ALERT, x, ##__VA_ARGS__)
#define LOG_CRIT(x, ...) xmrig::Log::print(xmrig::Log::CRIT, x, ##__VA_ARGS__)
#define LOG_ERR(x, ...) xmrig::Log::print(xmrig::Log::ERR, x, ##__VA_ARGS__)
#define LOG_WARN(x, ...) xmrig::Log::print(xmrig::Log::WARNING, x, ##__VA_ARGS__)
#define LOG_NOTICE(x, ...) xmrig::Log::print(xmrig::Log::NOTICE, x, ##__VA_ARGS__)
#define LOG_INFO(x, ...) xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__)
#define LOG_EMERG(x, ...) xmrig::Log::print(xmrig::Log::EMERG, x, ##__VA_ARGS__)
#define LOG_ALERT(x, ...) xmrig::Log::print(xmrig::Log::ALERT, x, ##__VA_ARGS__)
#define LOG_CRIT(x, ...) xmrig::Log::print(xmrig::Log::CRIT, x, ##__VA_ARGS__)
#define LOG_ERR(x, ...) xmrig::Log::print(xmrig::Log::ERR, x, ##__VA_ARGS__)
#define LOG_WARN(x, ...) xmrig::Log::print(xmrig::Log::WARNING, x, ##__VA_ARGS__)
#define LOG_NOTICE(x, ...) xmrig::Log::print(xmrig::Log::NOTICE, x, ##__VA_ARGS__)
#define LOG_INFO(x, ...) xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__)
#define LOG_VERBOSE(x, ...) if (xmrig::Log::isVerbose()) { xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__); }
#ifdef APP_DEBUG
# define LOG_DEBUG(x, ...) xmrig::Log::print(xmrig::Log::DEBUG, x, ##__VA_ARGS__)

View File

@@ -27,28 +27,29 @@
#include <cstdio>
#include "base/tools/Handle.h"
#include "base/io/log/backends/ConsoleLog.h"
#include "base/tools/Handle.h"
#include "base/io/log/Log.h"
#include "version.h"
xmrig::ConsoleLog::ConsoleLog()
{
if (!isSupported()) {
Log::colors = false;
Log::setColors(false);
return;
}
m_tty = new uv_tty_t;
if (uv_tty_init(uv_default_loop(), m_tty, 1, 0) < 0) {
Log::colors = false;
Log::setColors(false);
return;
}
uv_tty_set_mode(m_tty, UV_TTY_MODE_NORMAL);
# ifdef WIN32
# ifdef XMRIG_OS_WIN
m_stream = reinterpret_cast<uv_stream_t*>(m_tty);
HANDLE handle = GetStdHandle(STD_INPUT_HANDLE);
@@ -59,6 +60,8 @@ xmrig::ConsoleLog::ConsoleLog()
SetConsoleMode(handle, mode | ENABLE_EXTENDED_FLAGS);
}
}
SetConsoleTitleA(APP_NAME " " APP_VERSION);
# endif
}
@@ -71,11 +74,11 @@ xmrig::ConsoleLog::~ConsoleLog()
void xmrig::ConsoleLog::print(int, const char *line, size_t, size_t size, bool colors)
{
if (!m_tty || Log::colors != colors) {
if (!m_tty || Log::isColors() != colors) {
return;
}
# ifdef _WIN32
# ifdef XMRIG_OS_WIN
uv_buf_t buf = uv_buf_init(const_cast<char *>(line), static_cast<unsigned int>(size));
if (!isWritable()) {
@@ -99,7 +102,7 @@ bool xmrig::ConsoleLog::isSupported() const
}
#ifdef WIN32
#ifdef XMRIG_OS_WIN
bool xmrig::ConsoleLog::isWritable() const
{
if (!m_stream || uv_is_writable(m_stream) != 1) {

View File

@@ -54,7 +54,7 @@ private:
uv_tty_t *m_tty = nullptr;
# ifdef _WIN32
# ifdef XMRIG_OS_WIN
bool isWritable() const;
uv_stream_t *m_stream = nullptr;

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,39 +29,21 @@
#include <cassert>
#include <cstring>
#include <uv.h>
xmrig::FileLog::FileLog(const char *fileName)
xmrig::FileLog::FileLog(const char *fileName) :
m_writer(fileName)
{
uv_fs_t req;
m_file = uv_fs_open(uv_default_loop(), &req, fileName, O_CREAT | O_APPEND | O_WRONLY, 0644, nullptr);
uv_fs_req_cleanup(&req);
}
void xmrig::FileLog::print(int, const char *line, size_t, size_t size, bool colors)
{
if (m_file < 0 || colors) {
if (!m_writer.isOpen() || colors) {
return;
}
assert(strlen(line) == size);
uv_buf_t buf = uv_buf_init(new char[size], size);
memcpy(buf.base, line, size);
auto req = new uv_fs_t;
req->data = buf.base;
uv_fs_write(uv_default_loop(), req, m_file, &buf, 1, -1, FileLog::onWrite);
}
void xmrig::FileLog::onWrite(uv_fs_t *req)
{
delete [] static_cast<char *>(req->data);
uv_fs_req_cleanup(req);
delete req;
m_writer.write(line, size);
}

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,9 +27,7 @@
#define XMRIG_FILELOG_H
typedef struct uv_fs_s uv_fs_t;
#include "base/io/log/FileLogWriter.h"
#include "base/kernel/interfaces/ILogBackend.h"
@@ -41,14 +39,11 @@ class FileLog : public ILogBackend
public:
FileLog(const char *fileName);
protected:
void print(int level, const char *line, size_t offset, size_t size, bool colors) override;
private:
static void onWrite(uv_fs_t *req);
int m_file;
FileLogWriter m_writer;
};

View File

@@ -127,7 +127,7 @@ private:
return config.release();
}
chain.addFile(process->location(Process::ExeLocation, "config.json"));
chain.addFile(Process::location(Process::ExeLocation, "config.json"));
if (read(chain, config)) {
return config.release();
@@ -177,7 +177,7 @@ int xmrig::Base::init()
Platform::init(config()->userAgent());
if (isBackground()) {
Log::background = true;
Log::setBackground(true);
}
else {
Log::add(new ConsoleLog());

View File

@@ -101,9 +101,9 @@ static int showVersion()
#ifdef XMRIG_FEATURE_HWLOC
static int exportTopology(const Process &process)
static int exportTopology(const Process &)
{
const String path = process.location(Process::ExeLocation, "topology.xml");
const String path = Process::location(Process::ExeLocation, "topology.xml");
hwloc_topology_t topology;
hwloc_topology_init(&topology);

Some files were not shown because too many files have changed in this diff Show More