2016-11-17 1 views
1

나는이 게시물 에서처럼 Python에서 병렬 BF 생성기를 구현했습니다! Parallelize brute force generation.병렬 Brute Froce 알고리즘 GPU

이 병렬 기술을 GPU에서 구현하고 싶습니다. GPU의 병렬 BF 생성기와 같아야합니다.

누군가 GPU에서 병렬 BF 생성기에 대한 몇 가지 코드 예제를 도와 줄 수 있습니까? 이 구현에서

나를 의심했다 온라인 예제를 찾을 수 없습니다 ...

들으

답변

0

봐 -이 코드를 사용하여 GPU에 분포 한 :

void IncBruteGPU(unsigned char* theBrute, unsigned int charSetLen, unsigned int bruteLength, unsigned int incNr){ 
    unsigned int i = 0; 
    while(incrementBy > 0 && i < bruteLength){ 
     int add = incrementBy + ourBrute[i]; 
     ourBrute[i] = add % charSetLen; 
     incrementBy = add/charSetLen; 
     i++; 
    } 
} 

을 다음과 같이 호출하십시오.

// 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); 

행운을 비네!

관련 문제