octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New package


From: Guillermo Moliní
Subject: Re: New package
Date: Tue, 22 Jul 2014 15:23:34 +0200




2014-07-22 13:41 GMT+02:00 c. <address@hidden>:

On 22 Jul 2014, at 13:27, Guillermo Moliní <address@hidden> wrote:

> How is it best to send the code for approval? Should I just upload here the .tar.gz so people will be able to have a look at it?

you coulduse either the patch tracker on savannah:
https://savannah.gnu.org/patch/?group=octave

or maybe try agora:
http://agora.octave.org/

> Another thing is, Ive only managed to get it to work on windows. On linux it doesnt seem to be copying the /bin folder, and therefore when the mkoctfile tries to find the library there it doesnt work. Do you have any idea why that could happen? Why is the /bin folder copied in windows but not in linux?
no idea, but maybe we can help you find out by looking at the code.

BTW, it would help if you could explain what explain what your package is meant for and who you expect the audience to be.

Oh yes, of course. I want to create a package that makes possible the use of GPU parallel computing (using cuda) using direcly octave variables. Im going to upload the .tar.gz direcly to agora then :)

The process of use would be:
1. Compile outside octave your cuda code into a .ptx (Lets call it example.ptx, and the kernel function, funcExample)

In Octave:
1. Create a cuda context 
   ctxt = createCudaContext()

2. Load Cuda Module
  cuModule = loadCudaModule("example.ptx")

3. Load Cuda Kernel
  cuKernel= loadCudaKernel("funcExample", cuModule, ctxt)

4. Set grid and block dimensions. (x, y and z depend on the problem)
  cuKernel = setGridDimensions(cuKernel,[x, y, z]);
  cuKernel = setBlockDimensions(cuKernel, [x, y,z]) ;

5. Create cuda variables and fill them with values from octave.
  cudaVariable = createGPUArray(dimension)
  cudaVariable = copyToDevice(cudaVariable, octaveVariable)

6. Run Kernel (params being the parameters of the funcExample function)
  runCudaKernel(cuKernel, params)

7. If desired copy the results back to octave
  octaveVariable = copyToHost(cudaVariable)

8. Free GPU Memory (as it is persistent)
  freeGPUArray(cudaVariable)

Im sure it still has lots of bugs and that there is still work to do before i can release a proper package. (first of all it being that i havent been able to make it work on linux yet) But that process works on windows (with a simple program). I do hope that the community finds useful to be able to use GPUs. Id like to add in the future support for OpenCL too, but Ive started with cuda because Im more comfortable with it.


c.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]