• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cl_command_queue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cl_command_queue的典型用法代码示例。如果您正苦于以下问题:C++ cl_command_queue类的具体用法?C++ cl_command_queue怎么用?C++ cl_command_queue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了cl_command_queue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: clGetCommandQueueInfoFCL

	cl_int clGetCommandQueueInfoFCL (cl_command_queue command_queue,
					 cl_command_queue_info param_name,
					 size_t param_value_size,
					 void *param_value,
					 size_t *param_value_size_ret)
	{
		MSG(clGetCommandQueueInfoFCL);
		if (!FreeOCL::is_valid(command_queue))
			return CL_INVALID_COMMAND_QUEUE;

		bool bTooSmall = false;
		switch(param_name)
		{
		case CL_QUEUE_CONTEXT:		bTooSmall = SET_VAR(command_queue->context);	break;
		case CL_QUEUE_DEVICE:		bTooSmall = SET_VAR(command_queue->device);	break;
		case CL_QUEUE_REFERENCE_COUNT:	bTooSmall = SET_VAR(command_queue->get_ref_count());	break;
		case CL_QUEUE_PROPERTIES:	bTooSmall = SET_VAR(command_queue->properties);	break;
		default:
			command_queue->unlock();
			return CL_INVALID_VALUE;
		}
		command_queue->unlock();
		if (bTooSmall && param_value != NULL)
			return CL_INVALID_VALUE;

		return CL_SUCCESS;
	}
开发者ID:efocht,项目名称:freeocl,代码行数:27,代码来源:commandqueue.cpp


示例2: is_valid

	bool is_valid(cl_command_queue q)
	{
		global_mutex.lock();
		const bool r = valid_command_queues.count(q) != 0 && q->valid();
		if (r)
			q->lock();
		global_mutex.unlock();
		return r;
	}
开发者ID:Agorath,项目名称:freeocl,代码行数:9,代码来源:freeocl.cpp


示例3: clRetainCommandQueueFCL

	cl_int clRetainCommandQueueFCL (cl_command_queue command_queue)
	{
		MSG(clRetainCommandQueueFCL);
		if (!FreeOCL::is_valid(command_queue))
			return CL_INVALID_COMMAND_QUEUE;

		command_queue->retain();
		command_queue->unlock();
		return CL_SUCCESS;
	}
开发者ID:efocht,项目名称:freeocl,代码行数:10,代码来源:commandqueue.cpp


示例4: clRetainCommandQueue

cl_int
clRetainCommandQueue(cl_command_queue command_queue)
{
    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    command_queue->reference();

    return CL_SUCCESS;
}
开发者ID:grubbymits,项目名称:esdg-opencl,代码行数:10,代码来源:api_command.cpp


示例5: clSetCommandQueueProperty

cl_int
clSetCommandQueueProperty(cl_command_queue              command_queue,
                          cl_command_queue_properties   properties,
                          cl_bool                       enable,
                          cl_command_queue_properties * old_properties)
{
    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    return command_queue->setProperty(properties, enable, old_properties);
}
开发者ID:grubbymits,项目名称:esdg-opencl,代码行数:11,代码来源:api_command.cpp


示例6: clReleaseCommandQueue

cl_int
clReleaseCommandQueue(cl_command_queue command_queue)
{
    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    command_queue->flush();

    if (command_queue->dereference())
        delete command_queue;

    return CL_SUCCESS;
}
开发者ID:jakebolewski,项目名称:clover,代码行数:13,代码来源:api_command.cpp


示例7: clGetCommandQueueInfo

cl_int
clGetCommandQueueInfo(cl_command_queue      command_queue,
                      cl_command_queue_info param_name,
                      size_t                param_value_size,
                      void *                param_value,
                      size_t *              param_value_size_ret)
{
    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    return command_queue->info(param_name, param_value_size, param_value,
                               param_value_size_ret);
}
开发者ID:grubbymits,项目名称:esdg-opencl,代码行数:13,代码来源:api_command.cpp


示例8: clEnqueueNativeKernel

cl_int
clEnqueueNativeKernel(cl_command_queue  command_queue,
                      void (*user_func)(void *),
                      void *            args,
                      size_t            cb_args,
                      cl_uint           num_mem_objects,
                      const cl_mem *    mem_list,
                      const void **     args_mem_loc,
                      cl_uint           num_events_in_wait_list,
                      const cl_event *  event_wait_list,
                      cl_event *        event)
{
    cl_int rs = CL_SUCCESS;

    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    Coal::NativeKernelEvent *command = new Coal::NativeKernelEvent(
        (Coal::CommandQueue *)command_queue,
        user_func, args, cb_args, num_mem_objects,
        (const Coal::MemObject **)mem_list, args_mem_loc,
        num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
    );

    if (rs != CL_SUCCESS)
    {
        delete command;
        return rs;
    }

    return queueEvent(command_queue, command, event, false);
}
开发者ID:jakebolewski,项目名称:clover,代码行数:32,代码来源:api_enqueue.cpp


