<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 9 Oct 2017, at 21:36, Jan Vesely <<a href="mailto:jan.vesely@rutgers.edu" class="">jan.vesely@rutgers.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Mon, 2017-10-09 at 21:21 +0200, Jeroen Ketema via Libclc-dev wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Updated version of the patch, which does not emit a fence if neither<br class="">CLK_GLOBAL_MEM_FENCE nor CLK_LOCAL_MEM_FENCE is<br class="">passed via the flags parameter.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Can you include the explanation/description from v1 in the commit</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">message?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>I will.</div><div><br class=""></div><div>Jeroen</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Reviewed-by: Jan Vesely <</span><a href="mailto:jan.vesely@rutgers.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">jan.vesely@rutgers.edu</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Jan</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="">Index: ptx-nvidiacl/lib/SOURCES<br class="">===================================================================<br class="">--- ptx-nvidiacl/lib/SOURCES<span class="Apple-tab-span" style="white-space: pre;">     </span>(revision 315193)<br class="">+++ ptx-nvidiacl/lib/SOURCES<span class="Apple-tab-span" style="white-space: pre;">        </span>(working copy)<br class="">@@ -1,3 +1,4 @@<br class="">+mem_fence/fence.cl<br class="">synchronization/barrier.cl<br class="">workitem/get_global_id.cl<br class="">workitem/get_group_id.cl<br class="">Index: ptx-nvidiacl/lib/mem_fence/fence.cl<br class="">===================================================================<br class="">--- ptx-nvidiacl/lib/mem_fence/fence.cl<span class="Apple-tab-span" style="white-space: pre;">   </span>(nonexistent)<br class="">+++ ptx-nvidiacl/lib/mem_fence/fence.cl<span class="Apple-tab-span" style="white-space: pre;"> </span>(working copy)<br class="">@@ -0,0 +1,15 @@<br class="">+#include <clc/clc.h><br class="">+<br class="">+_CLC_DEF void mem_fence(cl_mem_fence_flags flags) {<br class="">+   if (flags & (CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE))<br class="">+     __nvvm_membar_cta();<br class="">+}<br class="">+<br class="">+// We do not have separate mechanism for read and write fences.<br class="">+_CLC_DEF void read_mem_fence(cl_mem_fence_flags flags) {<br class="">+  mem_fence(flags);<br class="">+}<br class="">+<br class="">+_CLC_DEF void write_mem_fence(cl_mem_fence_flags flags) {<br class="">+  mem_fence(flags);<br class="">+}<br class=""><br class=""><blockquote type="cite" class="">On 8 Oct 2017, at 20:23, Jeroen Ketema via Libclc-dev <<a href="mailto:libclc-dev@lists.llvm.org" class="">libclc-dev@lists.llvm.org</a>> wrote:<br class=""><br class="">PTX does not differentiate between read and write fences. Hence, these a<br class="">lowered to a mem_fence call. The mem_fence function compiles to the<br class="">“member.cta” instruction, which commits all outstanding reads and writes<br class="">of a thread such that these become visible to all other threads in the same<br class="">CTA (i.e., work-group). The instruction does not differentiate between<br class="">global and local memory. Hence, the flags parameter is ignored.<br class=""><br class="">Index: ptx-nvidiacl/lib/SOURCES<br class="">===================================================================<br class="">--- ptx-nvidiacl/lib/SOURCES<span class="Apple-tab-span" style="white-space: pre;">       </span>(revision 315170)<br class="">+++ ptx-nvidiacl/lib/SOURCES<span class="Apple-tab-span" style="white-space: pre;">        </span>(working copy)<br class="">@@ -1,3 +1,4 @@<br class="">+mem_fence/fence.cl<br class="">synchronization/barrier.cl<br class="">workitem/get_global_id.cl<br class="">workitem/get_group_id.cl<br class="">Index: ptx-nvidiacl/lib/mem_fence/fence.cl<br class="">===================================================================<br class="">--- ptx-nvidiacl/lib/mem_fence/fence.cl<span class="Apple-tab-span" style="white-space: pre;">   </span>(nonexistent)<br class="">+++ ptx-nvidiacl/lib/mem_fence/fence.cl<span class="Apple-tab-span" style="white-space: pre;"> </span>(working copy)<br class="">@@ -0,0 +1,14 @@<br class="">+#include <clc/clc.h><br class="">+<br class="">+_CLC_DEF void mem_fence(cl_mem_fence_flags flags) {<br class="">+   __nvvm_membar_cta();<br class="">+}<br class="">+<br class="">+// We do not have separate mechanism for read and write fences<br class="">+_CLC_DEF void read_mem_fence(cl_mem_fence_flags flags) {<br class="">+  mem_fence(flags);<br class="">+}<br class="">+<br class="">+_CLC_DEF void write_mem_fence(cl_mem_fence_flags flags) {<br class="">+  mem_fence(flags);<br class="">+}<br class=""><br class="">_______________________________________________<br class="">Libclc-dev mailing list<br class=""><a href="mailto:Libclc-dev@lists.llvm.org" class="">Libclc-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev<br class=""></blockquote><br class="">_______________________________________________<br class="">Libclc-dev mailing list<br class=""><a href="mailto:Libclc-dev@lists.llvm.org" class="">Libclc-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev</a></blockquote></div></blockquote></div><br class=""></body></html>