Cloo kernel execution

2010-04-15
2012-12-21
  • Douglas Andrade

    Douglas Andrade - 2010-04-15

    Hello.
    I think ComputeKernel should have an option to add an array or list of arguments at once.
    In my opinion, it would also be more intuitive if Kernels had an Execute method that would check if all arguments have been set and call the Kernel the user wants.
    Same thing for variables, I think they could have a method to Write to and Read from Device.

    May I join the project and make these changes to the code?

    I am sometimes using Cloo to make my OpenCL tutorial, too. I will try to create code with the Template I made and also OpenCL for sample code.

    Regards

    Douglas - douglas@cmsoft.com.br

     
  • nythrix

    nythrix - 2010-04-15

    Hi and welcome to the forums.

    I've read those proposals and I have some issues:

    I think ComputeKernel should have an option to add an array or list of arguments at once.
    This sounds good. But how would you enforce type safety? The current implementation relies on type info in order to keep the arguments out of the GC reach until the kernel has been queued for execution.
    Can you elaborate more on this idea, please?

    In my opinion, it would also be more intuitive if Kernels had an Execute method that would check if all arguments have been set and call the Kernel the user wants. Same thing for variables, I think they could have a method to Write to and Read from Device.
    This is done through a command queue which is an abstraction of a processor. If you declare more of them you can chain operations, build dependency graphs and achieve task parallelism (i.e. reading data/executing a kernel at the same time). I'm afraid your proposal would differ a lot from this current mode of operation which directly reflects the OpenCL mechanism. Closely following that mechanism while staying .NET friendly is a design goal of this project. Unless I missunderstood you, this is definitely not a good idea.
    Sidenote: giving people more than one way of doing things usually leads to confusion (insert OpenGL 2.1 specification here :)

    I'm not prepared to take other devs on board yet. Cloo now provides full OpenCL 1.0 functionality so bug fixing aside, there's not much going on.

    All that said, feel free to hack on Cloo at will. The license is as permissive as it gets ;)

     
  • nythrix

    nythrix - 2010-04-15

    Darn, I forgot commenting on kernel argument checks.
    OpenCL already checks this. If you don't set all the arguments an InvalidKernelArgumentsComputeException is thrown, when the kernel is executed.

     

Log in to post a comment.