{"id":791,"date":"2012-01-26T01:04:06","date_gmt":"2012-01-25T16:04:06","guid":{"rendered":"http:\/\/daily.belltail.jp\/?p=791"},"modified":"2012-01-26T01:04:06","modified_gmt":"2012-01-25T16:04:06","slug":"nvcc%e3%81%a8gcc%e3%81%a7%e3%81%ae%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e3%83%aa%e3%83%b3%e3%82%af","status":"publish","type":"post","link":"https:\/\/daily.belltail.jp\/?p=791","title":{"rendered":"nvcc\u3068gcc\u3067\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u30ea\u30f3\u30af"},"content":{"rendered":"<p>\u306d\u3080\u3044\u3067\u3059\u306d\u3002<br \/>\n\u6700\u8fd1\u30d6\u30ed\u30b0\u306e\u30cd\u30bf\u304c\u306a\u3044\u306e\u3067\u3001\u3057\u3087\u30fc\u3082\u306a\u3044\u5185\u5bb9\u3067\u8a18\u4e8b\u3072\u3068\u3064\u3002\u3059\u3050\u2193\u306e\u8aac\u660e\u3055\u3048\u8aad\u3093\u3067\u308f\u304b\u308b\u306a\u3089\u305d\u308c\u4ee5\u4e0b\u306f\u898b\u308b\u5fc5\u8981\u306a\u3044\u3067\u3059\uff57\uff57<\/p>\n<p>\u3055\u3066\u3001CUDA\u30b3\u30f3\u30d1\u30a4\u30e9nvcc\u306e\u5410\u304f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u306f\u666e\u901a\u306bgcc\u306e\u5410\u304f\u306e\u3068\u540c\u3058ELF\u5f62\u5f0f\u3067\u3059\u306e\u3067\u3001\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3057\u305f\u30bd\u30fc\u30b9(*.cu)\u3092nvcc\u3067-c\u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u51fa\u529b\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u3068gcc\u3067\u51fa\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u30ea\u30f3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>main\u304b\u3089\u76f4\u63a5nvcc\u3092\u901a\u3055\u306a\u3044\u305f\u3081\u306b\u3001\u30ab\u30fc\u30cd\u30eb\u3092\u547c\u3073\u51fa\u3059\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u95a2\u6570\u3092\u7528\u610f<\/p>\n<pre class=\"brush: cpp; title: a_cuda_wrapper.h; notranslate\" title=\"a_cuda_wrapper.h\">\r\nvoid a_cuda_kernerl_frontend();\r\n<\/pre>\n<p>\u30c7\u30d0\u30a4\u30b9\u30b3\u30fc\u30c9\u304c\u3053\u3061\u3089<\/p>\n<pre class=\"brush: cpp; title: kernel.cu; notranslate\" title=\"kernel.cu\">\r\n#include &quot;a_cuda_wrapper.h&quot;\r\n\r\n__global__ void cuda_kernel()\r\n{\r\n}\r\n\r\nvoid a_cuda_kernerl_frontend()\r\n{\r\n\tcuda_kernel&lt;&lt;&lt;1, 1&gt;&gt;&gt;();\r\n}\r\n<\/pre>\n<p>\u305d\u3057\u3066nvcc\u3092\u901a\u3055\u306a\u3044main\u304c\u3053\u3061\u3089<\/p>\n<pre class=\"brush: cpp; title: main.cpp; notranslate\" title=\"main.cpp\">\r\n#include &lt;iostream&gt;\r\nusing namespace std;\r\n\r\n#include &quot;a_cuda_wrapper.h&quot;\r\n\r\nint main()\r\n{\r\n\ta_cuda_kernerl_frontend();\r\n}\r\n<\/pre>\n<p>\u3053\u308c\u3067<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n% g++ -c main.cpp\r\n% nvcc -c kernel.cu\r\n% nvcc main.o kernel.o\r\n% .\/a.out\r\n<\/pre>\n<p>\u30ea\u30f3\u30af\u3059\u308b\u3068\u304d\u306bg++\u3058\u3083\u306a\u304f\u3066nvcc\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002\u5f53\u7136\u3067\u3059\u306d\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001C++\u30d9\u30fc\u30b9\u306e\u3067\u304b\u3044\u30b7\u30b9\u30c6\u30e0\u306e\u4e00\u90e8\u3068\u3057\u3066CUDA\u3092\u7528\u3044\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u306d\uff01\uff01<br \/>\n\u3053\u308c\u304c\u3067\u304d\u308b\u3053\u3068\u304f\u3089\u3044\u8ab0\u3067\u3082\u77e5\u3063\u3066\u308b\u3068\u601d\u3046\u3093\u3060\u3051\u3069\u3001\u5b9f\u969b\u306b\u3084\u3063\u3066\u308b\u30b5\u30f3\u30d7\u30eb\u3066\u898b\u306a\u3044\u306a\u3041\u3068\u601d\u3063\u3066(main\u307e\u3067*.cu\u306b\u66f8\u3044\u3066\u3042\u308b)<br \/>\n\uff08\u305d\u3046\u3067\u3059\u30b5\u30f3\u30d7\u30eb\u306b\u3059\u308b\u307b\u3069\u306e\u3053\u3068\u3082\u306a\u3044\u304b\u3089\u3067\u3059<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306d\u3080\u3044\u3067\u3059\u306d\u3002 \u6700\u8fd1\u30d6\u30ed\u30b0\u306e\u30cd\u30bf\u304c\u306a\u3044\u306e\u3067\u3001\u3057\u3087\u30fc\u3082\u306a\u3044\u5185\u5bb9\u3067\u8a18\u4e8b\u3072\u3068\u3064\u3002\u3059\u3050\u2193\u306e\u8aac\u660e\u3055\u3048\u8aad\u3093\u3067\u308f\u304b\u308b\u306a\u3089\u305d\u308c\u4ee5\u4e0b\u306f\u898b\u308b\u5fc5\u8981\u306a\u3044\u3067\u3059\uff57\uff57 \u3055\u3066\u3001CUDA\u30b3\u30f3\u30d1\u30a4\u30e9nvcc\u306e\u5410\u304f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u306f\u666e\u901a\u306bgcc\u306e\u5410\u304f\u306e\u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[12,13],"class_list":["post-791","post","type-post","status-publish","format-standard","hentry","category-1","tag-c","tag-cuda"],"_links":{"self":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=791"}],"version-history":[{"count":0,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=\/wp\/v2\/posts\/791\/revisions"}],"wp:attachment":[{"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daily.belltail.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}