2016-11-17 59 views
1

我已经在Python中实现了一个并行BF Generator,就像这篇文章一样! Parallelize brute force generation并行蛮力算法GPU

我想在GPU上实现这种并行技术。应该像一个GPU上的并行BF Generator。

有人可以帮我看一下GPU上并行BF Generator的一些代码示例吗?

无法在网上找到这让我怀疑任何的例子...

THX

回答

0

看看这个实现 - 我做了这段代码的GPU分配:

​​

这样称呼:

// the Thread index number  
int idx = get_global_id(0); 

// the length of your charset "abcdefghi......" 
unsigned int charSetLen = 26; 

// the length of the word you want to brute 
unsigned int bruteLength = 6; 

// theBrute keeps the single start numbers of the alphabeth 
unsigned char theBrute[MAX_BRUTE_LENGTH]; 

IncrementBruteGPU(theBrute, charSetLen, bruteLength, idx); 

祝您好运!