On Thu, Mar 21, 2013 at 11:23:39AM +0200, Pekka Jääskeläinen wrote: > Good job! That didn't take long. Shall we try to get it merged > to pocl trunk so there's something to build on? Similar to cellspu which > is experimental, but serves as a starting point. > > Can you clean it up a bit, push your branch to launchpad, > and send a merge request?
Thanks for the motivation! I will prepare a proper patch. Before the merge, there are a few issues I would like to address. * Error handling in device backends The GPU devices need a way to gracefully return after an error, since any device operation may fail. Maybe each device function could return an error code to the frontend using a return value (for void functions) or an extra pointer parameter (for non-void functions)? Graceful error handling would be quite important for me, since this allows the host program to gracefully exit, e.g., showing a stack trace pointing to the failed OpenCL call in a Lua/LuaJIT program. * Build from source to binary in clBuildProgram Part of the kernel build is currently handled upon first call of a device's run function. What would be needed to have the complete build finished after clBuildProgram returns? For the cuda device, pocl_cuda_build_program() would transform the LLVM bitcode to PTX assembly, and transform the PTX assembly to native GPU code using cuModuleLoad. Both steps may fail with an error, which is returned to the host from clBuildProgram. * Kernel function For the cuda device, clCreateKernel(s) should trigger the call(s) to cuModuleGetFunction, and return an error if the function name is invalid. To implement clCreateKernelsInProgram, is it possible to use the output of scripts/pocl-kernel to get a list of function names? * Map buffer flags pocl_cuda_map_mem and pocl_cuda_unmap_mem need to access the mapping flags (READ|WRITE), to decide whether the buffer needs to be copied between device and host after allocation / before freeing. Peter ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ pocl-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pocl-devel
