Hi,
this is a very interesting topic! I did some work on translating F# code to GPU code some time ago and I'd be very interested in sharing my experiences with you. I have a very simple example that translates selected F# quotations to HLSL, but unfortunatelly it relies on a component that executes the HLSL that I cannot publish :-(. Can you drop me an email at tomas@tomasp.net, so I can send you what I've got (it's really just a trivial demo, but it should help you finding a good way)?

Regarding your question - yes you can re-use same code on GPU and CPU. The way is to use ReflectedDefinition attribute. If you mark a function with it, you can use it as an ordinary compiled function in your code and also access its quotation at runtime. Some more info about this feature can be found here: [link:tomasp.net] and [link:tomasp.net].

BTW: I'll be away during the next week, so I won't reply until then, but I'd love to share my experiences with you!

Thanks,
T.

By on 8/16/2008 5:35 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper