Xilinx / Get_Moving_With_Alveo

For publishing the source for UG1352 "Get Moving with Alveo"
47 stars 16 forks source link

During "Memory object migration enqueue" in 03_buffer_map.cpp ... #4

Open xooxit opened 2 years ago

xooxit commented 2 years ago

Hi- I wanna take a look into the role of "enqueueMigrateMemObjects" during map/unmap buffer.

So, I comment out "Send the buffer down to the Alveo card" section like below.

    // Send the buffers down to the Alveo card 
    et.add("Memory object migration enqueue");
    cl::Event event_sp;
    // q.enqueueMigrateMemObjects({a_buf, b_buf}, 0, NULL, &event_sp);
    // clWaitForEvents(1, (const cl_event *)&event_sp);

Then, compile and run. It works well because the kernel is executed and the results are valid except that the "Memory object migration enqueue" is decreased.

xooxit@user:~/document/Get_Moving_With_Alveo/build$ ./03_buffer_map 
-- Example 3: Allocate and Map Contiguous Buffers --

Loading alveo_examples.xclbin to program the Alveo board

Running kernel test with XRT-allocated contiguous buffers

OCL-mapped contiguous buffer example complete!

--------------- Key execution times ---------------
OpenCL Initialization              :  202.436 ms
Allocate contiguous OpenCL buffers :   42.738 ms
Set kernel arguments               :    0.010 ms
Map buffers to userspace pointers  :    0.449 ms
Populating buffer inputs           :   25.182 ms
Software VADD run                  :   18.837 ms
Memory object migration enqueue    :    0.001 ms
OCL Enqueue task                   :    0.067 ms
Wait for kernel to complete        :  100.938 ms
Read back computation results      :    2.558 ms
xooxit@user:~/document/Get_Moving_With_Alveo/build$

My question is that

  1. when map/unmap scheme is used as data transfer between host memory and alveo memory, is it NECESSARY to use enqueueMigrateMemObjects for data transfer?
  2. If does or it is helpful, WHAT is the effect of enqueueMigrateMemObjects during map and unmap buffer?
ept221 commented 1 year ago

Did you get any clarity on this?