<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1462282064628_2531">Hi,</div><div id="yui_3_16_0_ym19_1_1462282064628_2531"><br></div><div id="yui_3_16_0_ym19_1_1462282064628_2531">I use libclang 3.8 to parse cuda code before it is compiled by the nvidia compiler and tried to ship around the texture type with the following idea:</div><div id="yui_3_16_0_ym19_1_1462282064628_2531"><br></div><div id="yui_3_16_0_ym19_1_1462282064628_2531">//---------------------------------------------</div><div id="yui_3_16_0_ym19_1_1462282064628_2531">// I created a texture template class</div><div id="yui_3_16_0_ym19_1_1462282064628_2623">template<typename TData1,typename TData2,typename TData3></div><div id="yui_3_16_0_ym19_1_1462282064628_2625">class texture</div><div id="yui_3_16_0_ym19_1_1462282064628_2627">{</div><div id="yui_3_16_0_ym19_1_1462282064628_2629">public: </div><div id="yui_3_16_0_ym19_1_1462282064628_2631"> typedef TData1 DataOne;</div><div id="yui_3_16_0_ym19_1_1462282064628_2633"> typedef TData2 DataTwo;</div><div id="yui_3_16_0_ym19_1_1462282064628_2635"> typedef TData3 DataThree;</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">};</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">//and used it this way<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">texture<float, 1, cudaReadModeElementType> tex;<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">//----------------------------------------------</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">Without the class definition clang_visitChildren() will skip the declaration of tex.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637"> </div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">With class "texture" it finds a CXCursor_ClassTemplate and a CXCursor_VarDecl. In this moment the type of the cursor is CXType_Int.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">How can I gather the "texture" type?</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">Best regards,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1462282064628_2637">Albrecht</div></div></body></html>