Commit 1c4e4072 authored by Joseph Noir's avatar Joseph Noir

removed unused class (command_dummy)

removed command_dummy, renamed command_impl to command
parent 8d91ddb7
...@@ -65,7 +65,7 @@ class actor_facade; ...@@ -65,7 +65,7 @@ class actor_facade;
template<typename Ret, typename... Args> template<typename Ret, typename... Args>
class actor_facade<Ret(Args...)> : public actor { class actor_facade<Ret(Args...)> : public actor {
friend class command_impl<actor_facade, Ret>; friend class command<actor_facade, Ret>;
public: public:
...@@ -159,7 +159,7 @@ class actor_facade<Ret(Args...)> : public actor { ...@@ -159,7 +159,7 @@ class actor_facade<Ret(Args...)> : public actor {
add_arguments_to_kernel<Ret>(arguments, add_arguments_to_kernel<Ret>(arguments,
ret_size, ret_size,
get_ref<Is>(*opt)...); get_ref<Is>(*opt)...);
auto cmd = make_counted<command_impl<actor_facade, Ret>>(handle, auto cmd = make_counted<command<actor_facade, Ret>>(handle,
this, this,
std::move(arguments), std::move(arguments),
m_queue); m_queue);
......
...@@ -46,29 +46,12 @@ ...@@ -46,29 +46,12 @@
namespace cppa { namespace opencl { namespace cppa { namespace opencl {
class command : public ref_counted {
public:
command* next;
virtual void enqueue() = 0;
};
class command_dummy : public command {
public:
void enqueue() override { }
};
template<typename T, typename R> template<typename T, typename R>
class command_impl : public command { class command : public ref_counted {
public: public:
command_impl(response_handle handle, command(response_handle handle,
intrusive_ptr<T> actor_facade, intrusive_ptr<T> actor_facade,
std::vector<mem_ptr> arguments, std::vector<mem_ptr> arguments,
command_queue_ptr queue) command_queue_ptr queue)
...@@ -80,7 +63,7 @@ class command_impl : public command { ...@@ -80,7 +63,7 @@ class command_impl : public command {
, m_queue(queue) , m_queue(queue)
, m_arguments(move(arguments)) { } , m_arguments(move(arguments)) { }
void enqueue () override { void enqueue () {
CPPA_LOG_TRACE("command::enqueue()"); CPPA_LOG_TRACE("command::enqueue()");
this->ref(); // reference held by the OpenCL comand queue this->ref(); // reference held by the OpenCL comand queue
cl_int err{0}; cl_int err{0};
...@@ -106,7 +89,7 @@ class command_impl : public command { ...@@ -106,7 +89,7 @@ class command_impl : public command {
err = clSetEventCallback(event, err = clSetEventCallback(event,
CL_COMPLETE, CL_COMPLETE,
[](cl_event, cl_int, void* data) { [](cl_event, cl_int, void* data) {
auto cmd = reinterpret_cast<command_impl*>(data); auto cmd = reinterpret_cast<command*>(data);
cmd->handle_results(); cmd->handle_results();
cmd->deref(); cmd->deref();
}, },
...@@ -151,8 +134,6 @@ class command_impl : public command { ...@@ -151,8 +134,6 @@ class command_impl : public command {
} }
}; };
typedef intrusive_ptr<command> command_ptr;
} } // namespace cppa::opencl } } // namespace cppa::opencl
#endif // CPPA_OPENCL_COMMAND_HPP #endif // CPPA_OPENCL_COMMAND_HPP
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment