我的下面的代码出现错误,当它运行时,一些图形权重被覆盖,但不应该发生Xa数组(它保留了哪些已被访问过)和__syncthreads()函数... May有人帮忙吗?
struct Node
{
int begin; // begining of the substring
int num; // size of the sub-string
};
__global__ void BFS (Node *Va, int *Ea, bool *Fa, bool *Xa, int *Ca, bool *parada)
{
int tid = threadIdx.x;
if (Fa[tid] == true && Xa[tid] == false)
{
Fa[tid] = false;
__syncthreads();
// Va begin is where it's edges' subarray begins, Va is it's
// number of elements
for (int i = Va[tid].begin; i < (Va[tid].begin + Va[tid].num); i++) …Run Code Online (Sandbox Code Playgroud)