(情報科学)技術的特異点と科学技術等 2 (ナノテク)at FUTURE
(情報科学)技術的特異点と科学技術等 2 (ナノテク) - 暇つぶし2ch282:>>249
18/07/30 07:06:07.72 wOzVCFyH.net BE:138871639-2BP(0)
URLリンク(img.5ch.net)
Page 29
スレッドの切り替え (3/3)
? 以下のようにa, bの読み込み後にchgthreadを入れる事で改善される。
void pzc_Add(float* a, float* b, float* c, int count)
{
  int tid = get_tid(); // thread ID (0 - 7)
  int pid = get_pid(); // PE ID
  int offset = pid * get_maxtid() + tid;
  int step = get_maxtid() * get_maxpid();
  for(int pos = offset; pos < count; pos += step) {
    float a_ = a[pos];
    float b_ = b[pos];
    chgthread();
    c[pos] = a_ + b_;
  }
  flush();
}
    memory
  ↑ request    ↓
t0    stall      flush
   ↓ chgthread
t4


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch