Skip to content

Commit

Permalink
Merge pull request #29 from SCOREC/minimal-Clang-Error
Browse files Browse the repository at this point in the history
Minimal clang error
  • Loading branch information
cwsmith authored Jan 24, 2024
2 parents fc35bab + 591b4da commit dd31148
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ message(STATUS "IS_TESTING: ${IS_TESTING}")

#tests


# Creating minimal reproduction of error
add_executable(Main test/testMain.cpp)
target_link_libraries(Main PRIVATE meshFields)

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

add_executable(ClangTests test/testClangMinimal.cpp)
target_link_libraries(ClangTests PRIVATE meshFields)

add_executable(CabanaTests test/testCabana.cpp)
target_link_libraries(CabanaTests PRIVATE meshFields)

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

add_test(MainTests ./Main)
add_test(KokkosTests ./KokkosTests)
add_test(ClangTests ./ClangTests)
add_test(CabanaTests ./CabanaTests)
add_test(logicTests ./LogicTests)

Expand Down
38 changes: 38 additions & 0 deletions test/testClangMinimal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include "MeshField.hpp"
#include "CabanaController.hpp"
#include "KokkosController.hpp"
#include "MeshField_Macros.hpp"
#include "MeshField_Utility.hpp"

#include <Cabana_Core.hpp>
#include <Kokkos_Core.hpp>

#include <vector>
#include <iostream>
//#include <initializer_list>
#include <stdio.h>

using ExecutionSpace = Kokkos::DefaultExecutionSpace;
using MemorySpace = Kokkos::DefaultExecutionSpace::memory_space;


int main(int argc, char *argv[]) {
Kokkos::ScopeGuard scope_guard(argc, argv);
printf("== START testNset ==\n");

const int N = 10;

using kok1 = Controller::KokkosController<MemorySpace,ExecutionSpace, int**, int***,int****, int*****>;
kok1 c1({N,N,
N,N,N,
N,N,N,N,
N,N,N,N,N});
assert(c1.size(2,0) == N);
assert(c1.size(2,1) == N);
assert(c1.size(2,2) == N);
assert(c1.size(2,3) == N);

printf("== END testNset ==\n");
return 0;
}

22 changes: 0 additions & 22 deletions test/testMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,6 @@ void testParallelScan() {
printf("== END testParallelScan ==\n");
}

void testNset() {

printf("== START testNset ==\n");

{
const int N = 10;

using kok1 = Controller::KokkosController<MemorySpace,ExecutionSpace, int**, int***,int****, int*****>;
kok1 c1({N,N,
N,N,N,
N,N,N,N,
N,N,N,N,N});
assert(c1.size(2,0) == N);
assert(c1.size(2,1) == N);
assert(c1.size(2,2) == N);
assert(c1.size(2,3) == N);
}

printf("== END testNset ==\n");
}

void testSetField() {
printf("== START testSetField ==\n");

Expand Down Expand Up @@ -198,7 +177,6 @@ void testSetField() {

int main(int argc, char *argv[]) {
Kokkos::ScopeGuard scope_guard(argc, argv);
testNset();
testParallelScan();
testSetField();
return 0;
Expand Down

0 comments on commit dd31148

Please # to comment.