求大神指教,调用__syncthreads();函数, 显示错误未定义
cuda吧
全部回复
仅看楼主
level 2
调用时显示:未定义标识符:"__syncthreads" 。编译能通过,但是这个函数并没有在程序中起到作用。
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "device_functions.h"
#include <iostream>
#include <cstdio>
#include <cuda.h>
#include "device_functions.h"
头文件也加了,下面是错误列表。
1IntelliSense: 未定义标识符 "__syncthreads"e:\Visual C++\Test1\Test1\VectorDotProduct.cu342Test1
求教该怎么办?
2016年08月21日 05点08分 1
level 2
平台是VS 2012
2016年08月21日 05点08分 2
version: CUDA 7.5
2016年08月21日 05点08分
level 11
__syncthreads();是内核函数上用的,用于同步同块中的线程,这部分代码是nvcc编译的,不交给vc编译,vc只负责链接和编译本地代码,你需要检查一下是否有拼写错误,符号是否是半角符号。
2016年08月21日 12点08分 3
多谢
2016年08月21日 13点08分
1