g++-5 lib.cpp -c -o lib.o -std=c++11
nvcc test.cu -ccbin /usr/bin/g++-5 -std=c++11 -c -o test.o
g++-5 lib.o test.o -L/opt/cuda/lib64 -lcudart
./a.out
Would not prints 1
as expected.
#include <glm/glm.hpp> | |
int g(glm::vec3 x) { | |
glm::vec3 xx = x + x; | |
return xx.y; | |
} |
#include <iostream> | |
#include <glm/glm.hpp> | |
int f(glm::vec3 x) { | |
glm::vec3 xx = x + x; | |
return xx.x; | |
} | |
int main() { | |
glm::vec3 v(0.5f); | |
std::cout << f(v) << std::endl; | |
return 0; | |
} |