mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Preconditioner: optionally instantiate for float
BILU0: optionally instantiate for float BISAI: optionally instantiate for float CPR: optionally instantiate for float CPRCreation: optionally instantiate for float Misc: optionally instantiate for float
This commit is contained in:
parent
5bab71b8e3
commit
a0f8cc0aed
@ -284,7 +284,7 @@ analyzeAggregateMaps()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INSTANCE_TYPE(T) \
|
#define INSTANTIATE_TYPE(T) \
|
||||||
template class CprCreation<T,1>; \
|
template class CprCreation<T,1>; \
|
||||||
template class CprCreation<T,2>; \
|
template class CprCreation<T,2>; \
|
||||||
template class CprCreation<T,3>; \
|
template class CprCreation<T,3>; \
|
||||||
@ -292,7 +292,11 @@ analyzeAggregateMaps()
|
|||||||
template class CprCreation<T,5>; \
|
template class CprCreation<T,5>; \
|
||||||
template class CprCreation<T,6>;
|
template class CprCreation<T,6>;
|
||||||
|
|
||||||
INSTANCE_TYPE(double)
|
INSTANTIATE_TYPE(double)
|
||||||
|
|
||||||
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
INSTANTIATE_TYPE(float)
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
#include <cmath>
|
#include <config.h>
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include <opm/simulators/linalg/bda/Misc.hpp>
|
#include <opm/simulators/linalg/bda/Misc.hpp>
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace Opm::Accelerator {
|
namespace Opm::Accelerator {
|
||||||
|
|
||||||
// divide A by B, and round up: return (int)ceil(A/B)
|
// divide A by B, and round up: return (int)ceil(A/B)
|
||||||
@ -59,4 +61,8 @@ void solve_transposed_3x3(const Scalar* A,
|
|||||||
|
|
||||||
INSTANTIATE_TYPE(double)
|
INSTANTIATE_TYPE(double)
|
||||||
|
|
||||||
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
INSTANTIATE_TYPE(float)
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ void openclBILU0<Scalar,block_size>::apply(const cl::Buffer& y, cl::Buffer& x)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INSTANCE_TYPE(T) \
|
#define INSTANTIATE_TYPE(T) \
|
||||||
template class openclBILU0<T,1>; \
|
template class openclBILU0<T,1>; \
|
||||||
template class openclBILU0<T,2>; \
|
template class openclBILU0<T,2>; \
|
||||||
template class openclBILU0<T,3>; \
|
template class openclBILU0<T,3>; \
|
||||||
@ -341,6 +341,10 @@ void openclBILU0<Scalar,block_size>::apply(const cl::Buffer& y, cl::Buffer& x)
|
|||||||
template class openclBILU0<T,5>; \
|
template class openclBILU0<T,5>; \
|
||||||
template class openclBILU0<T,6>;
|
template class openclBILU0<T,6>;
|
||||||
|
|
||||||
INSTANCE_TYPE(double)
|
INSTANTIATE_TYPE(double)
|
||||||
|
|
||||||
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
INSTANTIATE_TYPE(float)
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Accelerator
|
} // namespace Opm::Accelerator
|
||||||
|
@ -353,7 +353,7 @@ void openclBISAI<Scalar,block_size>::apply(const cl::Buffer& x, cl::Buffer& y)
|
|||||||
d_invL_x, y, Nb, bs); // application of isaiU is a simple spmv
|
d_invL_x, y, Nb, bs); // application of isaiU is a simple spmv
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INSTANCE_TYPE(T) \
|
#define INSTANTIATE_TYPE(T) \
|
||||||
template class openclBISAI<T,1>; \
|
template class openclBISAI<T,1>; \
|
||||||
template class openclBISAI<T,2>; \
|
template class openclBISAI<T,2>; \
|
||||||
template class openclBISAI<T,3>; \
|
template class openclBISAI<T,3>; \
|
||||||
@ -361,6 +361,10 @@ void openclBISAI<Scalar,block_size>::apply(const cl::Buffer& x, cl::Buffer& y)
|
|||||||
template class openclBISAI<T,5>; \
|
template class openclBISAI<T,5>; \
|
||||||
template class openclBISAI<T,6>;
|
template class openclBISAI<T,6>;
|
||||||
|
|
||||||
INSTANCE_TYPE(double)
|
INSTANTIATE_TYPE(double)
|
||||||
|
|
||||||
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
INSTANTIATE_TYPE(float)
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Accelerator
|
} // namespace Opm::Accelerator
|
||||||
|
@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
#include <opm/simulators/linalg/bda/Misc.hpp>
|
#include <opm/simulators/linalg/bda/Misc.hpp>
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace Opm::Accelerator {
|
namespace Opm::Accelerator {
|
||||||
|
|
||||||
using Dune::Timer;
|
using Dune::Timer;
|
||||||
@ -312,7 +314,7 @@ void openclCPR<Scalar,block_size>::apply(const cl::Buffer& y, cl::Buffer& x)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INSTANCE_TYPE(T) \
|
#define INSTANTIATE_TYPE(T) \
|
||||||
template class openclCPR<T,1>; \
|
template class openclCPR<T,1>; \
|
||||||
template class openclCPR<T,2>; \
|
template class openclCPR<T,2>; \
|
||||||
template class openclCPR<T,3>; \
|
template class openclCPR<T,3>; \
|
||||||
@ -320,6 +322,10 @@ void openclCPR<Scalar,block_size>::apply(const cl::Buffer& y, cl::Buffer& x)
|
|||||||
template class openclCPR<T,5>; \
|
template class openclCPR<T,5>; \
|
||||||
template class openclCPR<T,6>;
|
template class openclCPR<T,6>;
|
||||||
|
|
||||||
INSTANCE_TYPE(double)
|
INSTANTIATE_TYPE(double)
|
||||||
|
|
||||||
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
INSTANTIATE_TYPE(float)
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Accelerator
|
} // namespace Opm::Accelerator
|
||||||
|
@ -61,7 +61,7 @@ setOpencl(std::shared_ptr<cl::Context>& context_,
|
|||||||
queue = queue_;
|
queue = queue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INSTANCE_TYPE(T) \
|
#define INSTANTIATE_TYPE(T) \
|
||||||
template class openclPreconditioner<T,1>; \
|
template class openclPreconditioner<T,1>; \
|
||||||
template class openclPreconditioner<T,2>; \
|
template class openclPreconditioner<T,2>; \
|
||||||
template class openclPreconditioner<T,3>; \
|
template class openclPreconditioner<T,3>; \
|
||||||
@ -69,6 +69,10 @@ setOpencl(std::shared_ptr<cl::Context>& context_,
|
|||||||
template class openclPreconditioner<T,5>; \
|
template class openclPreconditioner<T,5>; \
|
||||||
template class openclPreconditioner<T,6>;
|
template class openclPreconditioner<T,6>;
|
||||||
|
|
||||||
INSTANCE_TYPE(double)
|
INSTANTIATE_TYPE(double)
|
||||||
|
|
||||||
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
INSTANTIATE_TYPE(float)
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace Opm::Accelerator
|
} // namespace Opm::Accelerator
|
||||||
|
Loading…
Reference in New Issue
Block a user