IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.
ã¾ãæåã«é åã®è¶³ãç®ãè¡ãããã°ã©ã ã C è¨èªã§æ¸ãã¦ã¿ã¾ã. ä¾ãã°ä»¥ä¸ã®ããã«ãªãã¾ã. vecadd.c #include <stdio.h> // é åã®è¶³ãç®ãè¡ãé¢æ° void vecadd(float *x, float *y, float *z, int N) { int i; for(i = 0; i < N; i++) z[i] = x[i] + y[i]; } int main() { int N=10; // é åã®ãµã¤ãºãæå®ãã int i; float x[N], y[N], z[N]; // åæå¤ã®è¨å® for(i = 0; i < N; i++) { x[i] = i + 1.0; y[i] = i + 2.0; } // ããã§è¶³ãç®ãè¡ã vecadd(&x[0], &y[0], &z[0], N); // åºå for(i = 0; i < N
追è¨(2009/12/12): ããã§ç¤ºãã¦ãã³ã¼ãã¯ããªãã²ã©ãã®ã§å°ãæç´ããã¦ãCUDAã§ä½æããååååå¦è¨ç®ããã°ã©ã ãæ¸ãç´ãã¦ã¿ãã¨ããè¨äºã«ã¾ã¨ããããã¡ããåç §ãã¦æ¬²ããã æè¿ãèªåã®å¨ãã§ã¯CUDAã使ã£ãGPGPUãæµè¡ã£ã¦ããã®ã§ãã©ããªãã®ããã®é±æ«ã«ããã£ã¦ã¿ãã ä¸æ¥ç®ã¯NVIDIA GeForce 8800 GTSãæè¼ããWindows XPãã·ã³ã«CUDAãã¤ã³ã¹ãã¼ã«ããã¦ãªãã¡ã¬ã³ã¹ããµã³ãã«ããã°ã©ã ããã©ãã©ã¨èªãã§ã¿ããäºæ¥ç®ã«ãªãã¡ãã£ã¦ååååå¦(MD)è¨ç®ããã°ã©ã ãæ¸ãããæ¬ä¼¼ååãæ±ã£ã¦ãããå ¨ååã®vdWåã¨ã¯ã¼ãã³åã®ã¿ãèæ ®ãã¦ååå çµåã«ã¤ãã¦ã¯èæ ®ããªãã液滴ä¸ã®MDè¨ç®ã ãåãæ¢ãããåå¾20à ã®æ¶²æ»´ä¸ã«1229ååãå ¥ãã¦1000ã¹ãããè¨ç®ããã¦ã¿ããC++ã§æ¸ããããã°ã©ã ã§ã¯4å30ç§ããã£ãè¨ç®ãCUDAã§ã¯3
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}