Cpp extensions (#1451)

* Add more cpp extensions

* Allow FilenameMatcher to be case insensitive
---------

Co-authored-by: Darin Morrison <darinmorrison@gmail.com>
Co-authored-by: silvanshade <silvanshade@users.noreply.github.com>
Co-authored-by: MischaPanch
This commit is contained in:
authored and GitHub committed 2026-05-06 19:04:36 +02:00
1 parent b28f705fee
commit 0e3f665976
17 files changed
+263 -18

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
#include "b.h"
int main()
{
int x = add(3, 4);
return x;
}
+3
View File
@@ -0,0 +1,3 @@
#pragma once
int add(int a, int b);
@@ -0,0 +1,16 @@
#include <cstdio>
#include <cstdlib>
__global__ auto
cuda_hello() -> void
{
printf("Hello World from GPU!\n");
}
auto
main() -> int
{
cuda_hello<<<1, 1>>>();
cudaDeviceSynchronize();
return EXIT_SUCCESS;
}
@@ -0,0 +1,9 @@
#include <cstdlib>
import b;
auto
main() noexcept -> int
{
return EXIT_SUCCESS;
}
@@ -0,0 +1,17 @@
module;
#include <cstdint>
module b;
auto
add(auto x, auto y) -> decltype(x + y)
{
return x + y;
}
auto
add_f32(float x, float y) -> float
{
return add(x, y);
}
@@ -0,0 +1,16 @@
module;
#include <cstdint>
export module b;
export auto
add(auto x, auto y) -> decltype(x + y);
export auto
add_f32(float x, float y) -> float;
auto
add_u32(std::int32_t x, std::int32_t y) -> std::int32_t {
return x + y;
}
@@ -0,0 +1,10 @@
// -*- mode: C -*-
#include <hip/hip_runtime.h>
__global__
void add_vectors(const float* A, const float* B, float* C)
{
auto const idx = blockIdx.x * blockDim.x + threadIdx.x;
C[idx] = A[idx] + B[idx];
}
@@ -0,0 +1,7 @@
@interface Hello
- (void)hello;
@end
int main(int argc, const char * argv[]) {
return 0;
}
@@ -0,0 +1,8 @@
// -*- mode: C -*-
__kernel
void add_vectors(__global const float *A, __global const float *B, __global float *C)
{
int idx = get_global_id(0);
C[idx] = A[idx] + B[idx];
}
@@ -13,5 +13,40 @@
"directory": ".",
"command": "g++ -std=c++17 -I . -c diagnostics_sample.cpp",
"file": "diagnostics_sample.cpp"
},
{
"directory": "C",
"command": "clang -std=gnu23 -c a.c",
"file": "a.c"
},
{
"directory": "CUDA",
"command": "nvcc -std=c++20 -c a.cu",
"file": "a.cu"
},
{
"directory": "CXX20",
"command": "clang++ -std=gnu++20 -fmodule-file=b=b.pcm -c a.cpp",
"file": "a.cpp"
},
{
"directory": "CXX20",
"command": "clang++ -std=gnu++20 -fmodule-file=b=b.pcm -c b.cpp",
"file": "b.cpp"
},
{
"directory": "CXX20",
"command": "clang++ -std=gnu++20 -c b.cppm",
"file": "b.cppm"
},
{
"directory": "OpenCL",
"command": "clang -std=cl3.0 -c a.cl",
"file": "a.cl"
},
{
"directory": "HIP",
"command": "hipcc -c a.hip",
"file": "a.hip"
}
]