text: Hello All,
  I’m trying to build a quadtree in CUDA and I’m having some trouble with it.
  I’ve learned that cudaMalloc() is a host function so I can’t put allocating new children on the GPU so the only thing I really can do is thread the point location. Granted, this isn’t my actual project but it’s exactly similar, to explain my motivations.
  The only issue is, I don’t know how to make recursive calls. I want a parent thread to send more threads to search each child (assuming it’s valid, i.e. point is contained somewhere) but I’m starting to think my GPU isn’t advanced enough (GTX 460).
  My compile line is : nvcc -arch sm_35 -o qtree qtree.cu
  And my code is (also note, I do expect undefined behaviour but this won’t even compile):
  #include <stdio.h> #include <stdlib.h> #include <cuda.h> struct node { unsigned int level; struct node *parent; struct node *children[4]; }; __global__ void memoryCheck(struct node *root) { if (root) { root->level = 123; } if (root->children[0]) memoryCheck<<<1, 1>>>(root->children[0]); return; } int main(void) { struct node *root; if (cudaMalloc((void**) &root, sizeof(*root))) printf("Allocation failed\n"); if (cudaMalloc((void**) &root->children[0], sizeof(*root))) printf("Allocation failed\n"); memoryCheck<<<1, 1>>>(root); struct node *host_root = (struct node*) malloc(sizeof(*host_root)); host_root->level = 0; cudaMemcpy(host_root, root, sizeof(*root), cudaMemcpyDeviceToHost); printf("%d\n", host_root->level); cudaFree(root->children[0]); cudaFree(root); free(host_root); cudaDeviceReset(); return 0; }
  But I get this from the command line :
  ptxas fatal : Unresolved extern function ‘cudaGetParameterBuffer’
  Does anyone have any examples of quadtrees and CUDA? I’ve learned that I must build the tree on the host and that I must search it on the device but that search hurdle, man.