<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><span style="color:rgb(33,33,33);font-size:13px">Hello all,</span></div><div><span style="color:rgb(33,33,33);font-size:13px"><br></span></div><div><span style="color:rgb(33,33,33);font-size:13px">I'm using Clang and am trying to refactor CUDA code. I want to traverse the AST to access a CUDAKernelCallExpr node where the kernel call has template parameters. I have been able to successfully match on and access CUDA kernel calls which have no template parameters by using the AST matchers to match on a CUDAKernelCallExpr. However, when my code comes across a kernel call with template parameters, it appears that the expression is not even existent in the AST when it is dumped. </span></div><div><span style="color:rgb(33,33,33);font-size:13px"><br></span></div><div><span style="color:rgb(33,33,33);font-size:13px">This is the expression that I'm having trouble parsing:</span><br></div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">ex. matrixMulCUDA<16><<< grid, threads >>>(d_C, d_A, d_B, dimsA.x, dimsB.x);</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">This expression does not show up at all in the AST when dumping the AST. I have been able to successfully parse the following kernel call expression and it shows up in the AST as a "CudaKernelCallExpr" node.</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">ex. matrixMulCUDA<<< grid, threads >>>(d_C, d_A, d_B, dimsA.x, dimsB.x);  <br></div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">As you can see, the only difference is the <16> after the name of the call, and this node is clearly represented in the AST.</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Here is a screenshot showing the lack of a node to represent the call with template parameters.</div><br class="m_4654841480214208958inbox-inbox-Apple-interchange-newline"><div><img src="cid:16003a4a6f6cb971f161" alt="image.png" class="" style="max-width: 100%; opacity: 1;"><br></div><div><div style="color:rgb(33,33,33);font-size:13px">If I could get any assistance on why this is happening, I would appreciate it greatly.</div></div><div><br></div><div>Thank you,</div></div><div dir="ltr"><div>Michael Ehmke</div></div></div></div>