shilch / fastmerkle Goto Github PK
View Code? Open in Web Editor NEWCompute bitcoin Merkle trees on your GPU
Home Page: https://shilch.me/scaling-bitcoins-merkle-tree/
Compute bitcoin Merkle trees on your GPU
Home Page: https://shilch.me/scaling-bitcoins-merkle-tree/
I had to change merkle input argument types in merkle.cl
diff --git a/merkle.cl b/merkle.cl
index af4de86..f47b2da 100644
--- a/merkle.cl
+++ b/merkle.cl
@@ -233,7 +233,7 @@ static void sha256d_cat(global const uint* lhs, global const uint* rhs, global u
#define EQUAL(lhs, rhs) (lhs[0] == rhs[0] && lhs[1] == rhs[1] && lhs[2] == rhs[2] && lhs[3] == rhs[3] && lhs[4] == rhs[4] && lhs[5] == rhs[5] && lhs[6] == rhs[6] && lhs[7] == rhs[7])
-kernel void merkle(global const uchar* data, const size_t leaves, const size_t round, global int* mutated){
+kernel void merkle(global const uchar* data, const ulong leaves, const ulong round, global int* mutated){
size_t id = get_global_id(0);
size_t size = get_global_size(0);
to be able to even start on GTX1070, because size_t is apparently restricted type from input arguments. ulong
is required instead of uint
because of CL_INVALID_ARG_SIZE error.
Unfortunately, this fix only partially helps (btw - still works for integrated GPU on my Intel CPU), because on 8388608 leaves I'm getting CL_MEM_OBJECT_ALLOCATION_FAILURE error. I'm guessing that some other values/data types should also be changed to ulong
, but I'm not an expert in OpenCL and not sure what else should be changed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.