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;
template<typename Ret, typename... Args>
class actor_facade<Ret(Args...)> : public actor {
friend class command_impl<actor_facade, Ret>;
friend class command<actor_facade, Ret>;
public:
......@@ -159,10 +159,10 @@ class actor_facade<Ret(Args...)> : public actor {
add_arguments_to_kernel<Ret>(arguments,
ret_size,
get_ref<Is>(*opt)...);
auto cmd = make_counted<command_impl<actor_facade, Ret>>(handle,
this,
std::move(arguments),
m_queue);
auto cmd = make_counted<command<actor_facade, Ret>>(handle,
this,
std::move(arguments),
m_queue);
cmd->enqueue();
}
else { CPPA_LOGMF(CPPA_ERROR, this, "actor_facade::enqueue() tuple_cast failed."); }
......
......@@ -46,32 +46,15 @@
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>
class command_impl : public command {
class command : public ref_counted {
public:
command_impl(response_handle handle,
intrusive_ptr<T> actor_facade,
std::vector<mem_ptr> arguments,
command_queue_ptr queue)
command(response_handle handle,
intrusive_ptr<T> actor_facade,
std::vector<mem_ptr> arguments,
command_queue_ptr queue)
: m_number_of_values(std::accumulate(actor_facade->m_global_dimensions.begin(),
actor_facade->m_global_dimensions.end(),
1, std::multiplies<size_t>{}))
......@@ -80,7 +63,7 @@ class command_impl : public command {
, m_queue(queue)
, m_arguments(move(arguments)) { }
void enqueue () override {
void enqueue () {
CPPA_LOG_TRACE("command::enqueue()");
this->ref(); // reference held by the OpenCL comand queue
cl_int err{0};
......@@ -106,7 +89,7 @@ class command_impl : public command {
err = clSetEventCallback(event,
CL_COMPLETE,
[](cl_event, cl_int, void* data) {
auto cmd = reinterpret_cast<command_impl*>(data);
auto cmd = reinterpret_cast<command*>(data);
cmd->handle_results();
cmd->deref();
},
......@@ -151,8 +134,6 @@ class command_impl : public command {
}
};
typedef intrusive_ptr<command> command_ptr;
} } // namespace cppa::opencl
#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