示例9: clEnqueueTask

cl_int
clEnqueueTask(cl_command_queue  command_queue,
              cl_kernel         kernel,
              cl_uint           num_events_in_wait_list,
              const cl_event *  event_wait_list,
              cl_event *        event)
{
    cl_int rs = CL_SUCCESS;

    if (!command_queue->isA(Coal::Object::T_CommandQueue))
    {
        return CL_INVALID_COMMAND_QUEUE;
    }

    Coal::TaskEvent *command = new Coal::TaskEvent(
        (Coal::CommandQueue *)command_queue,
        (Coal::Kernel *)kernel,
        num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
    );

    if (rs != CL_SUCCESS)
    {
        delete command;
        return rs;
    }

    return queueEvent(command_queue, command, event, false);
}
开发者ID:jakebolewski,项目名称:clover,代码行数:28,代码来源:api_enqueue.cpp


示例10: clEnqueueNDRangeKernel

cl_int
clEnqueueNDRangeKernel(cl_command_queue command_queue,
                       cl_kernel        kernel,
                       cl_uint          work_dim,
                       const size_t *   global_work_offset,
                       const size_t *   global_work_size,
                       const size_t *   local_work_size,
                       cl_uint          num_events_in_wait_list,
                       const cl_event * event_wait_list,
                       cl_event *       event)
{
    cl_int rs = CL_SUCCESS;

    if (!command_queue->isA(Coal::Object::T_CommandQueue))
    {
        return CL_INVALID_COMMAND_QUEUE;
    }

    Coal::KernelEvent *command = new Coal::KernelEvent(
        (Coal::CommandQueue *)command_queue,
        (Coal::Kernel *)kernel,
        work_dim, global_work_offset, global_work_size, local_work_size,
        num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
    );

    if (rs != CL_SUCCESS)
    {
        delete command;
        return rs;
    }

    return queueEvent(command_queue, command, event, false);
}
开发者ID:jakebolewski,项目名称:clover,代码行数:33,代码来源:api_enqueue.cpp


示例11: clEnqueueUnmapMemObject

cl_int
clEnqueueUnmapMemObject(cl_command_queue command_queue,
                        cl_mem           memobj,
                        void *           mapped_ptr,
                        cl_uint          num_events_in_wait_list,
                        const cl_event *  event_wait_list,
                        cl_event *        event)
{
    cl_int rs = CL_SUCCESS;

    if (!command_queue->isA(Coal::Object::T_CommandQueue))
    {
        return CL_INVALID_COMMAND_QUEUE;
    }

    Coal::UnmapBufferEvent *command = new Coal::UnmapBufferEvent(
        (Coal::CommandQueue *)command_queue,
        (Coal::MemObject *)memobj,
        mapped_ptr,
        num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
    );

    if (rs != CL_SUCCESS)
    {
        delete command;
        return rs;
    }

    return queueEvent(command_queue, command, event, false);
}
开发者ID:jakebolewski,项目名称:clover,代码行数:30,代码来源:api_enqueue.cpp


示例12: clEnqueueReadBuffer

// Enqueued Commands APIs
cl_int
clEnqueueReadBuffer(cl_command_queue    command_queue,
                    cl_mem              buffer,
                    cl_bool             blocking_read,
                    size_t              offset,
                    size_t              cb,
                    void *              ptr,
                    cl_uint             num_events_in_wait_list,
                    const cl_event *    event_wait_list,
                    cl_event *          event)
{
    cl_int rs = CL_SUCCESS;

    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    Coal::ReadBufferEvent *command = new Coal::ReadBufferEvent(
        (Coal::CommandQueue *)command_queue,
        (Coal::MemObject *)buffer,
        offset, cb, ptr,
        num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
    );

    if (rs != CL_SUCCESS)
    {
        delete command;
        return rs;
    }

    return queueEvent(command_queue, command, event, blocking_read);
}
开发者ID:jakebolewski,项目名称:clover,代码行数:32,代码来源:api_enqueue.cpp


示例13: clEnqueueWriteImage

