Skip to content
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

CUDA bugfix does not compile in CUDA9 #910

Closed
hschwane opened this issue Jun 8, 2019 · 1 comment
Closed

CUDA bugfix does not compile in CUDA9 #910

hschwane opened this issue Jun 8, 2019 · 1 comment
Assignees
Milestone

Comments

@hschwane
Copy link

hschwane commented Jun 8, 2019

Compiling an Application using glm with CUDA9 gives me the following error:

/usr/include/glm/gtx/fast_square_root.inl(26): error: identifier "T" is undefined

/usr/include/glm/gtx/fast_square_root.inl(26): error: identifier "Q" is undefined

/usr/include/glm/gtx/fast_square_root.inl(26): error: argument list for alias template "glm::tvec1" is missing

Changeing /usr/include/glm/gtx/fast_square_root.inl
from

	// fastInversesqrt
	template<typename genType>
	GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x)
	{
#		ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
			vec<1, T, Q> tmp(detail::compute_inversesqrt<tvec1, genType, lowp, detail::is_aligned<lowp>::value>::call(vec<1, genType, lowp>(x)));
			return tmp.x;
#		else
			return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned<lowp>::value>::call(vec<1, genType, lowp>(x)).x;
#		endif
	}

to

	// fastInversesqrt
	template<typename genType>
	GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x)
	{
//#		ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
//			vec<1, T, Q> tmp(detail::compute_inversesqrt<tvec1, genType, lowp, detail::is_aligned<lowp>::value>::call(vec<1, genType, lowp>(x)));
//			return tmp.x;
//#		else
			return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned<lowp>::value>::call(vec<1, genType, lowp>(x)).x;
//#		endif
	}

resolves the issue, however i suspect this will break CUDA6 support...

Groovounet added a commit that referenced this issue Sep 7, 2019
@Groovounet Groovounet self-assigned this Sep 7, 2019
@Groovounet Groovounet added this to the GLM 0.9.9 milestone Sep 7, 2019
@Groovounet
Copy link
Member

This issue should be fixed in master branch for GLM 0.9.9.6 release

Thanks for reporting,
Christophe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants