-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port Verdict to GPUs #5
base: master
Are you sure you want to change the base?
Conversation
|
||
static const double one_third = 1.0 / 3.0; | ||
static const double two_thirds = 2.0 / 3.0; | ||
static const double sqrt3 = std::sqrt(3.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer if I did something like the following so that sqrt3 is a constant on the host rather than always recomputed?
VERDICT_HOST_DEVICE static double sqrt3()
{
#if defined(VERDICT_DEVICE_COMPILE)
return sqrt(3);
#else
static const double s_sqrt3 = sqrt(3);
return s_sqrt3;
#endif
double warpage = std::pow( | ||
std::min(corner_normals[0] % corner_normals[2], corner_normals[1] % corner_normals[3]), 3); | ||
double warpage = fmin(corner_normals[0] % corner_normals[2], corner_normals[1] % corner_normals[3]); | ||
warpage = warpage * warpage * warpage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The c pow function is much slower for integer exponents than manually multiplying. Is this change acceptable or would you like me to write a cube function?
|
||
/* quality functions for hex elements */ | ||
|
||
//! Calculates hex edge ratio metric. | ||
/** Hmax / Hmin where Hmax and Hmin are respectively the maximum and the | ||
minimum edge lengths */ | ||
VERDICT_EXPORT double hex_edge_ratio(int num_nodes, const double coordinates[][3]); | ||
VERDICT_EXPORT VERDICT_HOST_DEVICE double hex_edge_ratio(int num_nodes, const double coordinates[][3]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could fold in VERDICT_HOST_DEVICE into the definition of VERDICT_EXPORT if desired.
@@ -4,10 +4,30 @@ | |||
|
|||
cmake_minimum_required(VERSION 3.16) | |||
|
|||
set(CMAKE_CXX_STANDARD 11) | |||
set(CMAKE_CXX_STANDARD_REQUIRED 1) | |||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change allows applications to build with newer c++ standards while leaving 11 as the default.
__host__ __device__
specifiers to all functions