OpenCL, OpenGL, and NURBS

>> Sunday, January 29, 2012

I'm making progress coding an application to evaluate non-uniform rational B-splines (NURBS) on the GPU using OpenCL-OpenGL interoperability. NURBS processing is one of the most computationally-intensive tasks of modern CAD tools and the theory isn't easy, but my main problem is code complexity: the application uses Qt, OpenCL, and OpenGL, but because the three APIs are so different, I can only keep two of the three in mind at any time.

My goal is to develop an open-source solid modeling tool with greater capability and better performance than ACIS or Parasolid. I know there's a lot of disagreement regarding OpenGL vs. Direct3D, but once people see the power of combining OpenGL and OpenCL, I think they'll be stunned.


News in Brief

>> Monday, January 23, 2012

  • I've found new resources for OpenGL programmers. OGLplus provides a header file that makes it possible to code OpenGL applications with C++ functions. Megabyte Softworks has released a tutorial for OpenGL 3.3 here and Durian software has a tutorial here. As before, Jason McKesson's magnficent tutorial is here.
  • AMD has recently released version 2.6 of its SDK, which can be obtained here.
  • In addition to OpenCL support, ARM will provide an open-source, reverse-engineered graphics driver for its upcoming Mali GPU. The Phoronix article is here.
  • AMD has decided to change the name of its Fusion architecture to the Heterogeneous Systems Architecture. I couldn't find a press release on the AMD site, but the brief mention at is here.


Humble Pie

>> Friday, January 6, 2012

A few weeks ago, I had a great idea: write OpenCL code to test prime numbers and execute it on Amazon's GPGPU platform, which provides high-performance computing at low cost. Once I found the first prime with 100,000 digits, I'd win the EFF computing award and all the trappings of victory.

Rather than search for Mersenne primes with the Lucas-Lehmer test, I planned to test regular numbers with the new AKS method. I'd start with 10100000+1 and continue on from there.

But as I read more about testing primes, I became interested in the underlying theory. I wanted to understand topics like congruence relations and the Prime Number Theorem. And why not? I loved writing the chapters on matrix operations and the FFT. How hard could number theory be?

Very hard, it turns out. I've spent days squinting at proofs of the Prime Number Theorem, and I'm still baffled. I could hold this book upside-down and understand the material just as well. There's nothing elegant or intuitive about number theory, especially when it involves integration on the complex plane.

So I'm giving up. I'm going back to evaluating NURBS with OpenCL-OpenGL interoperability. I don't want to read about zeta functions or Dirichlet series or the Abel summation formula ever again.

To those interested in implementing the AKS algorithm, here's a word of warning. At its theoretical best, the AKS algorithm requires O(log3n) operations. If your system executes 1 TFLOPs/s, you can test a 100k-digit number in 1000 seconds, or about seventeen minutes. Not bad.

The problem is that, according to the Prime Number Theorem, the density of prime numbers near N is about ln(N). For N = 10100000, you can expect to find one prime per 230,258 numbers. Taking away even values, a 1 TFLOPs/s system will require about four years.

Personally, I have better things to do with my time.


  © Blogger template Werd by 2009

Back to TOP