Skip to content

Commit

Permalink
Fix include ordering cause of conflicting DEVICE enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
koparasy committed Dec 5, 2023
1 parent 02f7475 commit 9f6e2df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ function(ADDExec binary_name definitions)
if (WITH_CUDA)
set_source_files_properties(main.cpp PROPERTIES LANGUAGE CUDA)
set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS "--expt-extended-lambda")
set_source_files_properties(app/eos_idealgas.hpp PROPERTIES COMPILE_FLAGS "--expt-extended-lambda")
set_source_files_properties(app/eos_ams.cpp PROPERTIES LANGUAGE CUDA)
set_source_files_properties(app/eos_ams.cpp PROPERTIES COMPILE_FLAGS "--expt-extended-lambda")
set_target_properties(${binary_name} PROPERTIES CUDA_ARCHITECTURES "${AMS_CUDA_ARCH}")

if (WITH_RZ)
Expand Down
2 changes: 1 addition & 1 deletion examples/app/eos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EOS
#ifdef __ENABLE_PERFFLOWASPECT__
__attribute__((annotate("@critical_path(pointcut='around')")))
#endif
virtual void
void
Eval(const int length, const FPType **inputs, FPType **outputs) const
{
Eval(length,
Expand Down
4 changes: 2 additions & 2 deletions examples/app/utils_mfem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define mfemReshapeArray1(m, op) mfem::Reshape(m.op(), m.Size());

//! -----------------------------------------------------------------------
using mfem::ForallWrap;

template <typename T>
using dt1 = mfem::DeviceTensor<1, T>;
Expand Down Expand Up @@ -53,7 +52,7 @@ static inline void pack_ij(const int k,
const dt3<Tin> &b3,
const dt2<Tout> &b2)
{

using mfem::ForallWrap;
MFEM_FORALL(j, sz_sparse_j, {
const int sparse_j = sparse_j_indices[offset_sparse_j + j];
for (int i = 0; i < sz_i; ++i) {
Expand All @@ -79,6 +78,7 @@ static inline void unpack_ij(const int k,
const dt3<Tout> &d3)
{

using mfem::ForallWrap;
MFEM_FORALL(j, sz_sparse_j, {
const int sparse_j = sparse_j_indices[offset_sparse_j + j];
for (int i = 0; i < sz_i; ++i) {
Expand Down
6 changes: 3 additions & 3 deletions examples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
#include <unordered_set>
#include <vector>

// clang-format off
#include "app/eos.hpp"
#include "app/eos_ams.hpp"
#include "app/eos_constant_on_host.hpp"
#include "app/eos_idealgas.hpp"
#include "app/utils_mfem.hpp"
#include "app/eos_ams.hpp"
// clang-format on

// this macro completely bypasses all AMS functionality
// this allows us to check how easy is it to test ams
Expand Down Expand Up @@ -115,8 +117,6 @@ std::unordered_set<std::string> createMemoryAllocators(
return std::move(allocator_names);
}

using mfem::ForallWrap;

int computeNumElements(int globalNumElements, int id, int numRanks)
{
int lElements = (globalNumElements + numRanks - 1) / numRanks;
Expand Down

0 comments on commit 9f6e2df

Please sign in to comment.