nythrix's picture

Cloo 0.9.alpha2

The second 0.9 preview is out.
The major feature is a whole new set of OpenCL object handles, which can be used with the redesigned bindings. This final major change is the result of the efforts aiming at bringing the low level part of the library up to par with the rest of the code. So, if you wanted a basic set of fast, type safe and still very friendly OpenCL bindings that completely bypasses the object oriented layer, you're finally served!
As for some bad news, in order to take advantage of the new handle types the ComputeObject handles now use them as well. Which means you'll have to upgrade your code if you were working directly with handles in previous versions. However, it is unlikely that this will affect many applications (if any).
Some other, but much smaller changes have shaped the new interface as well (acquiring and releasing OpenGL objects, ReadFromBuffer methods). As always checking the Changelog in the documentation folder is heartily recommended.
This was the last set of the planned features for Cloo. So, what you see here is basically what Cloo 1.0 will look like!
Stay tuned!


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kwaegel's picture

[clap clap clap!]

Looks nice. I approve!

I should mention one discrepancy I found in the documentation. In the ComputeContext docs, it directs us to use the following code to create a shared context:

IntPtr deviceContextHandle = wglGetCurrentDC();
ComputePlatform platform = ComputePlatform.GetByName(nameOfPlatformCapableOfCLGLInterop);
ComputeContextProperty p1 = new ComputeContextProperty(ComputeContextPropertyName.Platform, platform.Handle);
ComputeContextProperty p2 = new ComputeContextProperty(ComputeContextPropertyName.CL_GL_CONTEXT_KHR, openGLContextHandle);
ComputeContextProperty p3 = new ComputeContextProperty(ComputeContextPropertyName.CL_WGL_HDC_KHR, deviceContextHandle);
ComputeContextPropertyList cpl = new ComputeContextPropertyList(new ComputeContextProperty[] { p1, p2, p3 });
ComputeContext context = new ComputeContext(ComputeDeviceTypes.Gpu, cpl, null, IntPtr.Zero);

However, line 3 in the above code does not work. ComputeContextProperty takes a intPtr, not a CLPlatformHandle. To get a working shared context, I need to use "platform.Handle.Value".

nythrix's picture

Well, the compiler can't catch everything. Fixed now, thanks :)