<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Qt creator with CUDA show Semantic Issue]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I try to compile simple CUDA code with qt creator.<br />
In .pro file I use this code</p>
<pre><code>...
SOURCES += \
        main.cpp

CUDA_DIR = /usr/local/cuda-10.0
CUDA_SOURCES +=  cuda_functions.cu
CUDA_ARCH = sm_53
NVCC_OPTIONS = --use_fast_math
HOST_COMPILER=$$QMAKE_CXX
LIB_PATH=x86_64-linux

equals(HOST_COMPILER, "aarch64-linux-gnu-g++") {
    LIB_PATH=aarch64-linux
}

INCLUDEPATH += $$CUDA_DIR/targets/$$LIB_PATH/include
QMAKE_LIBDIR += $$CUDA_DIR/targets/$$LIB_PATH/lib
LIBS += -L $$CUDA_DIR/targets/$$LIB_PATH/lib -lcudart -lcuda

CONFIG(debug, debug|release) { #debug
    cuda_d.commands = $$CUDA_DIR/bin/nvcc -ccbin $$HOST_COMPILER -D_DEBUG $$NVCC_OPTIONS -m64  -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
    cuda_d.dependency_type = TYPE_C
    cuda_d.input = CUDA_SOURCES
    cuda_d.output = cuda/${QMAKE_FILE_BASE}.o
    QMAKE_EXTRA_COMPILERS += cuda_d
} else { #release
    cuda.commands = $$CUDA_DIR/bin/nvcc -ccbin $$HOST_COMPILER $$NVCC_OPTIONS -m64 -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
    cuda.dependency_type = TYPE_C
    cuda.input = CUDA_SOURCES
    cuda.output = cuda/${QMAKE_FILE_BASE}.o
    QMAKE_EXTRA_COMPILERS += cuda
}
...
</code></pre>
<p dir="auto">Everything works fine, so I can compile and run the code.<br />
But Qt creator show me semantic issue (see in the picture):</p>
<pre><code>use of undeclared identifier blockDim, blockIdx and threadIdx
</code></pre>
<p dir="auto">although the compile was successful.</p>
<p dir="auto">It looks like indexer  or I don't know issues.<br />
Please can you help me how to remove this "cometics" problem.<br />
Thank you</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/c19377e5-dca4-417e-a95d-fbee6b7316e1.png" alt="cuda_semantic_issues.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/114714/qt-creator-with-cuda-show-semantic-issue</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 08:15:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/114714.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 May 2020 05:36:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt creator with CUDA show Semantic Issue on Tue, 12 May 2020 17:51:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">AFAIR, these come directly from CUDA. Therefore I am not sure that the clang code model is ready for CUDA kernel code.</p>
]]></description><link>https://forum.qt.io/post/594322</link><guid isPermaLink="true">https://forum.qt.io/post/594322</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 12 May 2020 17:51:24 GMT</pubDate></item><item><title><![CDATA[Reply to Qt creator with CUDA show Semantic Issue on Tue, 12 May 2020 05:45:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/kubikula">@<bdi>kubikula</bdi></a>,</p>
<p dir="auto">most likely the Code Model has problems parsing a header file.</p>
<p dir="auto">Where do these definitions actually come from? Are there more errors when you open the header file containing these definitions?</p>
<p dir="auto">Regards</p>
]]></description><link>https://forum.qt.io/post/594183</link><guid isPermaLink="true">https://forum.qt.io/post/594183</guid><dc:creator><![CDATA[aha_1980]]></dc:creator><pubDate>Tue, 12 May 2020 05:45:14 GMT</pubDate></item></channel></rss>