cl_int
clEnqueueWriteImage(cl_command_queue    command_queue,
                    cl_mem              image,
                    cl_bool             blocking_write,
                    const size_t *      origin,
                    const size_t *      region,
                    size_t              row_pitch,
                    size_t              slice_pitch,
                    const void *        ptr,
                    cl_uint             num_events_in_wait_list,
                    const cl_event *    event_wait_list,
                    cl_event *          event)
{
    cl_int rs = CL_SUCCESS;

    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    Coal::WriteImageEvent *command = new Coal::WriteImageEvent(
        (Coal::CommandQueue *)command_queue,
        (Coal::Image2D *)image,
        origin, region, row_pitch, slice_pitch, (void *)ptr,
        num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
    );

    if (rs != CL_SUCCESS)
    {
        delete command;
        return rs;
    }

    return queueEvent(command_queue, command, event, blocking_write);
}
开发者ID:jakebolewski,项目名称:clover,代码行数:33,代码来源:api_enqueue.cpp


示例14: clEnqueueCopyBufferToImage

cl_int
clEnqueueCopyBufferToImage(cl_command_queue command_queue,
                           cl_mem           src_buffer,
                           cl_mem           dst_image,
                           size_t           src_offset,
                           const size_t *   dst_origin,
                           const size_t *   region,
                           cl_uint          num_events_in_wait_list,
                           const cl_event * event_wait_list,
                           cl_event *       event)
{
    cl_int rs = CL_SUCCESS;

    if (!command_queue->isA(Coal::Object::T_CommandQueue))
        return CL_INVALID_COMMAND_QUEUE;

    Coal::CopyBufferToImageEvent *command = new Coal::CopyBufferToImageEvent(
        (Coal::CommandQueue *)command_queue,
        (Coal::MemObject *)src_buffer, (Coal::Image2D *)dst_image,
        src_offset, dst_origin, region,
        num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
    );

    if (rs != CL_SUCCESS)
    {
        delete command;
        return rs;
    }

    return queueEvent(command_queue, command, event, false);
}
开发者ID:jakebolewski,项目名称:clover,代码行数:31,代码来源:api_enqueue.cpp


示例15: clReleaseCommandQueue

cl_int
clReleaseCommandQueue(cl_command_queue command_queue)
{
    if (!command_queue->isA(Coal::Object::T_CommandQueue)) {
#ifdef DBG_OUTPUT
      std::cout << "clReleaseCommandQueue failed" << std::endl;
#endif
      return CL_INVALID_COMMAND_QUEUE;
    }

    command_queue->flush();

    if (command_queue->dereference())
        delete command_queue;

    return CL_SUCCESS;
}
开发者ID:grubbymits,项目名称:esdg-opencl,代码行数:17,代码来源:api_command.cpp


示例16: clFlush

PUBLIC cl_int
clFlush(cl_command_queue q) {
   if (!q)
      return CL_INVALID_COMMAND_QUEUE;

   q->flush();
   return CL_SUCCESS;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:queue.cpp


示例17: clReleaseCommandQueueFCL

	cl_int clReleaseCommandQueueFCL (cl_command_queue command_queue)
	{
		MSG(clReleaseCommandQueueFCL);
		if (!FreeOCL::is_valid(command_queue))
			return CL_INVALID_COMMAND_QUEUE;

		command_queue->release();
		if (command_queue->get_ref_count() == 0)
		{
			command_queue->invalidate();
			command_queue->unlock();
			delete command_queue;
		}
		else
			command_queue->unlock();
		return CL_SUCCESS;
	}
开发者ID:efocht,项目名称:freeocl,代码行数:17,代码来源:commandqueue.cpp


示例18: clRetainCommandQueue

PUBLIC cl_int
clRetainCommandQueue(cl_command_queue q) {
   if (!q)
      return CL_INVALID_COMMAND_QUEUE;

   q->retain();
   return CL_SUCCESS;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:queue.cpp


示例19: clReleaseCommandQueue

PUBLIC cl_int
clReleaseCommandQueue(cl_command_queue q) {
   if (!q)
      return CL_INVALID_COMMAND_QUEUE;

   if (q->release())
      delete q;

   return CL_SUCCESS;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:10,代码来源:queue.cpp


示例20: clFinishFCL

	cl_int clFinishFCL (cl_command_queue command_queue)
	{
		MSG(clFinishFCL);
		if (!FreeOCL::is_valid(command_queue))
			return CL_INVALID_COMMAND_QUEUE;
		if (command_queue->done())
		{
			command_queue->unlock();
			return CL_SUCCESS;
		}
		command_queue->unlock();

		cl_event event;
		cl_int err = clEnqueueMarkerFCL(command_queue, &event);
		if (err != CL_SUCCESS)
			return err;

		err = clWaitForEventsFCL(1, &event);
		clReleaseEventFCL(event);
		return err;
	}
开发者ID:efocht,项目名称:freeocl,代码行数:21,代码来源:commandqueue.cpp



注:本文中的cl_command_queue类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cl_enginefunc_t类代码示例发布时间:2022-05-31
下一篇:
C++ clPtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap