{"id":715,"date":"2016-02-12T14:51:25","date_gmt":"2016-02-12T14:51:25","guid":{"rendered":"http:\/\/coolt.ch\/notizen\/?p=715"},"modified":"2016-02-12T14:51:25","modified_gmt":"2016-02-12T14:51:25","slug":"cuda-threads","status":"publish","type":"post","link":"https:\/\/coolt.ch\/notizen\/cuda-threads\/","title":{"rendered":"CUDA Threads"},"content":{"rendered":"<p>Eine Funktion kann N-mal aufgerufen werden. Daraus entstehen N parallele Blocks im Kernel, die man \u00fcber ihre Block-Id ansprechen kann.<\/p>\n<p>Innerhalb eines Blocks k\u00f6nnen mehrere Prozesse (Threads) gestartet werden. Dies ist notwendig, wenn ein <strong>Vektor<\/strong>, auf mehrere Bl\u00f6cke eingeteilt wird.<br \/>\nJeder Block hat seinen Vektor. Doch <strong>innerhalb eines Vektors entstehen mehrere Prozesse<\/strong>.<\/p>\n<pre class=\"lang:sh decode:true\">__global__ void add( int *a, int *b, int *c ) {\r\n.   c[ <strong>threadIdx.x<\/strong> blockIdx.x ] = \r\n.              a[ <strong>threadIdx.x<\/strong>  blockIdx.x ] + \r\n.              b[ <strong>threadIdx.x<\/strong>  blockIdx.x ];\r\n}<\/pre>\n<p>Jedes <strong>Element des Vektors<\/strong> hat seinen <strong>Thread<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Eine Funktion kann N-mal aufgerufen werden. Daraus entstehen N parallele Blocks im Kernel, die man \u00fcber ihre Block-Id ansprechen kann. Innerhalb eines Blocks k\u00f6nnen mehrere Prozesse (Threads) gestartet werden. Dies ist notwendig, wenn ein Vektor, auf mehrere Bl\u00f6cke eingeteilt wird. Jeder Block hat seinen Vektor. Doch innerhalb eines Vektors entstehen mehrere Prozesse. __global__ void add( &hellip; <a href=\"https:\/\/coolt.ch\/notizen\/cuda-threads\/\" class=\"more-link\"><span class=\"screen-reader-text\">CUDA Threads<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[80],"tags":[],"_links":{"self":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/715"}],"collection":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":2,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"predecessor-version":[{"id":1332,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/715\/revisions\/1332"}],"wp:attachment":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}