Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: different time of cpu and gpu

  1. #11

    Re: different time of cpu and gpu

    clint3112 is right, you are just recording the time taken by the GPU to execute the kernel. If you want the time taken to transfer data, you need to time the clEnqueuWriteBuffer command using CPU timers since you have chosen a synchronous transfer. Use events to profile data transfer when using asynchronous transfers.

  2. #12

    Re: different time of cpu and gpu

    ok but when we use cpu with dual core ,then wt it will calculate because there is no transfer in cpu with pci to other device , so wt it will show in case of CPU.because
    transfer is done only in gpu then how we compare cpu with gpu .

    "with your experience wt people use to compare between cpu and gpu , do they consider this transfer time for comparing cpu and gpu.kindly give suggestion"


  3. #13

    Re: different time of cpu and gpu

    On CPUs, I'd expect that profiling the data transfers will give you very small times. For comparing CPUs and GPUs, I think you should record the time taken to transfer data and the kernel execution time. You only need to consider the OpenCL kernel compile time in certain cases. Perhaps report the times separately i.e. time spent compiling, time spent transferring data, time spent executing the kernel. Then your reader can decide what is important???

  4. #14

    Re: different time of cpu and gpu

    ok thanks for reply
    pls let me correct if i am wrong
    1) data transfer done from cpu to gpu can be done by clEnqueueReadBuffer() ?
    2)data transfer done from gpu to cpu can be done by clEnqueueWriteBuffer()?

    if it is correct clEnqueueReadBuffer() and clEnqueueWriteBuffer() how i can calculate time separately or for i have to consider the time for creating the buffer object also which done by clCreateBuffer for input and output.....
    pls support

  5. #15
    Senior Member
    Join Date
    Oct 2012

    Re: different time of cpu and gpu


    Write buffer will write to your openCL device, read buffer will read from your device.
    Just create a cl_event pEvent, pass it to the write/read call and after it finished you get the timing with
    Code :
    clGetEventProfilingInfo(pEvent, CL_PROFILING_COMMAND_END,   sizeof(cl_ulong), &ullEnd,   nullptr);

  6. #16

    Re: different time of cpu and gpu

    i am talking abt the data transfer from which command it will happen
    pls reply forum ......

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 2
    Last Post: 10-14-2012, 08:41 AM
  2. A Kernel that run in CPU and GPU same time
    By luizdrumond in forum OpenCL
    Replies: 2
    Last Post: 08-29-2012, 11:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean