Re: [Haskell-cafe] Data.Array.Accelerate initialization timings

2012-02-22 Thread Martin Dybdal
On 20 February 2012 16:39, Paul Sujkov  wrote:
> Ah, it seems that I see now what's going wrong way. I'm not using the 'run'
> function from the CUDA backend, and so by default I guess the code is
> interpreted (the test backend used for semantics check). However, it's not
> perfectly clear how to use CUDA backend explicitly.

Neither the interpreter or the CUDA code are used in your example.
Everything in Data.Array.Accelerate are front-end stuff, your arrays
are allocated on the host, so it is here there is an inefficiency.

The "use" method inserts a statement in the syntax tree generated by
the front-end, which the back-end can use as a hint to transfer that
array to the GPU, while compiling the rest of the program into CUDA
code. The Data.Array.Accelerate.CUDA.run function is the one that
actually moves the arrays to the GPU.

I haven't tried executing your code and I'm not sure why the front-end
is that slow.

-- 
Martin Dybdal

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: OpenCL 1.0.1.3 package

2011-10-21 Thread Martin Dybdal
On 17 October 2011 22:47, Judah Jacobson  wrote:
> On Mon, Oct 17, 2011 at 2:56 AM, Luis Cabellos  
> wrote:
>>
>> Other issues to solve,
>> How to compile in hackage server to generate documentation online?
>> opencl.h isn't in the server so I getting errors.
>>
>
> In my experience, the nicest way to work around this problem is to
> just generate the documentation manually and host it somewhere off of
> Hackage.  http://community.haskell.org/admin/ is a decent place to
> host something like this; you end up with a URL
> http://projects.haskell.org/yourproject which you can link to from the
> .cabal file description.

That is an acceptable solution. The documentation of hopencl is now
hosted at http://projects.haskell.org/hopencl/

Thanks for the pointer.

-- 
Martin Dybdal

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: OpenCL 1.0.1.3 package

2011-10-19 Thread Martin Dybdal
On 17 October 2011 11:56, Luis Cabellos  wrote:
>> My own library is available at https://github.com/HIPERFIT/hopencl and
>> will be released on hackage very soon (next week probably). Please
>> take a look at it. It is currently tested on x86_64 Linux with both
>> the AMD x86/x86_64 bindings and NVIDIAs CUDA bindings. They will
>> probably not work on Windows in their present state, and I don't have
>> access to a Windows machine to test it on.
>
> As Jason Dagit say, I put the stdcall call convention option in OpenCL
> for windows:
> https://github.com/zhensydow/opencl/blob/master/OpenCL.cabal

Thanks. I have implemented the same thing in my library now. I would
be happy if someone could test that it compiles, and the unit tests
runs on a Windows installation.

-- 
Martin Dybdal

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: OpenCL 1.0.1.3 package

2011-10-17 Thread Martin Dybdal
On 17 October 2011 11:56, Luis Cabellos  wrote:
> On Thu, Oct 13, 2011 at 9:13 PM, Martin Dybdal  wrote:
>> My own library is available at https://github.com/HIPERFIT/hopencl and
>> will be released on hackage very soon (next week probably). Please
>> take a look at it. It is currently tested on x86_64 Linux with both
>> the AMD x86/x86_64 bindings and NVIDIAs CUDA bindings. They will
>> probably not work on Windows in their present state, and I don't have
>> access to a Windows machine to test it on.
>
> As Jason Dagit say, I put the stdcall call convention option in OpenCL
> for windows:
> https://github.com/zhensydow/opencl/blob/master/OpenCL.cabal
>
> Other issues to solve,
> How to compile in hackage server to generate documentation online?
> opencl.h isn't in the server so I getting errors.

For now I have bundled the OpenCL header files with my package. That
is not the right way either, as the header files can contain some
platform specific information, for instance information about the
calling conventions, which would be a way to handle the problem above
(and the only way possible with c2hs, as far as I know).

-- 
Martin Dybdal

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: OpenCL 1.0.1.3 package

2011-10-13 Thread Martin Dybdal
On 3 October 2011 12:56, Luis Cabellos  wrote:
> Hello, all.
> I want to show you the OpenCL package. I have done this using Jeff Heard
> OpenCLRaw package, but I create a new one due the lack of updates of the
> former.
> # Where to get it
> * Hackage page (http://hackage.haskell.org/package/OpenCL)
> * Repository (https://github.com/zhensydow/opencl)
> * Bugs (https://github.com/zhensydow/opencl/issues)
> * Examples (https://github.com/zhensydow/opencl/tree/master/examples).
> # Things:
> * I write it's high-level binding to OpenCL libraries, but only because I
> added more types to hide most of the alloc/free of the API, and hide the
> enums using c2hs enums.
> * The worst problem of the OpenCLRaw is the bad types it use, I learn to fix
> 32/64 bits issues with c2hs, and test it on linux machines.
> * Tested on Linux + NVidia only.
> * Jason Dagit is helping with Windows, OSX testing in own fork, also the
> call-conv fork in github has changes to work on Windows
> Please, Consider it's on experimental status but it works, I need lots of
> feedbacks for detect posible errors,
> Thanks,

Hi everyone

I just found this thread today, as I don't read Haskell-cafe that
often (too bad, I know). I have been working on a set of OpenCL
bindings for the last months myself, which I'm using to implement an
OpenCL backend to the Data.Array.Accelerate library. The work is done
at the HIPERFIT research center, Uni. Copenhagen.

My bindings are even further from the naming conventions of the OpenCL
library, but I really can't see the problem with that. People which
are used to programming OpenCL from C/C++ might have to learn how the
naming conventions of the Haskell library are, but they only need to
do this once. When the mapping between the old and the new naming
conventions are learned, they will benefit from having a more clean
interface for all future times. (No Haskell hacker should have a
problem with a steep learning curve.)

It is somewhat troubling that we now have five different interfaces to
OpenCL (that I know of), and I think we should join efforts and make
one library that is as stable as possible. The five libraries are:

 * OpenCL
 * OpenCLRaw
 * HsOpenCL
 * hopencl
 * The library presented by Benedict Gaster at AMD (yet to be released)
  ( 
http://developer.amd.com/zones/OpenCLZone/publications/assets/MakingOpenCLSimplewithHaskell.pdf
)

My own library is available at https://github.com/HIPERFIT/hopencl and
will be released on hackage very soon (next week probably). Please
take a look at it. It is currently tested on x86_64 Linux with both
the AMD x86/x86_64 bindings and NVIDIAs CUDA bindings. They will
probably not work on Windows in their present state, and I don't have
access to a Windows machine to test it on.

-- 
Martin Dybdal

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe