compile with nvcc --device-emulation -c bug-example.cu and it fails with “[font=“Courier”]error: ‘__N8MyStruct5HELLOE’ was not declared in this scope[/font]”, with nvcc -c bug-example.cu it works.
#include <cuda.h>
struct MyStruct {
enum HelloWorldEnum { NONE = 0, HELLO = 1 };
};
__global__ void device_main() {
MyStruct::HelloWorldEnum v = MyStruct::HELLO;
}
int cuda_main() {
device_main<<< 1, 1 >>>();
return 0;
}
gatoatigrado@oliver:~/sandbox/.cuda_memcpy> nvcc -V
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2007 NVIDIA Corporation
Built on Tue_Jun_10_05:42:45_PDT_2008
Cuda compilation tools, release 1.1, V0.2.1221
pretty sure about this, don’t kill me if I’m wrong.
Cheers,
Nicholas