Reply to comment

Помогите новичку, пожалйста

Tagged:  

Собственно пишу прорамму для распределенного вычисления функции:

__device__ BYTE K[16];
__device__ WORD K1, K2, K3, K4 ;

__device__ void SetKey( unsigned char * key )
{
for (i=0;i<16;i++) K[i]=key[i];
}

__global__ void chiper( BYTE *plain, DWORD newkey, DWORD *retdata )
{
SetKey(newkey);
.....
DoCrypt(plain);
....
}
Вот такой вопрос, если я запускаю многопоточный расчет, не накладываются ли у меня массивы K[]
друг на друга?
При одной нити chiper<<1,1>> рабтоает как надо, как только больше одной - мусор в итоге.
Может быть надо определить K[][num of threads] ?
спасибо.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <i> <table> <td> <tr> <th>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Images can be added to this post.

More information about formatting options

Copyright © 2008-2011 Alex Tutubalin