-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixed some bugs, most notably in restarting
- Loading branch information
1 parent
08ba9ab
commit c2fcb0f
Showing
10 changed files
with
539 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "asgard_pde.hpp" | ||
|
||
#include "device/asgard_kronmult_common.hpp" | ||
|
||
namespace asgard | ||
{ | ||
|
||
template<typename P> | ||
void builtin_v<P>::positive(std::vector<P> const &x, std::vector<P> &y) | ||
{ | ||
#pragma omp parallel for | ||
for (size_t i = 0; i < x.size(); i++) | ||
y[i] = std::max(P{0}, x[i]); | ||
} | ||
template<typename P> | ||
void builtin_v<P>::negative(std::vector<P> const &x, std::vector<P> &y) | ||
{ | ||
#pragma omp parallel for | ||
for (size_t i = 0; i < x.size(); i++) | ||
y[i] = std::min(P{0}, x[i]); | ||
} | ||
|
||
template<typename P> | ||
void builtin_v<P>::sin(std::vector<P> const &x, std::vector<P> &y) { | ||
ASGARD_OMP_PARFOR_SIMD | ||
for (size_t i = 0; i < x.size(); i++) | ||
y[i] = std::sin(x[i]); | ||
} | ||
template<typename P> | ||
void builtin_v<P>::cos(std::vector<P> const &x, std::vector<P> &y) { | ||
ASGARD_OMP_PARFOR_SIMD | ||
for (size_t i = 0; i < x.size(); i++) | ||
y[i] = std::cos(x[i]); | ||
} | ||
template<typename P> | ||
void builtin_v<P>::dcos(std::vector<P> const &x, std::vector<P> &y) { | ||
ASGARD_OMP_PARFOR_SIMD | ||
for (size_t i = 0; i < x.size(); i++) | ||
y[i] = -std::sin(x[i]); | ||
} | ||
|
||
#ifdef ASGARD_ENABLE_DOUBLE | ||
template struct builtin_v<double>; | ||
#endif | ||
|
||
#ifdef ASGARD_ENABLE_FLOAT | ||
template struct builtin_v<float>; | ||
#endif | ||
} // namespace asgard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.