2016-11-17 61 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); 

祝您好運!