おいも貴婦人ブログ

生物系博士課程満期退学をしたAIエンジニアのブログ。

2015-10-18から1日間の記事一覧

素人によるCUDAのお勉強。7

参考にしている本の翻訳版が出てました…。高い...。でも買う価値は大いにあると思います。CUDA C プロフェッショナル プログラミング (impress top gear)作者: John Cheng,Max Grossman,Ty McKercher,森野慎也,株式会社クイープ出版社/メーカー: インプレス…

素人によるCUDAのお勉強。6

cudaプログラミングの時間の計測。sys/time.hのgettimeofdayを使って、CPU上でGPUの実行時間を計測します。グリッドの次元に上限があるため #include <cuda_runtime.h> #include <stdio.h> #include <sys/time.h> #define CHECK(call)\ {\ const cudaError_t error = call;\ if (error != cudaSucc</sys/time.h></stdio.h></cuda_runtime.h>…

素人によるCUDAのお勉強。5

簡単な例としてベクトルの足し算を行います。CPUで同じ計算を実行し、その結果とGPUで計算をした結果があっているか確かめます。 #include <cuda_runtime.h> #include <stdio.h> #define CHECK(call)\ {\ const cudaError_t error = call;\ if (error != cudaSuccess)\ {\ printf("Err</stdio.h></cuda_runtime.h>…