Skip to content

Commit dd31148

Browse files
authored
Merge pull request #29 from SCOREC/minimal-Clang-Error
Minimal clang error
2 parents fc35bab + 591b4da commit dd31148

File tree

3 files changed

+44
-22
lines changed

3 files changed

+44
-22
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ message(STATUS "IS_TESTING: ${IS_TESTING}")
4141

4242
#tests
4343

44+
45+
# Creating minimal reproduction of error
4446
add_executable(Main test/testMain.cpp)
4547
target_link_libraries(Main PRIVATE meshFields)
4648

4749
add_executable(KokkosTests test/testKokkos.cpp)
4850
target_link_libraries(KokkosTests PRIVATE meshFields)
4951

52+
add_executable(ClangTests test/testClangMinimal.cpp)
53+
target_link_libraries(ClangTests PRIVATE meshFields)
54+
5055
add_executable(CabanaTests test/testCabana.cpp)
5156
target_link_libraries(CabanaTests PRIVATE meshFields)
5257

@@ -55,6 +60,7 @@ target_link_libraries(LogicTests PRIVATE meshFields)
5560

5661
add_test(MainTests ./Main)
5762
add_test(KokkosTests ./KokkosTests)
63+
add_test(ClangTests ./ClangTests)
5864
add_test(CabanaTests ./CabanaTests)
5965
add_test(logicTests ./LogicTests)
6066

test/testClangMinimal.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include "MeshField.hpp"
2+
#include "CabanaController.hpp"
3+
#include "KokkosController.hpp"
4+
#include "MeshField_Macros.hpp"
5+
#include "MeshField_Utility.hpp"
6+
7+
#include <Cabana_Core.hpp>
8+
#include <Kokkos_Core.hpp>
9+
10+
#include <vector>
11+
#include <iostream>
12+
//#include <initializer_list>
13+
#include <stdio.h>
14+
15+
using ExecutionSpace = Kokkos::DefaultExecutionSpace;
16+
using MemorySpace = Kokkos::DefaultExecutionSpace::memory_space;
17+
18+
19+
int main(int argc, char *argv[]) {
20+
Kokkos::ScopeGuard scope_guard(argc, argv);
21+
printf("== START testNset ==\n");
22+
23+
const int N = 10;
24+
25+
using kok1 = Controller::KokkosController<MemorySpace,ExecutionSpace, int**, int***,int****, int*****>;
26+
kok1 c1({N,N,
27+
N,N,N,
28+
N,N,N,N,
29+
N,N,N,N,N});
30+
assert(c1.size(2,0) == N);
31+
assert(c1.size(2,1) == N);
32+
assert(c1.size(2,2) == N);
33+
assert(c1.size(2,3) == N);
34+
35+
printf("== END testNset ==\n");
36+
return 0;
37+
}
38+

test/testMain.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,6 @@ void testParallelScan() {
8282
printf("== END testParallelScan ==\n");
8383
}
8484

85-
void testNset() {
86-
87-
printf("== START testNset ==\n");
88-
89-
{
90-
const int N = 10;
91-
92-
using kok1 = Controller::KokkosController<MemorySpace,ExecutionSpace, int**, int***,int****, int*****>;
93-
kok1 c1({N,N,
94-
N,N,N,
95-
N,N,N,N,
96-
N,N,N,N,N});
97-
assert(c1.size(2,0) == N);
98-
assert(c1.size(2,1) == N);
99-
assert(c1.size(2,2) == N);
100-
assert(c1.size(2,3) == N);
101-
}
102-
103-
printf("== END testNset ==\n");
104-
}
105-
10685
void testSetField() {
10786
printf("== START testSetField ==\n");
10887

@@ -198,7 +177,6 @@ void testSetField() {
198177

199178
int main(int argc, char *argv[]) {
200179
Kokkos::ScopeGuard scope_guard(argc, argv);
201-
testNset();
202180
testParallelScan();
203181
testSetField();
204182
return 0;

0 commit comments

Comments
 (0)