Hello,
I’m having a simple CUDA kernel. I’m using clang only to get the syntax tree without the need to compile or link. I only need the syntax tree to create C# wrappers.
// CsGenerator settings
// namespace = ipipe.CUDA.Tests
//Remark: only enums used in global function declearations are extracted.
enum TestEnum1 {
TEST_ENUM_ITEM_1_1 = 1,
TEST_ENUM_ITEM_1_2 = 2
};
enum TestEnum2 {
TEST_ENUM_ITEM_2_1,
TEST_ENUM_ITEM_2_2
};
extern "C" __global__ void TestCaseEnum(TestEnum1 enum1, int* mem) {
int x = blockDim.x * blockIdx.x + threadIdx.x;
int y = blockDim.y * blockIdx.y + threadIdx.y;
if (x != 0 || y != 0) {
return;
}
mem[0] = (int)enum1;
}
extern "C" __global__ void TestCaseEnumWithValue(TestEnum2 enum2, int* mem) {
int x = blockDim.x * blockIdx.x + threadIdx.x;
int y = blockDim.y * blockIdx.y + threadIdx.y;
if (x != 0 || y != 0) {
return;
}
mem[0] = (int)enum2;
}
and I’m calling clang with these parameters:
List<string> parameters = new()
{
"-ferror-limit=500", // Limit error log to maximal 500 errors.
"-nocudalib", // Do not use the cudalib.
"-nogpulib",
"-fsyntax-only",
"--cuda-device-only",
"--cuda-gpu-arch=sm_50", // Set gpu architectur to sm_35, the default sm_20 isn't supported by cuda sdk 9.1
$"--cuda-path={cudaToolkitPath}",
"-std=c++17",
"-v", // Enable verbose mode
};
The problem is that there are many errors from the core clang libraries itself and I just wanted to ask if this is intended:
CXDiagnostic_Warning : (0,0): CUDA version is newer than the latest supported version 11.5
CXDiagnostic_Warning Lexical or Preprocessor Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_math.h (39,25): extra tokens at end of #ifdef directive
CXDiagnostic_Warning Lexical or Preprocessor Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_runtime_wrapper.h (254,9): '__host__' macro redefined
CXDiagnostic_Warning Lexical or Preprocessor Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_runtime_wrapper.h (489,9): pragma pop_macro could not pop '__USE_FAST_MATH__', no matching push_macro
CXDiagnostic_Warning Semantic Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_device_functions.h (440,16): function '__isinfl' has internal linkage but is not defined
CXDiagnostic_Warning Semantic Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_device_functions.h (445,16): function '__isnanl' has internal linkage but is not defined
CXDiagnostic_Warning Semantic Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_device_functions.h (229,16): function '__finitel' has internal linkage but is not defined
CXDiagnostic_Warning Semantic Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_math_forward_declares.h (131,18): function 'logb' has internal linkage but is not defined
CXDiagnostic_Warning Semantic Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_math_forward_declares.h (162,18): function 'scalbn' has internal linkage but is not defined
CXDiagnostic_Warning Semantic Issue: E:\TFS\IPIPE\_Build\Debug\Assemblies\ipipe.Cuda.Design.Viewer\LLVM\__clang_cuda_math_forward_declares.h (50,18): function 'copysign' has internal linkage but is not defined
Additionally, I’m using surfaces but also here I get warnings that identifiers, like surf1Dread are undefined.
I’m a bit not understanding the linkage error since I explicitly said that I want the syntax only.
Is this intended or do I miss something? Or is there some documentation I can read on?
Thanks