mirror of
https://github.com/icaven/glm.git
synced 2025-12-06 16:56:56 +08:00
Changed the assert to a define so that it removed for CUDA debug compiles
This commit is contained in:
parent
f6ae02c608
commit
a1af57aaac
@ -57,7 +57,8 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < this->length());
|
||||
ASSERT(i < this->length());
|
||||
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -68,9 +69,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
assert(i < this->length());
|
||||
#endif
|
||||
ASSERT(i < this->length());
|
||||
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < this->length());
|
||||
ASSERT(i < this->length());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
ASSERT(i < this->length());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
|
||||
@ -88,6 +88,12 @@
|
||||
//#include <type_traits>
|
||||
#include "core/setup.hpp"
|
||||
|
||||
#if (GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
#define ASSERT(s)
|
||||
#else
|
||||
#define ASSERT(s) assert(s);
|
||||
#endif
|
||||
|
||||
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED))
|
||||
# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED
|
||||
# pragma message("GLM: Core library included")
|
||||
|
||||
@ -49,18 +49,14 @@ namespace detail
|
||||
|
||||
GLM_FUNC_QUALIFIER half & tvec2<half>::operator[](tvec2<half>::size_type i)
|
||||
{
|
||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
assert(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
||||
#endif
|
||||
ASSERT(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
||||
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER half const & tvec2<half>::operator[](tvec2<half>::size_type i) const
|
||||
{
|
||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
assert(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
||||
#endif
|
||||
ASSERT(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
||||
|
||||
return (&x)[i];
|
||||
}
|
||||
@ -331,9 +327,7 @@ namespace detail
|
||||
tvec3<half>::size_type i
|
||||
)
|
||||
{
|
||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
assert(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
||||
#endif
|
||||
ASSERT(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
||||
|
||||
return (&x)[i];
|
||||
}
|
||||
@ -343,9 +337,7 @@ namespace detail
|
||||
tvec3<half>::size_type i
|
||||
) const
|
||||
{
|
||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
assert(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
||||
#endif
|
||||
ASSERT(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
||||
|
||||
return (&x)[i];
|
||||
}
|
||||
@ -652,9 +644,7 @@ namespace detail
|
||||
tvec4<half>::size_type i
|
||||
)
|
||||
{
|
||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
assert(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
||||
#endif
|
||||
ASSERT(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
||||
|
||||
return (&x)[i];
|
||||
}
|
||||
@ -664,9 +654,7 @@ namespace detail
|
||||
tvec4<half>::size_type i
|
||||
) const
|
||||
{
|
||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||
assert(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
||||
#endif
|
||||
ASSERT(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
||||
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user