Is it possible to program GPU in pure Haskell?

1.1k Views Asked by At

I wonder, whether I can write code, which ought to be evaluated by GPU, in pure Haskell.

For example, a function for multiplication of two large matrices in GPU have (theoretically) no side effects, therefore it might be possible to call it from pure Haskell function.

But I am also worried, whether something don't get broken, if I just wrap CUDA C++ procedures to Haskell via FFI as pure functions. As I understand from the documentation, I must be sure, that there are no side effects and I am not sure at all.

So my questions are:

  1. Is there something, what might break, if I wrap C++ CUDA function to Haskell as a pure function?
  2. Is there some library, which enables me to use just pure Haskell to program GPU without usage of Haskell FFI?
  3. If not, is it theoretically possible to make one?

Thanks.

0

There are 0 best solutions below