installing on PS3..
I may write about CL_DEVICE_ACCELERATOR
local mem type
get bin info
build from binaries
extensions
samples
perf
I may write about CL_DEVICE_ACCELERATOR
local mem type
get bin info
build from binaries
extensions
samples
perf
vec2 dblsgl_add (vec2 x, vec2 y)This two functions add and multiply two values (one using .xy and other .zw)..
{
vec2 z;
float t1, t2, e;
t1 = x.y + y.y;
e = t1 - x.y;
t2 = ((y.y - e) + (x.y - (t1 - e))) + x.x + y.x;
z.y = e = t1 + t2;
z.x = t2 - (e - t1);
return z;
}
vec2 dblsgl_mul (vec2 x, vec2 y)
{
vec2 z;
float up, vp, u1, u2, v1, v2, mh, ml;
up = x.y * 4097.0;
u1 = (x.y - up) + up;
u2 = x.y - u1;
vp = y.y * 4097.0;
v1 = (y.y - vp) + vp;
v2 = y.y - v1;
//mh = __fmul_rn(x.y,y.y);
mh = x.y*y.y;
ml = (((u1 * v1 - mh) + u1 * v2) + u2 * v1) + u2 * v2;
//ml = (fmul_rn(x.y,y.x) + __fmul_rn(x.x,y.y)) + ml;
ml = (x.y*y.x + x.x*y.y) + ml;
mh=mh;
z.y = up = mh + ml;
z.x = (mh - up) + ml;
return z;
}
"This extension enables efficient image data transfer between imageNote this is multiOS (linux and windows) and that you can expose also rectangles subregions to copy via CopyImageSubDataNV..
objects (i.e. textures and renderbuffers) without the need to bind
the objects or otherwise configure the rendering pipeline. The
WGL and GLX versions allow copying between images in different
contexts, even if those contexts are in different sharelists or
even on different physical devices."
This extension relaxes the restrictions on rendering to a currently"
bound texture and provides a mechanism to avoid read-after-write
hazards
Another application is to render-to-texture algorithms that ping-pong
between two textures, using the result of one rendering pass as the input
to the next. Existing mechanisms require expensive FBO Binds, DrawBuffer
changes, or FBO attachment changes to safely swap the render target and
texture. With texture barriers, layered geometry shader rendering, and
texture arrays, an application can very cheaply ping-pong between two
layers of a single texture. i.e.
X = 0;
// Bind the array texture to a texture unit
// Attach the array texture to an FBO using FramebufferTexture3D
while (!done) {
// Stuff X in a constant, vertex attrib, etc.
Draw -
Texturing from layer X;
Writing gl_Layer = 1 - X in the geometry shader;
TextureBarrierNV();
X = 1 - X;
}
However, be warned that this requires geometry shaders and hence adds
the overhead that all geometry must pass through an additional program
stage, so an application using large amounts of geometry could become
geometry-limited or more shader-limited.
if(bUseOpenGLContext)
{
printf(SEPARATOR);
printf("Compute Engine: Using active OpenGL context...\n");
CGLContextObj kCGLContext = CGLGetCurrentContext();
CGLShareGroupObj kCGLShareGroup = CGLGetShareGroup(kCGLContext);
cl_context_properties akProperties[] = {
CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE,
(cl_context_properties)kCGLShareGroup, 0
};
// Create a context from a CGL share group
//
m_kContext = clCreateContext(akProperties, 0, 0, clLogMessagesToStdoutAPPLE, 0, 0);
}
else
{
uint uiAvailableDeviceCount = 0;
iError = clGetDeviceIDs(NULL, kRequestedDeviceType, uiCount, akAvailableDeviceIds, &uiAvailableDeviceCount);
if (iError != CL_SUCCESS)
{
printf("Error: Failed to locate compute device!\n");
return false;
}
m_kContext = clCreateContext(0, uiAvailableDeviceCount, akAvailableDeviceIds, NULL, NULL, &iError);
}
(windows)
cl_context_properties akProperties[] = {
CL_GL_CONTEXT_KHR,
HGLRC handle,
CL_WGL_HDC_KHR,
(cl_context_properties)HDC handle, 0
};
(linux)
cl_context_properties akProperties[] = {
CL_GL_CONTEXT_KHR,
GLXContext handle,
CL_WGL_HDC_KHR,
(cl_context_properties)Display handle, 0
};
(windows&linux)
m_kContext = clCreateContext(akProperties, 0, 0, 0, 0, 0);