Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8659275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:58:35+00:00 2026-06-12T15:58:35+00:00

While trying to improve the performance of some OpenCL computation, I used the profiling

  • 0

While trying to improve the performance of some OpenCL computation, I used the profiling features of the OpenCL runtime on a clEnqueueWriteBuffer call, and on the immediately following clEnqueueNDRangeKernel (which depends on the previous data tranfer):

clEnqueueWriteBuffer(cmdq, cl_buf, CL_FALSE, 0, size, data, 0, NULL, &write_ev);
clEnqueueNDRangeKernel(cmdq, ker_with_cl_buf_as_input_param, 2, NULL,
    work_sze, local_sze, 1, &write_ev, &ker_ev);

Here is what is returned by clGetEventProfilingInfo (I substracted the initial time and converted to micro seconds) :

           QUEUED   SUBMIT    START      END   END-START
write_ev        0  113.952  120.448  211.136      90.688
ker_ev    130.016  132.608  217.280  515.200     297.920

My questions are:

  1. Why does clEnqueueWriteBuffer not return before the memory transfer has been started or submitted ?
  2. More importantly, why does it take so long for the transfer to be actually submitted ???

It seems to me that 22% performance could be gained just if the memory transfer could start immediately.
Does clEnqueueWriteBuffer copy the data in another host memory region before actually doing the transfer ?

Additional information:

I use the cuda 4.1 framework on a Tesla M2090 GPU.

The buffer is created previously using:

cl_buf = clCreateBuffer(my_context, CL_MEM_READ_ONLY, size, NULL, NULL);

EDIT: clEnqueueReadBuffer does not exhibit such behavior.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:58:37+00:00Added an answer on June 12, 2026 at 3:58 pm

    You can try to use pinned memory as described in Section 3.1.1 of NVidia OpenCL Best Practices Guide.

    They do not mention if a copy is performed in case pageable memory is used, but it may happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to improve on some code that was written a while back. the
So I am trying to improve Eclipse performance, someone suggested a while ago to
I am trying to improve my knowledge of javascript and while searching for some
I am trying to figure out a way to improve the performance of a
I'm trying to improve some existing code which originally took 3 minutes to prepare
I am trying to improve performance of elfinder , an ajax based file manager(elRTE.ru)
I am trying to improve performance for a proof of concept I have already
Im trying to set fetchSize on statment, while executing query so that can improve
I need some help about optimisation. I am trying to improve this open-source game
While trying to build the mysql2 gem with ruby 1.9.2-p320 on Fedora 16, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.