cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

LeeHowes
Staff
Staff

Re: Alternate C++ wrapper for Platform/Runtime layers?

If you want to report bugs/suggestions you are welcome to go to bugzilla at Khronos if it's something important.

https://www.khronos.org/bugzilla/

I think it's public registration. Obviously don't overdo it. You are always welcome to post here as well as we maintain it.

I looked at your query about build. There is:

cl_int build( const char* options = NULL, void (CL_CALLBACK *notifyFptr)(cl_program, void*) = NULL, void *data = NULL );

Which calls ::clBuildProgram with a null device list. That should do exactly what you want shouldn't it? The arguments are all optional... so calling build() should be fine.

craft_coder
Adept II

Re: Alternate C++ wrapper for Platform/Runtime layers?

What about extensions to the C API?

I'd really like a way to cancel events.  From an implementation perspective, this would only be advisory.  It's something users (e.g. of interactive programs) could use, once the results of some in-flight computation have been invalidated.  The benefit would be to free up device resources ASAP, so that processing of new data could start sooner.

It would also be useful to have a function like clWaitForEvents() that waits until any of the specified events completes (or a timeout expires).  I'm thinking of something along the lines of select() or epoll().  This is useful for 3 reasons:

  1. It enables the waiting thread to be interrupted by a user event, possibly signalling the arrival of new data to be processed.
  2. It allows multiple kernels to be multiplexed by a smaller number of host threads.  This could reduce context switching overhead on the host & possibly improve the host CPU cache hit rate if the host CPU is communicating data between said kernels.
  3. It allows time-based events to be multiplexed with processing.  This could be useful for things like snapshotting, initiating some periodic computations or updates, and integration with other components of a system that may rely on polling (e.g. GUI refreshes).
0 Likes
d_a_a_
Adept II

Re: Alternate C++ wrapper for Platform/Runtime layers?

Hi LeeHowes,

Sorry, I didn't see your reply (I though I would receive a reply notification via e-mail).

LeeHowes wrote:

I looked at your query about build. There is:

cl_int build( const char* options = NULL, void (CL_CALLBACK *notifyFptr)(cl_program, void*) = NULL, void *data = NULL );

Which calls ::clBuildProgram with a null device list. That should do exactly what you want shouldn't it? The arguments are all optional... so calling build() should be fine.

This is exactly what I want, thank you for pointing this out. I had an older cl.hpp header that didn't have this overloaded "build()".

Best regards.

0 Likes