程序运行时以下几行代码出错,程序中断,上网查了一下是因为event1,event2地址为0xcccccccc。而没有指针初始化,然后是野指针。这几个函数是CUDA函数。奇怪的是我这个程序前面也有用到这几行代码,运行是完全正确的,在cudaEventCreate中会指针初始化,不明白一样的代码为什么后面就出错了。求C++大佬帮忙解答下,并告诉我下怎么解决该问题。
cudaEvent_t event1, event2;
cudaEventCreate(&event1);
cudaEventCreate(&event2);
cudaEventRecord(event1);
附调试时变量图