It was TechDays this week and I was lucky enough to be invited to speak with Don Syme and Adam Granicz. Don gave a short introduction to mailboxes/agent programming in F# and Adam gave an introduction to IntelliFactory’s WebSharper project.


My section of the talk was on using F# with Microsoft Accelerator. Accelerator is an interesting product, it allows you to take advance of the GPU of your PC. Even the most basic PCs have a specialized graphics chip and for most of the tasks you perform on your PC it just sits there doing nothing. GPU are very good at performing floating point operations on matrices, they’re specialized hardware that allow you to perform matrix operations in a highly parallel way. The DirectX runtime takes advantage of this to perform the operations need to for 3D shading. However, there are other algorithms that could benefit from being run on the GPU and Accelerator opens up the GPU for just about any algorithm that you can imagine.


The usage I demonstrated was the game of life running either on the CPU or with the calculations performed on the GPU. On my current machine this yields a 10 fold increase in execution time. It takes advantage of F# quotations system (similar to C#’s expression trees), these are used to allow you to compile an algorithm in F# to operations that the Accelerator runtime understands. This is how we can easily show an algorithm running on the CPU and then switch it to the GPU. The slides can be found here and code examples here. The example comes from Tomáš Petříček’s web site and more details can be found about in this series of articles.


I had several people come and access me for more information about Accelerator at the end of the talk. Accelerator v2 is available from Microsoft connected, here. It’s currently licensed under a restrictive MSR license that stipulates non-commercial use only. However, in stating the objectives of their project, they say “Accelerator v2 is an MSR incubation project whose goal is to validate the architecture and API approach with high quality engineering sufficient to gather real-world usage data.” It would seem to me that in order to achieve this objective they would need to have some commercial users, so maybe if you contact the team directly they would be able to get you a less restrictive license. I certainly have a project in mind for accelerator, though at this point it would be non-commercial. If you’re interested check out activity on my github account, you can probably guess what my idea is.


The slides can be found here and the code can be found here. The session was videoed, I’ll let you know as soon as it’s on line.

Update: The video can now be seen here.