CUDAã®ã«ã¼ãã«é¢æ°ã§printfã使ã
ã«ã¼ãã«é¢æ°ã§ãprintf()ã使ããããã«ãªã£ãã®ã«å
¨ç¶ä½¿ã£ã¦ããªãã£ãã®ã§ã
æè§ãªã®ã§ããããã¨CUDAããã°ã©ãã³ã°ã¬ã¤ãã®ã½ã¼ã¹ããã®ã¾ã¾æã£ã¦ãã¦ã³ã³ãã¤ã«ãããã»ã»ã»
error: calling a host function from a __device__/__global__ function is not allowed
ã£ã¦è¨ãããorz
ãã¼ã¸ã§ã³ãnvcc3.2ã§printf()ã使ããã£ã¦æ¸ãã¦ããã
GPUãFermiã使ã£ã¦ãã®ã«ãªãã§ï¼ã£ã¦ãªã£ãæã®ã¡ã¢ã§ãã
解決ç
ãããã«åèè³æã®CUDAããã°ã©ãã³ã°ã¬ã¤ãã®ä¸ã®B.14 Formatted Outputã®é¨åã«ãããµã³ãã«ããã®ã¾ã¾ã³ã³ãã¤ã«ãã¦ããã®ã«ãã¡ã ã£ãã®ã§ãªãã§ããªãã¨åèè³æã®ããããèªãã§ããã¨ãã©ãããã³ã³ãã¤ã«ããã¨ãã«
nvccã®ãªãã·ã§ã³ã«-arch=sm_20ã -arch=sm_21ãã¤ããªãã¨ãã¡ãªãããªã
å®éã«ä»ãã¦ã¿ãã¨ã³ã³ãã¤ã«ã¯éãã¾ããã
cuda-gdbããããæã¨éã£ã¦å¤§åã«ã¼ãã«é¢æ°ã®é¨åã®ããã°ã楽ã«ãªã£ããªã