Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions ClangAstParser/src/pt/up/fe/specs/clang/dumper/ClangAstDumper.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ private ClangAstData parsePrivate(File sourceFile, String id, Standard standard,
// Set standard to CUDA
else if (isCuda) {
// The LLVM 18 driver bundled with clang-dumper rejects '-std=cuda'. The .cu extension already
// selects CUDA mode, so use a C++ standard for host-side parsing.
arguments.add(standard.isCxx() ? standard.getFlag() : Standard.CXX17.getFlag());
// selects CUDA mode, so use a C++ standard for host-side parsing. Standard.CUDA reports
// isCxx() == true, so exclude it explicitly, otherwise the flag would go back to '-std=cuda'.
arguments.add(standard.isCxx() && !standard.isCuda() ? standard.getFlag() : Standard.CXX17.getFlag());
} else {
arguments.add(standard.getFlag());
}
Expand Down Expand Up @@ -243,10 +244,26 @@ else if (isCuda) {
else if (isCuda) {
if (!SpecsPlatforms.isLinux()) {
ClavaLog.info("We only officially support CUDA parsing in Linux, run at your own risk");
arguments.add("-fms-compatibility");
if (SpecsPlatforms.isWindows()) {
arguments.add("-D_MSC_VER");
arguments.add("-D_LIBCPP_MSVCRT");
// The bundled clang-dumper ships MinGW/libc++ headers. CUDA's headers select their
// implementations from _MSC_VER: without a version >= 1800 they use legacy paths
// (int-returning isinf/isnan, glibc-style __signbitl) that conflict with clang's
// own __DEVICE__ declarations. A real MSVC version selects the modern paths.
arguments.add("-D_MSC_VER=1930");

// _MSC_VER alone makes clang's builtin __stddef_wchar_t.h typedef wchar_t, which is
// invalid in C++; this macro (predefined by real MSVC) keeps the header silent.
arguments.add("-D_NATIVE_WCHAR_T_DEFINED");

// Clang's CUDA host pass defines __ELF__ even on Windows targets, so libc++
// misses _LIBCPP_OBJECT_FORMAT_COFF and emits an aligned_storage<..., 16384>
// specialization that exceeds clang's 8192-byte alignment cap on Windows.
arguments.add("-D_LIBCPP_OBJECT_FORMAT_COFF");

// CUDA's crt/host_defines.h hard-errors on libc++ + x86-64 unless this is defined.
arguments.add("-D_ALLOW_UNSUPPORTED_LIBCPP");
} else {
arguments.add("-fms-compatibility");
}
}

Expand Down
4 changes: 2 additions & 2 deletions Clava-JS/api/LegacyIntegrationTests - C.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ describe("CTest", () => {
await newTester().test("Detach.js", "detach.c");
});

(isWindows ? it.skip : it)("InlineNasLu", async () => {
it.skipIf(isWindows)("InlineNasLu", async () => {
await newTester()
.checkExpectedOutput(false)
.test("InlineNasLu.js", "inline_nas_lu.c");
}, 10_000);
}, 60_000);

it("InlineNasFt", async () => {
await newTester()
Expand Down
14 changes: 9 additions & 5 deletions Clava-JS/api/LegacyIntegrationTests - CXX.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe("CxxTest", () => {
.test("ParamType.js", "param_type.cpp");
});

(isWindows ? it.skip : it)("Wrap", async () => {
it.skipIf(isWindows)("Wrap", async () => {
const tester = newTester().set(
ClavaJavaTypes.CxxWeaverOption.PARSE_INCLUDES
);
Expand Down Expand Up @@ -218,6 +218,10 @@ describe("CxxTest", () => {
tester.setResultsFile("Setters.js.macos.txt");
}

if (isWindows) {
tester.setResultsFile("Setters.js.windows.txt");
}

await tester.test("Setters.js", "setters.cpp");
});

Expand Down Expand Up @@ -538,7 +542,7 @@ describe("CxxApiTest", () => {
});
});

(isWindows ? describe.skip : describe)("CudaTest", () => {
describe.skipIf(isMacOS)("CudaTest", () => {
function newTester() {
const cudaTester = new ClavaLegacyTester(
path.resolve("../ClavaWeaver/resources/clava/test/weaver/"),
Expand All @@ -556,13 +560,13 @@ describe("CxxApiTest", () => {

it("Cuda", async () => {
await newTester().test("Cuda.js", "atomicAdd.cu");
});
}, 60_000);

it("CudaMatrixMul", async () => {
await newTester().test("CudaMatrixMul.js", "mult_matrix.cu");
});
}, 60_000);

it("CudaQuery", async () => {
await newTester().test("CudaQuery.js", "sample.cu");
});
}, 60_000);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Original qualified name: std::chrono::steady_clock::now
Changed qualified name 1: now
Changed qualified name 2: std::now
Changed qualified name 3: std::chrono::_V2::system_clock::now
Changed then:
if(a == 0) {
a = 3;
}
else {
a = 2;
}

Changed else:
if(a == 0) {
a = 3;
}
else {
a = 4;
}

Changed condition:
if(a == 3) {
a = 3;
}
else {
a = 4;
}
Changed Function:
double testFunctionType(int a) {

return 0;
}
Changed FunctionType:
double (int)
Loading