Falcor
Falcor copied to clipboard
Falcor and CUDA: ambiguous naming for vector types
Hello,
while trying to combine Falcor and CUDA I ran into the issue of both using their own definition of vector types -- which one might guess -- does not lead to successful builds.
As far as I could see within the framework, there is not a good way to navigate around the issue.
This is because as soon as you type #include "Falcor.h"
one is automatically in the namespace of glm
. (Falcor.h
includes Framework.h
which is stating using namespace glm
).
As of the newest C++ standards there is no way to "un-use" a namespace which would easily resolve the ambiguity.
The colliding files are:
(Falcor) Framework/Externals/glm/gtx/compatability.hpp
(defines int3, float3, etc)
(CUDA) include/vector_types.h
(also defines int3, float3, etc)
I can understand that for the ease of use of the framework the use of the namespace glm
is necessary but it sadly limits the compatibility with CUDA. I would like to propose the removal of the using namespace glm
in Framework.h
and let the user of the framework decide if she/he wants to be in the namespace or not when coding their project.
• How to reproduce the issue: In any file just include the following
#include "Falcor.h"
#include "cuda_runtime.h"
Using CUDA 10.0, Faclor 3.1 and Visual Studio 2017 Enterprise.
cheers, Bootfighter
Thanks for bringing it to my attention.
The plan is indeed to get rid of using namespace glm
and also hide glm completely behind our own vector abstraction. This will happen in the next release