Giter VIP home page Giter VIP logo

remotecl's People

Contributors

silverclaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

remotecl's Issues

Simplify client-side object ID

The client-side Object IDs are tracked on an std::map (connection.h) but the attached documentation mentions that it is a vector.
The keying to a std::map of the object ID is probably not required since the object itself tracks its own ID, which as the documentation states is an index into the "vector" (IDs are monotonically increasing, assigned by the server).
Originally this might have been intended for ID reuse.

Implement clSetEventCallback for OpenCV

clSetEventCallback is the last call that has to be implemented for basic OpenCV acceleration to work. So far, most if not all communication looks like this:

Request: Client --> Server
Response: Server --> Client

For async event callback firing, it may make sense to open a second transport channel (TCP) where the server notifies the client in case an event is triggered (for a previously registered callback). The client can maintain a list of registered callbacks and forward unique callback IDs to the server along with the event IDs. The server will then send that callback ID so the client knows which callback to call.

Quick workaround (blocking event):

diff --git a/client/event.cpp b/client/event.cpp
index 296618d..87fe17a 100644
--- a/client/event.cpp
+++ b/client/event.cpp
@@ -166,6 +166,22 @@ clGetEventProfilingInfo(cl_event event, cl_profiling_info param_name,
        }
 }
 
+SO_EXPORT CL_API_ENTRY cl_int CL_API_CALL
+clSetEventCallback(cl_event event, cl_int command_exec_callback_type,
+                   void (CL_CALLBACK *pfn_event_notify) (cl_event event,
+                                                         cl_int event_command_exec_status,
+                                                         void *user_data),
+                   void *user_data) CL_API_SUFFIX__VERSION_1_0
+{
+       if (event == nullptr) return CL_INVALID_VALUE;
+
+       cl_event event_list[] = { event };
+       cl_int ret = clWaitForEvents(1, event_list);
+       pfn_event_notify(event, ret, user_data);
+
+       return ret;
+}
+
 SO_EXPORT CL_API_ENTRY cl_int CL_API_CALL
 clWaitForEvents(cl_uint num_events, const cl_event* event_list) CL_API_SUFFIX__VERSION_1_0
 {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.