91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 841KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-28
  • 語言: 其他
  • 標簽: openCL??GPU??

資源簡介

openCL編程指南 隨書源代碼 openCL programming Guide code OpenCL領域公認的權威著作,由OpenCL核心設計人員親自執筆,不僅全面而深刻地解讀了OpenCL規范和編程模型,而且通過大量案例和代碼演示了基于OpenCL編寫并行程序和實現各種并行算法的原理、方法、流程和最佳實踐,以及如何對OpenCL進行性能優化,如何對硬件進行探測和調整。

資源截圖

代碼片段和文件信息

//
//?Book:??????OpenCL(R)?Programming?Guide
//?Authors:???Aaftab?Munshi?Benedict?Gaster?Timothy?Mattson?James?Fung?Dan?Ginsburg
//?ISBN-10:???0-321-74964-2
//?ISBN-13:???978-0-321-74964-2
//?Publisher:?Addison-Wesley?Professional
//?URLs:??????http://safari.informit.com/9780132488006/
//????????????http://www.openclprogrammingguide.com
//

//?GLinterop.cpp
//
//????This?is?a?simple?example?that?demonstrates?basic?OpenCL?setup?and
//????use.

#include?
#include?
#include?

#ifdef?__APPLE__
#include?
#else
#include?
#include?
#endif

#ifdef?_WIN32
#include?
#endif
#include?
#include?

#ifdef?__GNUC__
#include?
#endif

///
//?OpenGL/CL?variables?objects
//
GLuint?tex?=?0;
GLuint?vbo?=?0;
int?vbolen;?
int?imWidth?=?0;
int?imHeight?=?0;
cl_kernel?kernel?=?0;
cl_kernel?tex_kernel?=?0;
cl_mem?cl_vbo_mem?cl_tex_mem;
cl_context?context?=?0;
cl_command_queue?commandQueue?=?0;
cl_program?program?=?0;


///
//?Forward?declarations
void?Cleanup();
cl_int?computeVBO();
cl_int?computeTexture();

///
//?Render?the?vertex?buffer?object?(VBO)?contents
//
void?renderVBO(?int?vbolen?)?
{
glColor3f(1.0f?1.0f?1.0f);
glLineWidth(2.0f);
????//?Draw?VBO?containing?the?point?list?coordinates?to?place?GL_POINTS?at?feature?locations
????//?bind?VBOs?for?vertex?array?and?index?array
????glBindBufferARB(GL_ARRAY_BUFFER_ARB?vbo);?????????//?for?vertex?coordinates
????glEnableClientState(GL_VERTEX_ARRAY);?????????????//?activate?vertex?coords?array
????glVertexPointer(?2?GL_FLOAT?0?0?);
?
????//?draw?lines?with?endpoints?given?in?the?array
????glDrawArrays(GL_LINES?0?vbolen*2);

????glDisableClientState(GL_VERTEX_ARRAY);????????????//?deactivate?vertex?array

????//?bind?with?0?so?switch?back?to?normal?pointer?operation
????glBindBufferARB(GL_ARRAY_BUFFER_ARB?0);
}

///
//?Display?the?texture?in?the?window
//
void?displayTexture(int?w?int?h)
{
glEnable(GL_TEXTURE_RECTANGLE_ARB);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB?tex?);
glBegin(GL_QUADS);
glTexCoord2f(0?0);
glVertex2f(0?0);
glTexCoord2f(0?h);
glVertex2f(0?h);
glTexCoord2f(w?h);
glVertex2f(w?h);
glTexCoord2f(w?0);
glVertex2f(w?0);
glEnd();
glDisable(GL_TEXTURE_RECTANGLE_ARB);
}

void?reshape(int?width?int?height)?
{
glViewport(?0?0?width?height?);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0widthheight0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}

///
//?Main?rendering?call?for?the?scene
//
void?renderScene(void)
{
glClearColor(0.0f?0.0f?1.0f?1.0f?);
glClear(?GL_COLOR_BUFFER_BIT?);
computeTexture();
computeVBO();

displayTexture(imWidthimHeight);
renderVBO(?vbolen?);
glutSwapBuffers();
}

///
//?Keyboard?events?handler
//
void?KeyboardGL(unsigned?char?key?int?x?int?y)
{
????switch(key)?
????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-12-14?17:58??code\
?????文件?????????342??2014-12-14?17:58??code\CMakeLists.txt
?????目錄???????????0??2014-12-14?17:57??code\cmake\
?????文件????????1491??2014-12-14?17:56??code\cmake\FindDirectX.cmake
?????文件????????1768??2014-12-14?17:57??code\cmake\FindGLEW.cmake
?????文件????????3555??2014-12-14?17:57??code\cmake\FindOpenCL.cmake
?????目錄???????????0??2014-12-14?17:54??code\khronos\
?????目錄???????????0??2014-12-14?17:59??code\khronos\CL\
?????文件??????112900??2014-12-14?17:59??code\khronos\CL\cl.hpp
?????文件????????4859??2014-12-14?17:59??code\khronos\CL\cl_d3d10.h
?????目錄???????????0??2014-12-14?18:39??code\src\
?????文件?????????463??2014-12-14?18:39??code\src\CMakeLists.txt
?????目錄???????????0??2014-12-14?18:10??code\src\Chapter_10\
?????目錄???????????0??2014-12-14?18:11??code\src\Chapter_10\GLinterop\
?????文件?????????839??2014-12-14?18:10??code\src\Chapter_10\GLinterop\CMakeLists.txt
?????文件?????????733??2014-12-14?18:11??code\src\Chapter_10\GLinterop\GLinterop.cl
?????文件???????18429??2014-12-14?18:11??code\src\Chapter_10\GLinterop\GLinterop.cpp
?????目錄???????????0??2014-12-14?18:12??code\src\Chapter_11\
?????目錄???????????0??2014-12-14?18:13??code\src\Chapter_11\D3Dinterop\
?????文件?????????664??2014-12-14?18:12??code\src\Chapter_11\D3Dinterop\CMakeLists.txt
?????文件?????????668??2014-12-14?18:12??code\src\Chapter_11\D3Dinterop\D3Dinterop.cl
?????文件???????25008??2014-12-14?18:12??code\src\Chapter_11\D3Dinterop\D3Dinterop.cpp
?????文件????????1381??2014-12-14?18:13??code\src\Chapter_11\D3Dinterop\D3Dinterop.fx
?????目錄???????????0??2014-12-14?17:55??code\src\Chapter_12\
?????目錄???????????0??2014-12-14?18:14??code\src\Chapter_12\Sinewave\
?????文件?????????172??2014-12-14?18:13??code\src\Chapter_12\Sinewave\CMakeLists.txt
?????文件?????????991??2014-12-14?18:14??code\src\Chapter_12\Sinewave\sinewave.cl
?????文件???????13584??2014-12-14?18:14??code\src\Chapter_12\Sinewave\sinewave.cpp
?????目錄???????????0??2014-12-14?18:15??code\src\Chapter_12\VectorAdd\
?????文件??????????88??2014-12-14?18:14??code\src\Chapter_12\VectorAdd\CMakeLists.txt
?????文件????????4597??2014-12-14?18:15??code\src\Chapter_12\VectorAdd\vecadd.cpp
............此處省略67個文件信息

評論

共有 條評論