{"id":302914,"date":"2020-05-02T15:00:22","date_gmt":"2020-05-02T15:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302914"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302914","title":{"rendered":"\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 GPU \u043d\u0430 Java"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500106\/\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a GPU \u0438\u0437 Java \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043c\u043e\u0449\u044c. \u0417\u0434\u0435\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a GPU \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 Java.<\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (GPU) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c \u043c\u0438\u0440\u043e\u043c \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432. \u042d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f Java \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f GPU. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, GPU \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0442\u0435\u0440\u0430\u0444\u043b\u043e\u043f\u0441\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043f\u0438\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c, \u044f \u043f\u043e\u0442\u0440\u0430\u0447\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 GPU \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0436\u0435\u043b\u0435\u0437\u0430.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f GPU \u043e\u0442 CPU \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GPU \u0432 \u043c\u0438\u0440\u0435 Java. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u044f \u043e\u043f\u0438\u0448\u0443 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 Java \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0445 \u043d\u0430 GPU, \u0438 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u0435\u043a\u0433\u0440\u0430\u0443\u043d\u0434\u0430<\/h3>\n<p>  GPU \u0431\u044b\u043b\u043e \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043e NVIDIA \u0432 1999. \u042d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043d\u0430 \u0434\u0438\u0441\u043f\u043b\u0435\u0439. \u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u043a\u0438 CPU, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u044b CPU \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u043a\u043e\u0440\u044f\u044e\u0442 \u044d\u0442\u0438 \u0440\u0430\u0437\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0438, \u0434\u0435\u043b\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043a\u0430\u0434\u0440\u043e\u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u0430\u0432\u043d\u043e\u0439.<\/p>\n<p>  \u0421\u0443\u0442\u044c 2D\/3D \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c\u0438, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430. \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439? \u041e\u0442\u0432\u0435\u0442\u0438\u043c \u043d\u0430 \u044d\u0442\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 CPU (\u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u0440\u0438\u0441. 1.) \u0438 GPU.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d6c\/58e\/c4c\/d6c58ec4ccbec78f237d58a822f9ab92.jpg\" alt=\"image\"><br \/>  <i>\u0420\u0438\u0441. 1. \u0411\u043b\u043e\u043a\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b CPU<\/i><\/p>\n<p>  \u0412 CPU, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u2013 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u043e-\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u043b\u043e\u043a(ALU) \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u2013 \u043b\u0438\u0448\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0414\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043d\u0435\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0445 \u0432 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0438 \u0434\u043e\u0440\u043e\u0433\u043e \u043a\u0435\u0448; \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u0432; \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 GPU, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0439 \u043c\u0430\u043d\u0435\u0440\u0435, \u0438 GPU \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0438 \u043d\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441 \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439, \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u043d\u0430 \u044d\u0442\u0443, \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0430 \u0440\u0438\u0441. 2.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/365\/425\/84c\/36542584c2d34d817c48ca2cd0e8d433.jpg\" alt=\"image\"><br \/>  <i>\u0420\u0438\u0441. 2. \u0411\u043b\u043e\u043a\u043e\u0432\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u044f\u0434\u0440\u0430 GPU<\/i><\/p>\n<p>  \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0434\u0435\u0448\u0435\u0432\u043b\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0438\u0445 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u0443\u0441\u043a\u0430\u0445, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u042d\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e, \u0441\u0441\u044b\u043b\u0430\u044f\u0441\u044c \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 MIMD (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u00abmim-dee\u00bb).<\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0444\u0430\u043a\u0442\u0435, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0447\u0430\u0441\u0442\u044f\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 SIMD (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u00absim-dee\u00bb). \u0412 \u044d\u0442\u043e\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GPU \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 ALU \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441. 3. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/453\/4cb\/013\/4534cb0135c6c5c3075594787c3266c6.jpg\" alt=\"image\"><br \/>  <i>\u0420\u0438\u0441. 3. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 MIMD-\u0441\u0442\u0438\u043b\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b GPU \u0431\u043b\u043e\u043a\u043e\u0432 (\u0441 \u043b\u0435\u0432\u043e), \u0441 SIMD \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u043c (\u0441 \u043f\u0440\u0430\u0432\u043e)<\/i><\/p>\n<p>  \u0421\u043c\u0435\u0448\u0438\u0432\u0430\u044f SIMD \u0438 MIMD \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043e\u0431\u043e\u0439\u0434\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439. \u0412 \u044d\u0442\u043e\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435, \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 SIMD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441. 4.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d81\/fc5\/f10\/d81fc5f10ab5cf27584669ab846b9836.jpg\" alt=\"image\"><br \/>  <i>\u0420\u0438\u0441. 4. \u0420\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 SIMD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438; \u0437\u0434\u0435\u0441\u044c 16 \u044f\u0434\u0435\u0440 \u0441 128 ALU<\/i><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u0441\u0432\u044f\u0437\u043a\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445, \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435.<\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 GPU<\/h3>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0430\u043d\u043d\u0438\u0445 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u0432 \u0438\u0433\u0440\u0430\u0445 \u0431\u044b\u043b\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0436\u0435\u0441\u0442\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430 GPU \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u043a \u043f\u043e\u0442\u043e\u043a\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 CPU.<\/p>\n<p>  \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0434\u0430\u0436\u0435 \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0436\u0435\u0441\u0442\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0431\u044b\u043b\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u0438\u0433\u0440, \u0433\u0434\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439. \u0412 \u043e\u0442\u0432\u0435\u0442, \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0434\u0430\u0432\u0446\u044b \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a GPU, \u0438 \u0437\u0430\u0442\u0435\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445.<\/p>\n<p>  \u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u044b\u043b \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 shaders, \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 (\u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u043f\u043e\u0434\u0432\u0438\u0434\u0435 C) \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044f \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u043f\u043e\u0434 \u043d\u0443\u0436\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u0422\u0435\u0440\u043c\u0438\u043d shaders \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e shaders \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0441\u0432\u0435\u0442\u0430 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u0442\u0435\u043d\u0438, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0434\u0430\u0432\u0435\u0446 GPU \u0438\u043c\u0435\u043b \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f shaders \u0434\u043b\u044f \u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. <\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>DirectCompute: \u0447\u0430\u0441\u0442\u043d\u044b\u0435 shader \u044f\u0437\u044b\u043a\/API \u043e\u0442 Microsoft, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e Direct3D, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 DirectX 10.<\/li>\n<li>AMD FireStream: \u0447\u0430\u0441\u0442\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 ATI\/Radeon, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438 \u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e AMD.<\/li>\n<li>OpenACC: \u043c\u0443\u043b\u044c\u0442\u0438\u0432\u0435\u043d\u0434\u043e\u0440-\u043a\u043e\u043d\u0441\u043e\u0440\u0446\u0438\u0443\u043c, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439<\/li>\n<li>\u0421++ AMP: \u0447\u0430\u0441\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Microsoft \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 C++<\/li>\n<li>CUDA: \u0447\u0430\u0441\u0442\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 Nvidia, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u0430 \u0421<\/li>\n<li>Open\u0421L: \u043e\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 Apple, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u0440\u0446\u0438\u0443\u043c\u043e\u043c Khronos Group<\/li>\n<\/ul>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 GPU \u044d\u0442\u043e \u043d\u0438\u0437\u043a\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0434\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0431\u044b\u043b\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439. \u0421\u0430\u043c\u0430\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u044d\u0442\u043e DirectX, \u043e\u0442 Microsoft, \u0438 OpenGL, \u043e\u0442 Khronos Group. \u042d\u0442\u0438 API \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0442\u0435\u043c \u0443\u043f\u0440\u043e\u0449\u0435\u043d \u0434\u043b\u044f GPU, \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430.<\/p>\n<p>  \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0437\u043d\u0430\u044e, \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Java \u0434\u043b\u044f DirectX, \u043d\u043e \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f OpenGL. JSR 231 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0432 2002 \u0438 \u0430\u0434\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043e GPU \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c, \u043d\u043e \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0432 2008 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e OpenGL 2.0.<\/p>\n<p>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 OpenGL \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 JOCL, (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 OpenCL), \u0438 \u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u0430\u044f \u0438\u0433\u0440\u0430 Minecraft \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c JOCL.<\/p>\n<h3>\u041f\u0440\u0438\u0445\u043e\u0434 GPGPU<\/h3>\n<p>  \u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440, Java \u0438 GPU \u043d\u0435 \u0438\u043c\u0435\u043b\u0438 \u0442\u043e\u0447\u0435\u043a \u0441\u043e\u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u044f, \u0445\u043e\u0442\u044f \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c. Java \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f\u0445, \u0432 \u043d\u0430\u0443\u043a\u0435 \u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0432 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e\u043c \u0441\u0435\u043a\u0442\u043e\u0440\u0435, \u0433\u0434\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u043b. \u042d\u0442\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0434\u0435\u044f general-purpose GPU (GPGPU). \u0418\u0434\u0435\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 GPU \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u043d\u0430\u0447\u0430\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0432\u0438\u0434\u0435\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432 \u043d\u0430\u0447\u0430\u043b\u0438 \u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u0431\u0443\u0444\u0435\u0440\u0443 \u043a\u0430\u0434\u0440\u043e\u0432, \u0434\u0430\u0432\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0430\u043a\u0435\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u044e \u0441\u0438\u043b\u0443 GPU \u0434\u043b\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. <br \/>  \u0420\u0435\u0446\u0435\u043f\u0442 \u0431\u044b\u043b \u0442\u0430\u043a\u0438\u043c:<\/p>\n<ol>\n<li>\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c shaders \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0445.<\/li>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0438\u0445 \u043e\u0431\u043e\u0438\u0445 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0443.<\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u043a\u0430\u0434\u0440\u0430<\/li>\n<li>\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/li>\n<\/ol>\n<p>  \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435. \u042f \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u043d\u043e \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u0438\u0441\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442 \u0421\u0442\u0435\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u0433\u043e \u0418\u043d\u0441\u0442\u0438\u0442\u0443\u0442\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GPU. \u0412 2005 \u043e\u043d\u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 BrookGPU, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0430 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0438 \u0441\u0440\u0435\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<\/p>\n<p>  BrookGPU \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432 Brook, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c ANSI C. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0446\u0435\u043b\u0435\u043d \u043d\u0430 OpenGL v1.3 +, DirectX v9 + \u0438\u043b\u0438 AMD Close to Metal \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0438 \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 Microsoft Windows \u0438 Linux. \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438, BrookGPU \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0443 \u043d\u0430 CPU.<br \/>  \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0432\u0437\u043b\u0435\u0442\u0435\u043b\u043e, \u0438\u0437-\u0437\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f. \u0412 \u043c\u0438\u0440\u0435 GPGPU, \u0442\u0435\u0431\u0435 \u043d\u0430\u0434\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e (\u0432 \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 GPU \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d), \u0436\u0434\u0430\u0442\u044c GPU \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0437\u0430\u0442\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a. \u0418 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 2000-\u0445, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b \u0432 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u044d\u0442\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u043b\u0438 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 GPU \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432\u0438\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432\u0438\u0434\u0435\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432 \u043d\u0430\u0447\u0430\u043b\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c GPGPU \u0441 \u0438\u0445 \u0444\u0438\u0440\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043b\u044c\u044f\u043d\u0441\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u043b\u0438 \u043c\u0435\u043d\u0435\u0435 \u0431\u0430\u0437\u043e\u0432\u043e, \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0436\u0435\u043b\u0435\u0437\u0430. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u0430\u043c \u0432\u0441\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0434\u0432\u0435 \u0441\u0430\u043c\u044b\u0435 \u0443\u0434\u0430\u0447\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 GPU \u2013 OpenCL \u0438 CUDA \u2013 \u0441\u043c\u043e\u0442\u0440\u0438 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a Java \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043d\u0438\u043c\u0438. <\/p>\n<h3>OpenCL \u0438 Java<\/h3>\n<p>  \u041a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, OpenCL \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0430 C. \u042d\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Java Native Interface (JNI) \u0438\u043b\u0438 Java Native Access (JNA), \u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u043c \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<\/p>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u044d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u044b\u043b\u0430 \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438: JOCL, JogAmp, \u0438 JavaCL. \u041a \u043d\u0435\u0441\u0447\u0430\u0441\u0442\u044c\u044e, JavaCL \u0441\u0442\u0430\u043b \u043c\u0435\u0440\u0442\u0432\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041d\u043e \u043f\u0440\u043e\u0435\u043a\u0442 JOCL \u0436\u0438\u0432 \u0438 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u042f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>  \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 OpenCL. \u042f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u0447\u0442\u043e OpenCL \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u2013 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e GPU \u0438 CPU, \u043d\u043e \u0434\u0430\u0436\u0435 DSP \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u0438 FPGA.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u044b\u0439 \u044f\u0440\u043a\u0438\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u0412\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0412\u044b \u0431\u0435\u0440\u0435\u0442\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b \u043a\u043b\u0430\u0434\u0435\u0442\u0435 \u0441\u0443\u043c\u043c\u0443 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441. 5.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/fff\/896\/f1f\/fff896f1feb607506f35dc8dcdce973b.jpg\" alt=\"image\"><br \/>  <i>\u0420\u0438\u0441. 5. \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0432\u0443\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u0443\u043c\u043c\u044b \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432<\/i><\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0438 \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 GPU \u044f\u0434\u0440\u0430. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 2048 \u044f\u0434\u0435\u0440, \u043a\u0430\u043a \u043d\u0430 Nvidia 1080, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c 2048 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0440\u0430\u0444\u043b\u043e\u043f\u0441\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u043c\u043e\u0449\u0438 \u0436\u0434\u0443\u0442 \u0432\u0430\u0441. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 10 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u0432 \u0447\u0438\u0441\u0435\u043b \u0432\u0437\u044f\u0442 \u0441 \u0441\u0430\u0439\u0442\u0430 JOCL:<\/p>\n<pre><code class=\"java\">public class ArrayGPU {     \/**      * The source code of the OpenCL program       *\/     private static String programSource =         &quot;__kernel void &quot;+         &quot;sampleKernel(__global const float *a,&quot;+         &quot;             __global const float *b,&quot;+         &quot;             __global float *c)&quot;+         &quot;{&quot;+         &quot;    int gid = get_global_id(0);&quot;+         &quot;    c[gid] = a[gid] + b[gid];&quot;+         &quot;}&quot;;          public static void main(String args[])     {         int n = 10_000_000;         float srcArrayA[] = new float[n];         float srcArrayB[] = new float[n];         float dstArray[] = new float[n];         for (int i=0; i&lt;n; i++)         {             srcArrayA[i] = i;             srcArrayB[i] = i;         }         Pointer srcA = Pointer.to(srcArrayA);         Pointer srcB = Pointer.to(srcArrayB);         Pointer dst = Pointer.to(dstArray);           \/\/ The platform, device type and device number         \/\/ that will be used         final int platformIndex = 0;         final long deviceType = CL.CL_DEVICE_TYPE_ALL;         final int deviceIndex = 0;          \/\/ Enable exceptions and subsequently omit error checks in this sample         CL.setExceptionsEnabled(true);          \/\/ Obtain the number of platforms         int numPlatformsArray[] = new int[1];         CL.clGetPlatformIDs(0, null, numPlatformsArray);         int numPlatforms = numPlatformsArray[0];          \/\/ Obtain a platform ID         cl_platform_id platforms[] = new cl_platform_id[numPlatforms];         CL.clGetPlatformIDs(platforms.length, platforms, null);         cl_platform_id platform = platforms[platformIndex];          \/\/ Initialize the context properties         cl_context_properties contextProperties = new cl_context_properties();         contextProperties.addProperty(CL.CL_CONTEXT_PLATFORM, platform);                  \/\/ Obtain the number of devices for the platform         int numDevicesArray[] = new int[1];         CL.clGetDeviceIDs(platform, deviceType, 0, null, numDevicesArray);         int numDevices = numDevicesArray[0];                  \/\/ Obtain a device ID          cl_device_id devices[] = new cl_device_id[numDevices];         CL.clGetDeviceIDs(platform, deviceType, numDevices, devices, null);         cl_device_id device = devices[deviceIndex];          \/\/ Create a context for the selected device         cl_context context = CL.clCreateContext(             contextProperties, 1, new cl_device_id[]{device},              null, null, null);                  \/\/ Create a command-queue for the selected device         cl_command_queue commandQueue =              CL.clCreateCommandQueue(context, device, 0, null);          \/\/ Allocate the memory objects for the input and output data         cl_mem memObjects[] = new cl_mem[3];         memObjects[0] = CL.clCreateBuffer(context,             CL.CL_MEM_READ_ONLY | CL.CL_MEM_COPY_HOST_PTR,             Sizeof.cl_float * n, srcA, null);         memObjects[1] = CL.clCreateBuffer(context,             CL.CL_MEM_READ_ONLY | CL.CL_MEM_COPY_HOST_PTR,             Sizeof.cl_float * n, srcB, null);         memObjects[2] = CL.clCreateBuffer(context,             CL.CL_MEM_READ_WRITE,             Sizeof.cl_float * n, null, null);                  \/\/ Create the program from the source code         cl_program program = CL.clCreateProgramWithSource(context,             1, new String[]{ programSource }, null, null);                  \/\/ Build the program         CL.clBuildProgram(program, 0, null, null, null, null);                  \/\/ Create the kernel         cl_kernel kernel = CL.clCreateKernel(program, &quot;sampleKernel&quot;, null);                  \/\/ Set the arguments for the kernel         CL.clSetKernelArg(kernel, 0,             Sizeof.cl_mem, Pointer.to(memObjects[0]));         CL.clSetKernelArg(kernel, 1,             Sizeof.cl_mem, Pointer.to(memObjects[1]));         CL.clSetKernelArg(kernel, 2,             Sizeof.cl_mem, Pointer.to(memObjects[2]));                  \/\/ Set the work-item dimensions         long global_work_size[] = new long[]{n};         long local_work_size[] = new long[]{1};                  \/\/ Execute the kernel         CL.clEnqueueNDRangeKernel(commandQueue, kernel, 1, null,             global_work_size, local_work_size, 0, null, null);                  \/\/ Read the output data         CL.clEnqueueReadBuffer(commandQueue, memObjects[2], CL.CL_TRUE, 0,             n * Sizeof.cl_float, dst, 0, null, null);                  \/\/ Release kernel, program, and memory objects         CL.clReleaseMemObject(memObjects[0]);         CL.clReleaseMemObject(memObjects[1]);         CL.clReleaseMemObject(memObjects[2]);         CL.clReleaseKernel(kernel);         CL.clReleaseProgram(program);         CL.clReleaseCommandQueue(commandQueue);         CL.clReleaseContext(context);      }      private static String getString(cl_device_id device, int paramName) {         \/\/ Obtain the length of the string that will be queried         long size[] = new long[1];         CL.clGetDeviceInfo(device, paramName, 0, null, size);          \/\/ Create a buffer of the appropriate size and fill it with the info         byte buffer[] = new byte[(int)size[0]];         CL.clGetDeviceInfo(device, paramName, buffer.length, Pointer.to(buffer), null);          \/\/ Create a string from the buffer (excluding the trailing \\0 byte)         return new String(buffer, 0, buffer.length-1);     } } <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043a\u043e\u0434 \u043d\u0430 Java, \u043d\u043e \u043e\u043d \u0438\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f. \u042f \u043e\u0431\u044a\u044f\u0441\u043d\u044e \u043a\u043e\u0434 \u0434\u0430\u043b\u0435\u0435; \u043d\u0435 \u0442\u0440\u0430\u0442\u0442\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u0431\u0443\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435. \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u043e\u0434 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043a\u043e\u0434 \u043d\u0430 \u0421. \u042d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e JOCL \u2013 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c OpenCL. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435, \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435, \u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u0430\u043c\u0430\u044f \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c: \u041e\u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e OpenCL \u0438 \u0437\u0430\u0442\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u043a\u0430\u0440\u0442\u0443, \u0433\u0434\u0435 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Kernel. \u041d\u0435 \u043f\u0443\u0442\u0430\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d \u0441 OC Kernel; \u044d\u0442\u043e \u043a\u043e\u0434 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 C.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 kernel \u0438\u0434\u0435\u0442 Java \u043a\u043e\u0434 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433: \u0442\u0443\u0442 \u00ab\u0445\u043e\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434\u00bb, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 Java), \u0438 \u00ab\u043a\u043e\u0434 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u00bb. \u0412\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0438 \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0445\u043e\u0441\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c GPU \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 \u00abHello World!\u00bb. \u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u0430.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043e\u0431 SIMD \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 SIMD \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u043c. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 kernel \u043a\u043e\u0434 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Java \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<pre><code class=\"cpp\">__kernel void MatrixMul_kernel_basic(int dim,                   __global float *A,                   __global float *B,                   __global float *C){      int iCol = get_global_id(0);     int iRow = get_global_id(1);     float result = 0.0;     for(int i=0; i&lt; dim; ++i)     {           result +=           A[iRow*dim + i]*B[i*dim + iCol];     }     C[iRow*dim + iCol] = result; } <\/code><\/pre>\n<p>  \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043a\u0443\u0441\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u0432\u0430\u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c OpenCL, \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 \u0432 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0432\u0438\u0434\u0435\u043e \u043a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 SIMD \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">#define VECTOR_SIZE 4     __kernel void MatrixMul_kernel_basic_vector4(     size_t dim, \/\/ dimension is in single floats     const float4 *A,     const float4 *B,     float4 *C) {     size_t globalIdx = get_global_id(0);     size_t globalIdy = get_global_id(1);     float4 resultVec = (float4){ 0, 0, 0, 0 };     size_t dimVec = dim \/ 4;     for(size_t i = 0; i &lt; dimVec; ++i) {         float4 Avector = A[dimVec * globalIdy + i];         float4 Bvector[4];         Bvector[0] = B[dimVec * (i * 4 + 0) + globalIdx];         Bvector[1] = B[dimVec * (i * 4 + 1) + globalIdx];         Bvector[2] = B[dimVec * (i * 4 + 2) + globalIdx];         Bvector[3] = B[dimVec * (i * 4 + 3) + globalIdx];         resultVec += Avector[0] * Bvector[0];         resultVec += Avector[1] * Bvector[1];         resultVec += Avector[2] * Bvector[2];         resultVec += Avector[3] * Bvector[3];     }      C[dimVec * globalIdy + globalIdx] = resultVec; } <\/code><\/pre>\n<p>  \u0421 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0434\u0432\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u041a\u0440\u0443\u0442\u043e. \u0412\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u043b\u0438 GPU \u0434\u043b\u044f Java \u043c\u0438\u0440\u0430! \u041d\u043e \u0431\u0443\u0434\u0443\u0447\u0438 Java \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u044e \u044d\u0442\u0443 \u0433\u0440\u044f\u0437\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u0441 \u0421 \u043a\u043e\u0434\u043e\u043c, \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0442\u043e\u043b\u044c \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u043c\u0438 \u0434\u0435\u0442\u0430\u043b\u044f\u043c\u0438? \u042f \u043d\u0435 \u0445\u043e\u0447\u0443. \u041d\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a GPU \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u043e\u0442 JOCL \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b.<\/p>\n<h3>CUDA \u0438 Java<\/h3>\n<p>  CUDA \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 Nvidia \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. CUDA \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 GPU \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0438 \u0434\u0430\u0436\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438. \u041f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043a\u0443\u0447\u0443 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u0432\u0441\u0435 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 JCuda:<\/p>\n<ul>\n<li>JCublas: \u0432\u0441\u0435 \u0434\u043b\u044f \u043c\u0430\u0442\u0440\u0438\u0446<\/li>\n<li>JCufft: \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0424\u0443\u0440\u044c\u0435 <\/li>\n<li>JCurand: \u0432\u0441\u0435 \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b<\/li>\n<li>JCusparse: \u0440\u0435\u0434\u043a\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b<\/li>\n<li>JCusolver: \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0438\u0441\u0435\u043b<\/li>\n<li>JNvgraph: \u0432\u0441\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u043e\u0432 <\/li>\n<li>JCudpp: CUDA \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438<\/li>\n<li>JNpp: \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u043d\u0430 GPU<\/li>\n<li>JCudnn: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439<\/li>\n<\/ul>\n<p>  \u042f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 JCurand, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0438\u0437 Java \u043a\u043e\u0434\u0430 \u0431\u0435\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 Kernel. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"java\">... int n = 100; curandGenerator generator = new curandGenerator(); float hostData[] = new float[n]; Pointer deviceData = new Pointer(); cudaMalloc(deviceData, n * Sizeof.FLOAT); curandCreateGenerator(generator, CURAND_RNG_PSEUDO_DEFAULT);  curandSetPseudoRandomGeneratorSeed(generator, 1234); curandGenerateUniform(generator, deviceData, n); cudaMemcpy(Pointer.to(hostData), deviceData,          n * Sizeof.FLOAT, cudaMemcpyDeviceToHost); System.out.println(Arrays.toString(hostData)); curandDestroyGenerator(generator); cudaFree(deviceData); ... <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f GPU \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435.<\/p>\n<p>  \u0412 JCuda \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0439 CUDA \u043a\u043e\u0434 \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0438\u0437 Java \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e JAR \u0444\u0430\u0439\u043b\u0430 \u0432 \u0432\u0430\u0448\u0435\u043c classpath. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e JCuda \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<h3>\u041e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u0448\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/h3>\n<p>  \u042d\u0442\u043e \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u0442\u0443\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e. \u0415\u0441\u0442\u044c \u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GPU \u0445\u043e\u0442\u044f \u0431\u044b \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e? <\/p>\n<p>  \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e \u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 OpenCL, CUDA, \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439? \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 Java \u0438 \u043d\u0435 \u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u043c? Aparapi \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c. Aparapi \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u00ab\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c API\u00bb. \u042f \u0434\u0443\u043c\u0430\u044e \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u0430\u043a \u043e\u0431 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0447\u0430\u0441\u0442\u0438 Hibernate \u0434\u043b\u044f GPU \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 OpenCL \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432.<\/p>\n<pre><code class=\"java\">public static void main(String[] _args) {     final int size = 512;     final float[] a = new float[size];     final float[] b = new float[size];      \/* fill the arrays with random values *\/     for (int i = 0; i &lt; size; i++){         a[i] = (float) (Math.random() * 100);         b[i] = (float) (Math.random() * 100);     }     final float[] sum = new float[size];      Kernel kernel = new Kernel(){         @Override public void run() { I           int gid = getGlobalId();             sum[gid] = a[gid] + b[gid];         }     };      kernel.execute(Range.create(size));     for(int i = 0; i &lt; size; i++) {         System.out.printf(&quot;%6.2f + %6.2f = %8.2f\\n&quot;, a[i], b[i], sum[i])     }     kernel.dispose(); } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0447\u0438\u0441\u0442\u044b\u0439 Java \u043a\u043e\u0434 (\u0432\u0437\u044f\u0442\u044b\u0439 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Aparapi), \u0442\u0430\u043a\u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u0438 \u0442\u0430\u043c, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u0442\u0435\u0440\u043c\u0438\u043d Kernel \u0438 getGlobalId. \u0412\u0430\u043c \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c GPU, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434 GPGPU \u0432 \u0431\u043e\u043b\u0435\u0435 \u0431\u043b\u0438\u0437\u043a\u043e\u0439 \u043a Java \u043c\u0430\u043d\u0435\u0440\u0435. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, Aparapi \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e OpenGL \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043a \u0441\u043b\u043e\u044e OpenCL \u2013 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 \u2014 \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 Aparapi. \u0422\u0430\u043c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u0434\u043e\u0431\u0430\u0432\u043e\u043a, \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c TornadoVM \u2014 \u043e\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u0437 CPU \u0432 GPU, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043c\u0430\u0441\u0441\u043e\u0432\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>  \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0433\u0434\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043d\u043e \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u044f. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, Java \u0438 GPU \u043c\u043e\u0433\u0443\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u043b\u0438\u043a\u0438\u0435 \u0434\u0435\u043b\u0430 \u0432\u043c\u0435\u0441\u0442\u0435. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0441\u043d\u0443\u043b\u0441\u044f \u044d\u0442\u043e\u0439 \u043e\u0431\u0448\u0438\u0440\u043d\u043e\u0439 \u0442\u0435\u043c\u044b. \u042f \u043d\u0430\u043c\u0435\u0440\u0435\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0438 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443 \u0438\u0437 Java. \u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  <a href=\"https:\/\/blogs.oracle.com\/javamagazine\/programming-the-gpu-in-java\" rel=\"nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/500106\/\"> https:\/\/habr.com\/ru\/post\/500106\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500106\/\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a GPU \u0438\u0437 Java \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043c\u043e\u0449\u044c. \u0417\u0434\u0435\u0441\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a GPU \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 Java.<\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (GPU) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c \u043c\u0438\u0440\u043e\u043c \u0434\u043b\u044f Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432. \u042d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f Java \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f GPU. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, GPU \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0442\u0435\u0440\u0430\u0444\u043b\u043e\u043f\u0441\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043f\u0438\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c, \u044f \u043f\u043e\u0442\u0440\u0430\u0447\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 GPU \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0436\u0435\u043b\u0435\u0437\u0430.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f GPU \u043e\u0442 CPU \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GPU \u0432 \u043c\u0438\u0440\u0435 Java. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u044f \u043e\u043f\u0438\u0448\u0443 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 Java \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0445 \u043d\u0430 GPU, \u0438 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-302914","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302914"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302914\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302914"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302914"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}