[Beignet] Shared Host Memory but not Share
Gao, Sanshan
gss at mail.ustc.edu.cn
Sun May 3 00:55:39 PDT 2015
Hi, alls,
I want to use CL_MEM_USE_HOST_PTR to create a buffer object which shares host memory, so the changes to the elements in kernel can be used by host program.
But the result is that, I have changed the element in kernel, but the element in host program has not changed. I don't know why? Does this method still be a copy of host memory, so the change is not done to the host memory, but only device memory?
Hope for helps!
Device: GIGA Mini PC with core i7 and Iris Pro, integrated GPU
Kernel function:
47 __kernel void PacketsIndexCalculation(
48 const unsigned int packets_info_size,
49 __global packet_info_t *packets_info,
50 const unsigned int flow_table_size )
51 {
52 int gid = get_global_id(0);
53 __global packet_info_t *p = packets_info + gid;
54
55 //calculate hash value
56 p->index = ( ((p->flow_id).src_ip & 0xff) | (((p->flow_id).dst_ip & 0xff)<<8) |
57 (((p->flow_id).src_port & 0xff)<<16) | (((p->flow_id).dst_port & 0xff)<<24) )%flow_table_size;
58
59 }
Problem:
In host program, the memory pointed by &(p->index) has not changed by kernel function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20150503/946ea616/attachment.html>
More information about the Beignet
mailing list